diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2014-06-02 11:35:22 +0200 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2014-06-06 09:40:02 +0200 |
commit | c33b2f12584e8ae5be0e7a54927194d6b5851623 (patch) | |
tree | deb833c67b35e54cd9b0dac52132b84be1ea86d0 /gdb/symfile.c | |
parent | 34fd659b79bed7333311a092e18f990e3bd31b2f (diff) | |
download | gdb-c33b2f12584e8ae5be0e7a54927194d6b5851623.zip gdb-c33b2f12584e8ae5be0e7a54927194d6b5851623.tar.gz gdb-c33b2f12584e8ae5be0e7a54927194d6b5851623.tar.bz2 |
symfile, vdso: remove target sections
Target sections added by the add-symbol-file-from-memory command are not
removed when the process exits. In fact, they are not removed, at all.
This causes GDB to crash in gdb.base/break-interp.exp.
Change the owner of those target sections to the object file generated in
symbol_file_add_from_memory and generalize the free_objfile observer in
symfile.c to remove target sections of any freed object file.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 64a83c6..7ad4a44 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3892,8 +3892,8 @@ symfile_find_segment_sections (struct objfile *objfile) static void symfile_free_objfile (struct objfile *objfile) { - /* Remove the target sections of user-added objfiles. */ - if (objfile != 0 && objfile->flags & OBJF_USERLOADED) + /* Remove the target sections owned by this objfile. */ + if (objfile != NULL) remove_target_sections ((void *) objfile); } |