This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: perfered ELF debugging format for GNU tools


"David O'Brien" <obrien@FreeBSD.org> writes:

> gcc/config/elfos.h says:
> 
>     /* The GNU tools operate better with stabs.  Since we don't have
>        any native tools to be compatible with, default to stabs.  */
> 
>     #ifndef PREFERRED_DEBUGGING_TYPE
>     #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
>     #endif
> 
> Doesn't GNU [ELF] tools operate better with DWARF2_DEBUG now days?

Yes.
In fact, it's going to be a pain to support STABS + the new abi, and
take a lot of work, in GDB.

My plan is to make it work with dwarf2, and then work on making it
work with stabs.

There are just so many hacks to make STABS and C++ get along okay in
GDB, and almost all of them are specific to the old abi. It depends on
the mangling, the vtable layout, basically everything it shouldn't.

DWARF2 doesn't run into these problems with C++ on GDB, but still i
need to implement the abstractions that should have been done years
ago when all these hacks were put in in the first place, so that we
can support both the old abi, the V3 abi, and HP's C++ abi, without
the sludge that does it now.

In short, stabs C++ debugging will be broken for at least twice as
long as dwarf2 C++ debugging is broken (assuming it takes the same time to do
both, i'm positive stabs will take longer).


How do you make this go quicker?
Help me.

Right now, in GDB, the code used to do the looking through bases for
the right vtable, figuring out the real type of something using RTTI,
virtual function calling, etc, is all either duplicated for both the
HP C++ model, and G++ old abi, i.e.  you have

if (hp_som_objects_present)
{
<a whole bunch of hp C++ speciifc stuff>
}
else
{
<a whole bunch of GNU old abi C++ specific stuff>
}

In the various routines where it matters what the model is,

or, it's two different functions that do the same thing for the two
different models (ie is_base_virtual for one, is_virtual_base for the
other). It really makes me want to hurl.

Obviously, i'm going to move all of this to function pointers filled
in when we figure what C++ abi an application is using, and just call
through the function pointers.

If someone wants to help out with all this stuff, email me.

Otherwise, wait.
I can guarantee I won't get this stuff done myself until january at
the earliest, as we are coming up on finals time, and break starts dec
16th for me.

--Dan


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