diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-05-13 20:47:32 +0200 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-05-13 20:47:32 +0200 |
commit | 5e9705017f5b257421136b8d7752b9c793335ace (patch) | |
tree | da7d4b8b721cbf9529eea378a337fcf3e625b8ea /gdb/compile/compile-object-run.c | |
parent | 1c4eb778a28447d764235b8810d382b40b2a054c (diff) | |
download | gdb-5e9705017f5b257421136b8d7752b9c793335ace.zip gdb-5e9705017f5b257421136b8d7752b9c793335ace.tar.gz gdb-5e9705017f5b257421136b8d7752b9c793335ace.tar.bz2 |
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.
Diffstat (limited to 'gdb/compile/compile-object-run.c')
-rw-r--r-- | gdb/compile/compile-object-run.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |