This is the mail archive of the
mailing list for the GCC project.
Re: Modify gcc for use with gdb (issue5132047)
- From: Ian Lance Taylor <iant at google dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, Lawrence Crowl <crowl at google dot com>, reply at codereview dot appspotmail dot com, gcc-patches at gcc dot gnu dot org, Tom Tromey <tromey at redhat dot com>, Cary Coutant <ccoutant at google dot com>
- Date: Wed, 05 Oct 2011 07:48:14 -0700
- Subject: Re: Modify gcc for use with gdb (issue5132047)
- References: <20110926220500.9254022266A@jade.mtv.corp.google.com> <20110927071447.GJ2687@tyan-ft48-01.lab.bos.redhat.com> <CAFiYyc1F+qt8c4XTBn=Jp2WCdOLppkWaPahnmxUfd97K43v7UA@mail.gmail.com> <CAFiYyc14=_KNGBqm9-6C3ZMCLjPmP1UDzbmZOsPLFpi20=UEpA@mail.gmail.com> <4E8C5910.firstname.lastname@example.org> <CAFiYyc1b=9RVhj3KE12p8q=-vERSzRJs9LBzFMLAbhKO=mjfWw@mail.gmail.com> <CAD_=9DSMHE7f=C7QZxF=jpGYv7S9VdQFJik=YFf6RR+_bDfBemail@example.com>
Diego Novillo <firstname.lastname@example.org> writes:
>> It is much more important to optimize my debugging time as experienced
>> developer resources are more scarce than some random unexperienced
>> guy that happens to dig into GCC.
>> or not really ;).
> You are being facetious, I hope. Part of the reason that experienced
> developers are scarce is precisely because dealing with GCC's code
> base is so daunting. We should be trying to attract those random
> inexperienced developers, not scare them away.
> The experienced developers will retire, eventually. Who is going to
> replace them?
Yes. We experienced gcc developers can adapt to the tools, and we can
modify the tools to work better. We should not hold up code
improvements because of tool deficiencies. We should fix both problems,
but we don't have to fix them in sequence.
> Tom, Cary, Ian, any suggestions? We are trying to figure out a
> compromise for tiny inline functions that are generally a nuisance
> when debugging. The scenario is a call like this: big_function_foo
> (inlined_f (x), inlined_g (y));
> We want to use 's' to step inside the call to big_function_foo(), but
> we don't want to step into either inlined_f() or inlined_g().
This is a general problem when debugging C++ programs, so any solution
to this gcc-specific issue will be of general use. However, I don't
know of a way to make it work today without changing gdb. There is a
lot I don't know about gdb, so it is possible that there is some
approach that will work.
Basically, gdb's relatively new support for debugging inline functions
is sometimes nice, but sometimes it just gets in the way. I guess the
most general solution is a way to mark the inline function in the source
as uninteresting. I don't really understand the doc for the
"artificial" function attribute, but it looks like it was intended to
serve this purpose. So it seems to me that there is a bug in gdb:
"step" should not step into a function with the "artificial" attribute.
I agree that it does not currently work that way. Looking at the gdb
sources, it seems to me that it currently ignores DW_AT_artificial on an