Subject: Re: agp driver
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Martin Husemann <martin@duskware.de>
List: current-users
Date: 08/28/2002 13:04:17
On Wed, Aug 28, 2002 at 01:46:25PM +0300, Martti Kuparinen wrote:
> I added -g there. I'll try "gdb /usr/X11R6/bin/XFree86 /root/XFree86.core"
> later tonigh...

This never worked for me when the crash happened inside a driver (XFree
does not use standard dlopen() but their own loader, IIUC).

Matthieu Herrb sent me debug instructions quite some time ago, I went
for the monolithic (static) debug version of the X server and it worked.

Martin


--8<--
There are 3 possible ways: 

- build a static version of the X server with the module(s) that you
  suspect to cause the crash. Here's a sample host.def to build a
  minimal server. You may reenable some modules by changing them to
  YES. 

  --- Cut ---
#define InstallEmptyHostDef

#define BuildServersOnly	YES

/* 
 * you may also restrict the drivers that are built by editing and 
 * uncommenting the line below 
 */
/* #define XF86CardDrivers		neomagic */

#define XF86INT10			NO
#define UsbMouseSupport			NO
#define DoLoadableServer		NO
#define XnestServer			NO
#define XVirtualFramebufferServer	NO
#define XprtServer 			NO
#define BuildPexExt			NO
#define BuildXIE			NO
#define BuildXIElib			NO
#define BuildGlxExt			NO
#define BuildGLXLibrary			NO
#define BuildGLULibrary         	NO
#define BuildRenderLibrary		NO
#define BuildLBX			NO
#define BuildType1			NO
#define BuildSpeedo			NO
#define BuildFreeType			NO
#define BuildXTT			NO
#define	BuildFonts			NO
  -- Cut --

- Otherwise you can use the LoaderPrintSymbol function (from
  xc/programs/Xserver/hw/xfree86/loader/hash.c from inside gdb to 
  get the symobols corresponing to addresses inside modules

- There exist a patched version of gdb for linux that knows about
  XFree86 modules. I don't know enough about gdb internals (and local
  NetBSD modifications to gdb) to tell how hard it would be to have it
  working. (I got it to build with minor changes iirc, but it didn't
  work) may be you can get help from the toolchain gurus on this one. 
  You can find it here: <http://www.dawa.demon.co.uk/xfree-gdb/>

Hope this helps. 
-- 
					Matthieu