Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 22671 - gdb does not find locally scoped symbols
gdb does not find locally scoped symbols
Status: CLOSED DUPLICATE of bug 18707
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2000-12-21 11:47 EST by Rick Delashmit
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-12-26 18:07:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rick Delashmit 2000-12-21 11:47:40 EST
When debugging a c++ program, gdb is unable to find symbols in scopes more
local than function level.  Source and directions for repeating the problem

--- source file a.cxx

class Test
	void Init()
		a = 0;
	int a;

int main(int argc, char* argv[])
		TestClass t;
	return 0;

--- end source file a.cxx

compiled with 'g++ -g -o a a.cxx'
debugged with 'gdb a'
in gdb:
	break TestClass::Init
(breaks in TestClass::Init())
	frame 1
	p t
t should be in scope here, as we are at the t.Init() line.  Instead we
get a 'No symbol "t" in current context.' message.

I tested this on an RH6.2 system and it worked properly.
Comment 1 Rick Delashmit 2000-12-21 16:40:17 EST
I ran this test case using
'kgcc -x c++ -o a a.cxx'
(kgcc as shipped with RH7, egcs-2.91.66)
to compile it, and it worked correctly, so this appears likely to be a bug with
the debug info output by the gcc 2.96 package, rather than with gdb.
Comment 2 Trond Eivind Glomsrxd 2000-12-26 18:06:29 EST
jakub, assigning to you... I know I did so a couple of months ago with a very 
similar bug (probably duplicate), but you know the gcc bu
Comment 3 Trond Eivind Glomsrxd 2000-12-26 18:06:57 EST
g numbers better than me.
Comment 4 Jakub Jelinek 2000-12-31 06:14:57 EST

*** This bug has been marked as a duplicate of 18707 ***

Note You need to log in before you can comment on or make changes to this bug.