From: John Gilmore Date: Sat, 13 Apr 1991 22:29:36 +0000 (+0000) Subject: * coffread.c (end_psymtab): Free named symtabs and psymtabs for X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6e2b4241e9d830169f32e21997b175523cff377;p=binutils-gdb.git * coffread.c (end_psymtab): Free named symtabs and psymtabs for a file, once a new symtab has been read for it. * symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New defines for the blocks of a blockvector that contain global and file-static symbols and the first of the smaller scope contours. * symtab.c (lookup_symbol, find_pc_symtab, find_pc_line, decode_line_1, make_symbol_completion_list): Use the above. * coffread.c (end_symtab, patch_opaque_types): Ditto. --- diff --git a/gdb/coffread.c b/gdb/coffread.c index 0e6b2c7a37f..ab9448533a2 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -489,7 +489,8 @@ end_symtab () return; } - /* Create the two top-level blocks for this file. */ + /* Create the two top-level blocks for this file (STATIC_BLOCK and + GLOBAL_BLOCK). */ finish_block (0, &file_symbols, 0, cur_src_start_addr, cur_src_end_addr); finish_block (0, &global_symbols, 0, cur_src_start_addr, cur_src_end_addr); @@ -517,6 +518,8 @@ end_symtab () symtab->coffsyn = last_coffsyn; #endif + free_named_symtabs (symtab->filename); + /* Link the new symtab into the list of such. */ symtab->next = symtab_list; symtab_list = symtab; @@ -1373,7 +1376,7 @@ patch_opaque_types () register int i; /* Go through the per-file symbols only */ - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1); + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--) { register struct symbol *real_sym;