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

GDB on FreeBSD/Alpha


[ CC'd to gdb@sourceware.cygnus.com since the information here might
  be relevant for GDB on other Alpha systems too. ]

David,

I've managed to add the necessary support for FreeBSD/Alpha to the
version of GDB in CVS (not checked in yet).  Right now there are
several bugs in the toolchain used for FreeBSD 5.0-CURRENT that
prevent GDB from working properly.

The current compiler used by FreeBSD/Alpha is gcc-2.95.2.  In the
current configuration the compiler basically generates the following
debugging information:

 -g     This generates stabs-in-ecoff debugging information (which is
        embedded in an .mdebug section in ELF).  GDB's support for
        this particular format has suffered from some bit rot, but it
        isn't too difficult fix.  The code is also used on MIPS, so I
        guess this would be appreciate by a some other people too.
        Looking through the code, there are several places where
        stabs-in-ecoff is commented on as being a (temporary) hack.

	A bigger problem is that GCC 2.95.2 doesn't output the right
	stabs for function arguments (and perhaps for local variables
	under some special circumstances).  This makes debugging
	really painful, since function arguments will most likely have
	the wrong values in GDB.  The GCC bug is fixed in the
	development tree.

 -ggdb  This generates DWARF 2 debugging information.  GDB's support
        for this format is quite good.  Unfortunately the DWARF
        information clashes badly with the ECOFF debugging information
        that's still present in the .mdebug section, causing GDB to
        ignore the lin number information, which in turn make
        debugging basically impossible.  The problem seems to be
        caused by a mismatch the information in .mdebug and the DWARF
        info; GCC 2.95.2 doesn't output the right DWARF info for the start
        address of some functions.  Again this seems to be fixed in
        the current GCC tree.

	Leaving out the .mdebug option would probably improve things.
        At least the line number info will be available in GDB.  There
        is an assembler option -no-mdebug that is supposed to do this,
        but that doesn't work; it produces an error message.
        Stripping the .mdebug section using objcopy works, but isn't
        exactly user friendly.

In the long run I'd advice FreeBSD/Alpha to standardize in DWARF 2,
since it is used on more platforms.  Compatibility with other
toolchains is probably not very important for FreeBSD (and there is
always -gstabs).  I'm not up to date with the plans to update the GNU
tools in FreeBSD.  Upating GCC would probably solve the majority of
problems.  Updating binutils might make -no-mdebug feasable.

Meanwhile, I'll start working on making the necessary changes to GDB.

Mark

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