Created attachment 6850 [details] 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).
Created attachment 6851 [details] DWARF .debug_info section produced by GCC for the test case.
bugzilla requires a message when marking a duplicate *** This bug has been marked as a duplicate of bug 7737 ***