From 5e9705017f5b257421136b8d7752b9c793335ace Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 13 May 2015 20:47:32 +0200 Subject: 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 * 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. --- gdb/compile/compile-object-run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/compile') diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c index 6738aad..422693b 100644 --- a/gdb/compile/compile-object-run.c +++ b/gdb/compile/compile-object-run.c @@ -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 -- cgit v1.1