This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stabs+ debug info
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Waldek Hebisch <hebisch at math dot uni dot wroc dot pl>
- Cc: gcc at gcc dot gnu dot org
- Date: 13 Nov 2003 21:16:39 -0500
- Subject: Re: stabs+ debug info
- References: <E1AKT7p-0003sI-00@hera.math.uni.wroc.pl>
Waldek Hebisch <hebisch@math.uni.wroc.pl> writes:
> I would like to know how to generate correct stabs+ debug info about
> objects. AFAIKS `dbxout.c' uses method names as parts of stubs,
> moreover objdump also takes part of type information from
> mangled name. Both code in `dbxout.c' and in objdump look
> very C++ specific.
This is true of older versions of gcc. gcc would optimize the
debugging output by not producing complete type information for
methods. However, it never had to be done this way. See
http://sources.redhat.com/gdb/current/onlinedocs/stabs_7.html#SEC59
Basically, a class method stab starts with '#'. If there are two '#'
chars, then you have to demangle the name. But if there is only one,
the parameter types are provided as usual. In fact, gcc always
generates a single '#' char now; I think this changed here:
http://gcc.gnu.org/ml/gcc-patches/2001-05/msg01476.html
which ought to be gcc 3.1 and later.
> I would like to generate info about GNU Pascal objects, is it
> feasible to mangle Pascal names like C++ names (assuming I
> accept some information loss) ? Are there any helper functions
> to generate mangled names.
You shouldn't have to bother with mangling.
> And not exactly gcc question: assuming I get out correct stabs,
> will then gdb able to show me Pascal objects (is it able to
> show C++ objects) ?
gdb is able to show C++ objects. It should be able to show you Pascal
objects if you describe them correctly.
Ian