Call dummy_frame_dtor_ftype also from remove_dummy_frame

There was now a leak-like bug that if dummy_frame "disappeared" by
remove_dummy_frame then its destructor was not called.  For example in the case
of 'compile code' dummy frames the injected objfile would never get freed after
some inferior longjmp out of the injected code.

gdb/ChangeLog
2015-05-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* compile/compile-object-run.c (do_module_cleanup): Add parameter
	registers_valid.
	(compile_object_run): Update do_module_cleanup caller.
	* dummy-frame.c: Include infcall.h.
	(struct dummy_frame): Update dtor comment.
	(remove_dummy_frame): Call dtor.
	(pop_dummy_frame): Update dtor caller.
	* dummy-frame.h (dummy_frame_dtor_ftype): Add parameter
	registers_valid.
This commit is contained in:
Jan Kratochvil
2015-05-13 20:47:32 +02:00
parent 1c4eb778a2
commit 5e9705017f
4 changed files with 23 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ struct do_module_cleanup
static dummy_frame_dtor_ftype do_module_cleanup;
static void
do_module_cleanup (void *arg)
do_module_cleanup (void *arg, int registers_valid)
{
struct do_module_cleanup *data = arg;
struct objfile *objfile;
@@ -129,7 +129,7 @@ compile_object_run (struct compile_module *module)
data->executedp = NULL;
gdb_assert (!(dtor_found && executed));
if (!dtor_found && !executed)
do_module_cleanup (data);
do_module_cleanup (data, 0);
throw_exception (ex);
}
END_CATCH