Bug 7934 - GDB doesn't know about using directives
Summary: GDB doesn't know about using directives
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 11211
  Show dependency treegraph
 
Reported: 2002-11-15 13:48 UTC by David Carlton
Modified: 2010-03-10 01:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlton 2002-11-15 21:48:02 UTC
[Converted from Gnats 829]

GDB doesn't know about using directives in C++

Release:
GNU gdb 2002-11-15-cvs

Environment:
any

How-To-Repeat:
Compile this file:

namespace A {
  int x = 1;
}

using namespace A;

int main()
{
  x;

  return 0;
}

Then try to print out x:

(gdb) b main
Breakpoint 1 at 0x80484a0: file using-direct.cc, line 11.
(gdb) r
Starting program: /cartan/carlton/sync/gdb-backup/namespace/prs/using-direct 

Breakpoint 1, main () at using-direct.cc:11
11	  return 0;
(gdb) p x
No symbol "x" in current context.
Comment 1 David Carlton 2002-11-15 21:48:02 UTC
Fix:
A good first step would be for GCC to generate the appropriate
debugging information...
Comment 2 David Carlton 2004-03-17 20:15:29 UTC
From: David Carlton <carlton@kealia.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: gdb/829: GDB doesn't know about using directives
Date: Wed, 17 Mar 2004 12:15:29 -0800

 On 15 Nov 2002 21:42:50 -0000, carlton@math.Stanford.EDU said:
 
 > A good first step would be for GCC to generate the appropriate
 > debugging information...
 
 I believe GCC does now generate that debugging information.  (I think
 GCC 3.4 will do so, though it's vaguely possible that the fix won't be
 until 3.5.)
Comment 3 Keith Seitz 2010-03-10 01:10:23 UTC
I have verified that this bug has been fixed sometime between GDB 6.8 and 7.1
using GCC 4.1.0 and newer. [I did not check GCC releases > 3.4.6 and < 4.1.0.]