gdb debug info format

Leon Pollak leonp at plris.com
Tue Jun 16 12:03:36 UTC 2009


Thanks, Alexandre.
I use '-O0' optimization and do not see local (on the stack) variables. I also 
can not determine why sometimes I do see locals, and sometimes - no.
I applied your recommendations with -g3 -ggdb3  - no effect...:-(

On Tuesday June 16 2009, Alexandre Constantino wrote:
> Hello,
>
> (not sure if this will be much help, but...)
>
> GCC can remove "unused" variables from the code, e.g. a variable whose sole
> purpose is to save the return value from a function. Possible
> "workarounds":
> - Optimizations should be removed for debug purposes.
>   (not acceptable on most situations)
> - A dummy condition must be done, e.g. "if (foo = 123456)
> dummy_fun_call(foo);" (not very friendly)
>
> If this is a macro variable it will be removed, unless level 3 of debug
> information is used.
>
> Using -ggdb3 may provide the greater amount of debug information to your
> program.
>
>
> Best regards,
> Alexandre
>
> On Tuesday 16 June 2009, Leon Pollak wrote:
> > Hello,
> >
> > I am using gdb 6.8 ("This GDB was configured as
> > "--host=x86_64-redhat-linux- gnu --target=powerpc-rtems4.9") and
> > rtems-4.9 tools for PPC.
> >
> > I rather often  encounter the message "No symbol "foo" in current
> > context." for local variables.
> > Manual says that I may try to change the debug info format, may be to
> > DWARF2. But this does not help too.
> >
> > Can somebody advice something?


-- 
            Dr.Leon M.Pollak
                Director
       PLR Information Systems Ltd.
Tel.:+972-98657670  |  POB 8130, H'Aomanut 9,
Fax.:+972-98657621  |  Poleg Industrial Zone,
Mob.:+972-544739246 |  Netanya, 42160, Israel.




More information about the users mailing list