This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/295: global variables in C++ namespaces cannot be printed



>Number:         295
>Category:       gdb
>Synopsis:       global variables in C++ namespaces cannot be printed
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 28 10:58:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     salman.khilji@cae.com
>Release:        5.0 with Mandrake Linux 8.1
>Organization:
>Environment:
GDB 5.0 as distributed with Mandrake Linux 8.1 on x86. gcc 2.96
>Description:
Please refer to the attached source-code.  I cannot print global variables that are inside a C++ namespace.

Code is compiled with g++ -g option

Current directory is ~/softdev/nbug/
GNU gdb 20010813 (MI_OUT)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) b main
Breakpoint 1 at 0x8048656: file main.cpp, line 17.
(gdb) run
Starting program: /home/salman/softdev/nbug/hello 

Breakpoint 1, main () at main.cpp:17
(gdb) n
(gdb) 
(gdb) 
(gdb) p fSomeVar
$1 = 300
(gdb) p FOO::fSomeVar
No symbol "FOO" in current context.
(gdb) p 'FOO::fSomeVar'
$2 = 1120403456
(gdb) p 'BAR::fSomeVar'
$3 = 1128792064
(gdb)c
Continuing.
100
200
300

Program exited normally.
(gdb) 
>How-To-Repeat:
Just compile the attached main.cpp with g++ -g option and try to look at a variable inside a namespace
>Fix:
Don't know :-(
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]