From 4dbdbfc4d3dff2234894d5a048a84f0361277213 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Wed, 17 Dec 1997 16:50:18 +0000 Subject: 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 --- gdb/hpread.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'gdb/hpread.c') diff --git a/gdb/hpread.c b/gdb/hpread.c index 8183558..0e41746 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -938,21 +938,8 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset, is wrong, in that a psymtab with N_SLINE entries but nothing else is not empty, but we don't realize that. Fixing that without slowing things down might be tricky. */ - 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; - - /* 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; -- cgit v1.1