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

Jeremy Huddleston jeremyhu at apple.com
Sun Jan 30 11:39:01 PST 2011


On Jan 30, 2011, at 11:17, Dave Ray wrote:

> Jeremy 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?
> 
> X11.app is re-spawning

I'm confused.  Where are you executing the WM from?  If you're executing it from the xterm, then it should be using the existing/running X server.

> , which is causing other things to re-spawn like fc-cache. I'll append the section of the syslog showing this, at the bottom of the message.
> 
> I learned that if I edit .xinitrc during the race condition, and put back a line with a window manager, the next time X11.app spawns, everything returns to normal, and I don't have to reboot.
> I'm not that interested in exploring the race condition further because it's not a config I normally use, but I'm happy to look into it further if you're interested.

It sounds like your ~/.xinitrc was bugged.

>>> 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
> 
> Great, I will try that.
> 
>> at that point it will start up just the X server with no window manager or anything else... if you open an xterm it will have no window decoration or anything.  Just use an export DISPLAY=:55 in another terminal then launch the window manager executable and see if it runs.
> 
> Can I really set my own DISPLAY? I thought that was something one can't mess with.

Unless you know exactly what you're doing, it's best to not mess with it.

> Jeremy at your request here is the section of the syslog showing the respawning.

Yeah, it look like what I'd expect if your ~/.xinitrc was not execing something and you're trying to start an X client over the launchd DISPLAY socket.  X11.app never accepts the connection from the launchd socket because it is quit before then when xinitrc exits.




More information about the Xquartz-dev mailing list