aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2002-05-10 07:32:50 +0000
committerKevin Buettner <kevinb@redhat.com>2002-05-10 07:32:50 +0000
commit1f077a3e7c3992ced4c5e02908857ca985607ca1 (patch)
treeb36e8882fd2e40dc47be356377a9d25a6f5b078b /gdb/dbxread.c
parentc432ba1a88626b52643960948093f551f53ec58e (diff)
downloadgdb-1f077a3e7c3992ced4c5e02908857ca985607ca1.zip
gdb-1f077a3e7c3992ced4c5e02908857ca985607ca1.tar.gz
gdb-1f077a3e7c3992ced4c5e02908857ca985607ca1.tar.bz2
* dbxread.c (discarding_local_symbols_complaint): New complaint.
(process_one_symbol): Complain about discarding local symbols due to a misplaced N_LBRAC entry.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 9b2b73b..430e3f5 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -203,6 +203,9 @@ struct complaint repeated_header_complaint =
struct complaint unclaimed_bincl_complaint =
{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
+
+struct complaint discarding_local_symbols_complaint =
+{"misplaced N_LBRAC entry; discarding local symbols which have no enclosing block", 0, 0};
/* find_text_range --- find start and end of loadable code sections
@@ -2881,7 +2884,21 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
/* Can only use new->locals as local symbols here if we're in
gcc or on a machine that puts them before the lbrack. */
if (!VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
- local_symbols = new->locals;
+ {
+ if (local_symbols != NULL)
+ {
+ /* GCC development snapshots from March to December of
+ 2000 would output N_LSYM entries after N_LBRAC
+ entries. As a consequence, these symbols are simply
+ discarded. Complain if this is the case. Note that
+ there are some compilers which legitimately put local
+ symbols within an LBRAC/RBRAC block; this complaint
+ might also help sort out problems in which
+ VARIABLES_INSIDE_BLOCK is incorrectly defined. */
+ complain (&discarding_local_symbols_complaint);
+ }
+ local_symbols = new->locals;
+ }
if (context_stack_depth
> !VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))