[Xquartz-dev] How to test a wm with gdb on XQuartz

Jeremy Huddleston jeremyhu at apple.com
Sat Jan 29 17:36:06 PST 2011


On Jan 29, 2011, at 17:24, Dave Ray wrote:

> I am helping port alternative window managers to MacOS. One of them isn't working right, so I want to use gdb on the wm binary.
> 
> On a true *nix machine, I could start X without a wm running, then invoke a wm from an xterm. This is useful if I want to run gdb on the wm. It's not how one normally sets up an X11 environment, but is the way one would do it to test the wm.

Yeah, that's usually how I debug quartz-wm.

> On Snow Leopard, I am having trouble figuring out how to replicate this. If I comment out all the lines in my .xinitrc, and try to run my wm from a terminal, this doesn't work. I get a unstable condition where processes keep re-spawning and I cannot kill them, and have to reboot to recover.

Weird.  I certainly don't see that.  What is actually respawning?  What is written to /var/log/system.log?

> If I remove the .xinitrc file, X11 boots with its default window manager.

You should use ~/.xinitrc.d rather than ~/.xinitrc, but that's not really the issue here.

> Can anyone recommend a step by step process I can use on SL so that I can run gdb on a window manager at the shell prompt.

mkdir ~/.xinitrc.d
echo "exec /usr/X11/bin/xterm" > ~/.xinitrc.d/90-debug-xterm.sh # or /opt/X11 instead of /usr/X11
chmod 755 ~/.xinitrc.d/90-debug-xterm.sh
open -a XQuartz # or open -a X11 if you want that one instead

You should get an xterm with no wm.  Then just run your WM from that xterm.

--Jeremy




More information about the Xquartz-dev mailing list