aboutsummaryrefslogtreecommitdiff
path: root/gdb/os9kread.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-12-17 16:50:18 +0000
committerAndrew Cagney <cagney@redhat.com>1997-12-17 16:50:18 +0000
commit4dbdbfc4d3dff2234894d5a048a84f0361277213 (patch)
tree39a40cd323fcdceb56e40d75be1d960cbd458edb /gdb/os9kread.c
parent6124cd1e59f077d87fb718f1e36ead2cbe38c6ff (diff)
downloadgdb-4dbdbfc4d3dff2234894d5a048a84f0361277213.zip
gdb-4dbdbfc4d3dff2234894d5a048a84f0361277213.tar.gz
gdb-4dbdbfc4d3dff2234894d5a048a84f0361277213.tar.bz2
o Fix code deleting psymtab entry from objfile's list.
Only worked if the first element in the list was being deleted. o When MAINLINE (reading main objectfile and need to clear out old data), change elfread.c so that the psymbol table is emptied once (in elf_symfile_read) instead of multiple times in each *_read_psymtab function. o For elf_symfile_read, load dwarf2 symbols last (so that they are searched for first). o In mdebug_psymtab_read, delete check to see if symbols for current source file already loaded. Test doesn't work for .h files. Above change works better
Diffstat (limited to 'gdb/os9kread.c')
-rw-r--r--gdb/os9kread.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/gdb/os9kread.c b/gdb/os9kread.c
index 4370653..e143090 100644
--- a/gdb/os9kread.c
+++ b/gdb/os9kread.c
@@ -1003,7 +1003,7 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
CORE_ADDR capping_text;
struct partial_symtab **dependency_list;
int number_dependencies;
-/* struct partial_symbol *capping_global, *capping_static;*/
+ /* struct partial_symbol *capping_global, *capping_static; */
{
int i;
struct partial_symtab *p1;
@@ -1160,22 +1160,10 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
&& pst->n_static_syms == 0) {
/* Throw away this psymtab, it's empty. We can't deallocate it, since
it is on the obstack, but we can forget to chain it on the list. */
- struct partial_symtab *prev_pst;
-
- /* First, snip it out of the psymtab chain */
-
- if (pst->objfile->psymtabs == pst)
- pst->objfile->psymtabs = pst->next;
- else
- for (prev_pst = pst->objfile->psymtabs; prev_pst; prev_pst = pst->next)
- if (prev_pst->next == pst)
- prev_pst->next = pst->next;
+ /* Indicate that psymtab was thrown away. */
- /* Next, put it on a free list for recycling */
- pst->next = pst->objfile->free_psymtabs;
- pst->objfile->free_psymtabs = pst;
+ discard_psymtab (pst);
- /* Indicate that psymtab was thrown away. */
pst = (struct partial_symtab *)NULL;
}
return pst;