From: Jim Blandy Date: Fri, 8 Nov 2002 20:05:10 +0000 (+0000) Subject: * dwarf2read.c (read_func_scope): Restore list_in_scope properly X-Git-Tag: cagney-unwind-20030108-branchpoint~856 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=921e78cf01505c9a7039149a1646c50f8d010539;p=external%2Fbinutils.git * dwarf2read.c (read_func_scope): Restore list_in_scope properly when we finish a function a context. * buildsym.h (outermost_context_p): New macro. (Bug analyzed by David Edelsohn.) --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7985ef7..38edccb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2002-11-08 Jim Blandy + + * dwarf2read.c (read_func_scope): Restore list_in_scope properly + when we finish a function a context. + * buildsym.h (outermost_context_p): New macro. + (Bug analyzed by David Edelsohn.) + 2002-11-08 Andrew Cagney * blockframe.c: Include "dummy-frame.h". diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 8a252cb..968a579 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -179,6 +179,9 @@ EXTERN int context_stack_size; #define pop_context() (&context_stack[--context_stack_depth]); +/* Non-zero if the context stack is empty. */ +#define outermost_context_p() (context_stack_depth == 0) + /* Nonzero if within a function (so symbols should be local, if nothing says specifically). */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7e017c6..13ddaea 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2021,7 +2021,10 @@ read_func_scope (struct die_info *die, struct objfile *objfile, local_symbols = new->locals; param_symbols = new->params; - list_in_scope = &file_symbols; + /* If we've finished processing a top-level function, subsequent + symbols go in the file symbol list. */ + if (outermost_context_p ()) + list_in_scope = &file_symbols; } /* Process all the DIES contained within a lexical block scope. Start