summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2002-11-08 19:33:37 +0000
committerJim Blandy <jimb@codesourcery.com>2002-11-08 19:33:37 +0000
commitfa19293bf7cc9724007c610fa4efa2d6bd7ccd71 (patch)
treecef4821921629923a5808145629b94b29e34beb2 /gdb/dwarf2read.c
parentc0f32f54dada0a2c7b1e15d1323b6249403dae98 (diff)
downloadgdb-fa19293bf7cc9724007c610fa4efa2d6bd7ccd71.tar.gz
* dwarf2read.c (read_func_scope): Restore local_symbols and
param_symbols after we finish the function context. (Based on a patch from David Edelsohn.)
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7ede81b71f1..7e017c6dfc0 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2013,6 +2013,14 @@ read_func_scope (struct die_info *die, struct objfile *objfile,
/* Make a block for the local symbols within. */
finish_block (new->name, &local_symbols, new->old_blocks,
lowpc, highpc, objfile);
+
+ /* In C++, we can have functions nested inside functions (e.g., when
+ a function declares a class that has methods). This means that
+ when we finish processing a function scope, we may need to go
+ back to building a containing block's symbol lists. */
+ local_symbols = new->locals;
+ param_symbols = new->params;
+
list_in_scope = &file_symbols;
}