This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug c++/15111] New: GDB will not print the value of a variable ifthere exists a type of the same name


http://sourceware.org/bugzilla/show_bug.cgi?id=15111

             Bug #: 15111
           Summary: GDB will not print the value of a variable if there
                    exists a type of the same name
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: mgretton@sourceware.org
    Classification: Unclassified


Created attachment 6850
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6850
Source for test case

Given the attached gdb-test.cpp file compiled as follows:
 $ g++ -O2 -g gdb-test.cpp -o gdb-test

This program has a structure named fibs and a global variable also named fibs. 
When you use gdb (as follows) you cannot get to the value of the global
variable because GDB seems to only see the typename:

 $ gdb ./gdb-test

 (gdb) start
 ...
 (gdb) print fibs
 Attempt to use a typename as an expression

(This is the instance of that error from gdb/expr.c)

The .debug_info section seems to be correct (objdump --dwarf=info output also
attached).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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