Bug 7894 - no symbol in context C++ with inner scope subprogram
Summary: no symbol in context C++ with inner scope subprogram
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 5.2
: P3 normal
Target Milestone: 6.8
Assignee: Jim Blandy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-06 14:18 UTC by marc_auslander
Modified: 2009-05-21 17:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
bar.C (132 bytes, application/octet-stream)
, marc_auslander
Details
dwarf2read.diff (142 bytes, application/octet-stream)
, marc_auslander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marc_auslander 2002-10-06 21:18:00 UTC
[Converted from Gnats 789]

If a C++ program has an inner subprogram, for example a method inside a class defined inside the program, symbol definitions are lost.  In addition, symbol definitions are lost for the inner subprogram.  In dwarf2read.c, it appears that read_func_scope is called recursively to process the inner subprogram, and this recursive call does not correctly restore local_symbols or list_in_scope.  "Fixing" this gets symbols for the outer function, but the inner still has no symbols.

Release:
5.2.1.0.90_2002-09-04-cvs

Environment:
All environments, I believe, using dwarf2.

How-To-Repeat:
gcc bar.C -o bar -ggdb -O0
gdb bar
br main
run
p rc
step into inner
p innerrc
Comment 1 Jim Blandy 2002-11-06 20:26:49 UTC
Responsible-Changed-From-To: unassigned->jimb
Responsible-Changed-Why: I'll take care of this one.
Comment 2 Tom Tromey 2009-05-21 17:14:29 UTC
The outer variable works fine with gdb 6.8.
The problem with the inner variable is actually a gcc debug info
regression:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574

I tried a gcc that has this fixed, and it all worked fine.
So, I'm closing this.