From owner-freebsd-current Tue Aug 31 19:31: 7 1999 Delivered-To: freebsd-current@freebsd.org Received: from andrew1.lnk.telstra.net (andrew1.lnk.telstra.net [139.130.51.121]) by hub.freebsd.org (Postfix) with ESMTP id 4D2B715330 for ; Tue, 31 Aug 1999 19:30:58 -0700 (PDT) (envelope-from ac131313@cygnus.com) Received: (from uucp@localhost) by andrew1.lnk.telstra.net (8.9.3/8.9.3) id MAA44453; Wed, 1 Sep 1999 12:30:15 +1000 (EST) (envelope-from ac131313@cygnus.com) Received: from localhost.cygnus.com(127.0.0.1), claiming to be "cygnus.com" via SMTP by localhost.cygnus.com, id smtpdG44451; Wed Sep 1 12:30:15 1999 Message-ID: <37CC8FB7.92770C0@cygnus.com> Date: Wed, 01 Sep 1999 12:30:15 +1000 From: Andrew Cagney Organization: Cygnus Solutions X-Mailer: Mozilla 4.6 [en] (X11; I; FreeBSD 3.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Richard Cownie , freebsd-current@freebsd.org, gdb@sourceware.cygnus.com, tich@par28.ma.ikos.com Subject: Re: gdb-4.17 in FreeBSD 4.0-CURRENT References: <99082010412803.11889@par28.ma.ikos.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Richard Cownie wrote: > > I managed to build gdb-4.17 in FreeBSD 4.0, here's how to do it: > > 1) gdb-4.17/configure --host=i386-unknown-freebsdelf4.0 > Have to specify the host explicitly, otherwise it doesn't realize > it needs to use ELF. > > 2) in gdb-4.17/Makefile, add "-DSVR4_SHARED_LIBS" to definition of CFLAGS > > 3) in gdb-4.17/gdb/solib.c, add #include "elf/common.h" > (after #include "elf/external.h") > > 4) in gdb-4.17/gdb/infptrace.c, add #define U_REGS_OFFSET 0x1fa8 > I figured out this number the hard way by searching all the valid PT_READ_U > addresses and comparing the results with PT_GETREGS - found locations > where eip and esp values matched up. Doubtless there's a better way to > get the right value. I've had a look at the FreeBSD source tree and they have done something similar. Unfortunatly that source code also contains other mods to GDB that, I suspect, break the debugger on pre FreeBSD/ELF versions of FreeBSD. > Then it should all build (and perhaps work). The same hacks probably apply > to gdb-4.18 and gdb-current (but so far gdb-4.17 is the most useful version > I've seen for debugging C++). I would like to encourage the FreeBSD group to invest the time needed to get the changes needed to GDB merged back into the master sources. Just remember that the responsible party will need a GPL assignment and a clear audit trail of where any non-trivial changes came from. enjoy, Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message