This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/dwarf] save nested Ada subprograms as global symbol
On Wed, Jan 30, 2008 at 02:58:33PM -0800, Joel Brobecker wrote:
> > If you want to be able to use the name unqualified, then the global
> > symbol table sounds like the right place to put it. I'd like
> > namespace members and procedures containing nested functions to be
> > hierarchical elements in the symbol table, but that's not how it works
> > today.
>
> So is the original patch OK, then?
Yes.
> > I'd suggest we do the same for nested C functions but it would be a
> > horrible mess; they don't have conveniently mangled or qualified names.
>
> For purely-C nested functions, doesn't it work already? Actually,
> I just gave it a try and I was able to break on my nested procedure.
> Given:
>
> int
> main (void)
> {
> void do_nothing (void) {};
>
> do_nothing ();
> return 0;
> }
This works because GCC 4 is very aggressive about un-nesting :-) Try
something that would require a static chain, e.g. because it accesses
the container's locals.
--
Daniel Jacobowitz
CodeSourcery