diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1995-10-28 11:57:02 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1995-10-28 11:57:02 +0000 |
commit | b1027aa45879cf41913c12987b4c4db330c1e4d2 (patch) | |
tree | 6fc5fd343b0d50aa72fe0d0ba5d8537c097373c3 /gdb | |
parent | 356c68ff6291e07f1fa9934036e2884d6a0f19f9 (diff) | |
download | gdb-b1027aa45879cf41913c12987b4c4db330c1e4d2.zip gdb-b1027aa45879cf41913c12987b4c4db330c1e4d2.tar.gz gdb-b1027aa45879cf41913c12987b4c4db330c1e4d2.tar.bz2 |
* symtab.h (enum address_class): Add LOC_UNRESOLVED for
a location whose address has to be resolved via the minimal
symbol table.
* buildsym.c (finish_block), findvar.c (symbol_read_needs_frame,
read_var_value), printcmd.c (address_info),
symmisc.c (print_symbol, print_partial_symbol): Handle
LOC_UNRESOLVED.
* stabsread.c (scan_file_globals): Change unresolved LOC_STATIC
symbols to LOC_UNRESOLVED. Remove rt_common_objfile lookup
kludge, global common symbols are now handled by LOC_UNRESOLVED.
(scan_file_globals_1): Move code back to scan_file_globals,
delete.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 15 | ||||
-rw-r--r-- | gdb/buildsym.c | 2 | ||||
-rw-r--r-- | gdb/stabsread.c | 54 |
3 files changed, 36 insertions, 35 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 26e2b6e..fff1da1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +Sat Oct 28 04:52:36 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * symtab.h (enum address_class): Add LOC_UNRESOLVED for + a location whose address has to be resolved via the minimal + symbol table. + * buildsym.c (finish_block), findvar.c (symbol_read_needs_frame, + read_var_value), printcmd.c (address_info), + symmisc.c (print_symbol, print_partial_symbol): Handle + LOC_UNRESOLVED. + * stabsread.c (scan_file_globals): Change unresolved LOC_STATIC + symbols to LOC_UNRESOLVED. Remove rt_common_objfile lookup + kludge, global common symbols are now handled by LOC_UNRESOLVED. + (scan_file_globals_1): Move code back to scan_file_globals, + delete. + Fri Oct 27 09:54:07 1995 Stu Grossman (grossman@cygnus.com) * breakpoint.c (breakpoint_re_set): #ifdef GET_LONGJMP_TARGET diff --git a/gdb/buildsym.c b/gdb/buildsym.c index fab3a37..c9c30b0 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -260,6 +260,7 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: default: break; @@ -295,6 +296,7 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: default: break; diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 74e8bc1..ac6c734 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -189,7 +189,7 @@ struct complaint rs6000_builtin_complaint = {"Unknown builtin type %d", 0, 0}; struct complaint unresolved_sym_chain_complaint = - {"%s: `%s' from global_sym_chain unresolved", 0, 0}; + {"%s: common block `%s' from global_sym_chain unresolved", 0, 0}; struct complaint stabs_general_complaint = {"%s", 0, 0}; @@ -3884,13 +3884,10 @@ GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0}; /* Scan through all of the global symbols defined in the object file, assigning values to the debugging symbols that need to be assigned - to. Get these symbols from the minimal symbol table. - Return 1 if there might still be unresolved debugging symbols, else 0. */ + to. Get these symbols from the minimal symbol table. */ -static int scan_file_globals_1 PARAMS ((struct objfile *)); - -static int -scan_file_globals_1 (objfile) +void +scan_file_globals (objfile) struct objfile *objfile; { int hash; @@ -3905,12 +3902,11 @@ scan_file_globals_1 (objfile) break; } if (hash >= HASHSIZE) - return 0; - - if (objfile->msymbols == 0) /* Beware the null file. */ - return 1; + return; - for (msymbol = objfile -> msymbols; SYMBOL_NAME (msymbol) != NULL; msymbol++) + for (msymbol = objfile -> msymbols; + msymbol && SYMBOL_NAME (msymbol) != NULL; + msymbol++) { QUIT; @@ -3979,39 +3975,27 @@ scan_file_globals_1 (objfile) } } } - return 1; -} - -/* Assign values to global debugging symbols. - Search the passed objfile first, then try the runtime common symbols. - Complain about any remaining unresolved symbols and remove them - from the chain. */ - -void -scan_file_globals (objfile) - struct objfile *objfile; -{ - int hash; - struct symbol *sym, *prev; - - if (scan_file_globals_1 (objfile) == 0) - return; - if (rt_common_objfile && scan_file_globals_1 (rt_common_objfile) == 0) - return; + /* Change the storage class of any remaining unresolved globals to + LOC_UNRESOLVED and remove them from the chain. */ for (hash = 0; hash < HASHSIZE; hash++) { sym = global_sym_chain[hash]; while (sym) { - complain (&unresolved_sym_chain_complaint, - objfile->name, SYMBOL_NAME (sym)); + prev = sym; + sym = SYMBOL_VALUE_CHAIN (sym); /* Change the symbol address from the misleading chain value to address zero. */ - prev = sym; - sym = SYMBOL_VALUE_CHAIN (sym); SYMBOL_VALUE_ADDRESS (prev) = 0; + + /* Complain about unresolved common block symbols. */ + if (SYMBOL_CLASS (prev) == LOC_STATIC) + SYMBOL_CLASS (prev) = LOC_UNRESOLVED; + else + complain (&unresolved_sym_chain_complaint, + objfile->name, SYMBOL_NAME (prev)); } } memset (global_sym_chain, 0, sizeof (global_sym_chain)); |