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

Re: GCC 4.1.0 doesn't generate DWARF 2 output for function arguments?


[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


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