diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-06 00:08:07 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-06 00:08:07 +0000 |
commit | 3d5203bc24a93fca8e79e265fec43dacd7a3340d (patch) | |
tree | b7143b1b800eefebe82d19974ea3b0294167f8af /gdb/objfiles.c | |
parent | d64a6a62e95fc4342619fc0c4631185dac5c2c4a (diff) | |
download | gdb-3d5203bc24a93fca8e79e265fec43dacd7a3340d.tar.gz |
gdb/
Fix crash regression on systems featuring .gdb_index.
* objfiles.c (free_objfile): Move the
forget_cached_source_info_for_objfile call earlier. Comment it.
Extend the comment for objfile_free_data.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 1664e429f0a..db01f424588 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -583,6 +583,10 @@ free_objfile (struct objfile *objfile) lists. */ preserve_values (objfile); + /* It still may reference data modules have associated with the objfile and + the symbol file data. */ + forget_cached_source_info_for_objfile (objfile); + /* First do any symbol file specific actions required when we are finished with a particular symbol file. Note that if the objfile is using reusable symbol information (via mmalloc) then each of @@ -595,7 +599,8 @@ free_objfile (struct objfile *objfile) (*objfile->sf->sym_finish) (objfile); } - /* Discard any data modules have associated with the objfile. */ + /* Discard any data modules have associated with the objfile. The function + still may reference objfile->obfd. */ objfile_free_data (objfile); gdb_bfd_unref (objfile->obfd); @@ -637,8 +642,6 @@ free_objfile (struct objfile *objfile) clear_current_source_symtab_and_line (); } - forget_cached_source_info_for_objfile (objfile); - /* The last thing we do is free the objfile struct itself. */ xfree (objfile->name); |