http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55209



             Bug #: 55209

           Summary: gdb reports 'No symbol "<x>" in current context.' at

                    -O0 -g

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: debug

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: h...@gcc.gnu.org

            Target: x86_64-linux





At revision r192677, I have problems debugging cse1, as a local variable is

gone at -O0 -g3.



To repeat, just bootstrap, then "rm cse.o" and "make cc1 CXXFLAGS=-g3".  Enter

gdb-7.5 for cc1 with a suitable command-line (for example "-fpreprocessed

pr55030-chk.i -quiet -dumpbase pr55030-chk.c -m32 -mtune=generic -march=x86-64

-auxbase pr55030-chk -Os -w -version -fno-diagnostics-show-caret

-fno-tree-loop-distribute-patterns -o pr55030-chk.s" with the attached

pr55030-chk.i, but this is not important)



Set a breakpoint on line 5084 (at r192677 it says "if (MEM_P (trial) && MEM_P

(SET_DEST (sets[i].rtl)))").  When the breakpoint hits, do "p trial".  gdb will

respond with 'No symbol "trial" in current context.'



PS. you might want to build gdb-7.5 with "--without-auto-load-safe-path" or add

"add-auto-load-safe-path /home" to your ~/.gdbinit, assuming your gcc-trees are

under your user home directory.

Reply via email to