This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: dwarf2read.c: restore list_in_scope properly
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 08 Nov 2002 14:50:30 -0500
- Subject: PATCH: dwarf2read.c: restore list_in_scope properly
2002-11-08 Jim Blandy <jimb@redhat.com>
* 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.)
Index: gdb/buildsym.h
===================================================================
RCS file: /cvs/src/src/gdb/buildsym.h,v
retrieving revision 1.5
diff -c -r1.5 buildsym.h
*** gdb/buildsym.h 21 Aug 2002 00:57:42 -0000 1.5
--- gdb/buildsym.h 8 Nov 2002 20:01:25 -0000
***************
*** 179,184 ****
--- 179,187 ----
#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). */
Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.73
diff -c -r1.73 dwarf2read.c
*** gdb/dwarf2read.c 8 Nov 2002 19:33:37 -0000 1.73
--- gdb/dwarf2read.c 8 Nov 2002 20:01:28 -0000
***************
*** 2021,2027 ****
local_symbols = new->locals;
param_symbols = new->params;
! list_in_scope = &file_symbols;
}
/* Process all the DIES contained within a lexical block scope. Start
--- 2021,2030 ----
local_symbols = new->locals;
param_symbols = new->params;
! /* 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