GCC 4.1.0 doesn't generate DWARF 2 output for function arguments?
Nick Roberts
nickrob@snap.net.nz
Wed Apr 5 06:26:00 GMT 2006
[moved from gcc@gnu.org]
> > It also causes GDB to generate errors on the output of other commands:
> >
> > (gdb) info locals
> > argc = Cannot access memory at address 0x0
> >
> > as well as the GDB/MI equivalent -stack-list-locals. This breaks the
> > front end that I'm writing fo Emacs.
>
> That's a bug in GDB, and not hard to fix. You're welcome to do it, or
> to file it in GNATS :-)
Is it easy? With the optimisation GDB thinks argc is LOC_STATIC, which is why
it tries to print its value with the "info locals" command, even though it is
not a local variable in GDB's usual sense. The only way I can think of doing
thi is testing if sym->ginfo.name is "argc" or "argv" in the LOC_STATIC case of
the switch statements of print_block_frame_locals and list_args_or_locals.
Its inelegant and probably not general either.
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb
mailing list