One of the best development hack setups I have is the one I use to develop compiz fusion. When developing compiz, you have the tendency to lock up your screen, a lot. One segfault, and you can loose control of the X server, or just lock up your screen. This make using a debugger all but impossible, as you can essentially be locked out of your mouse and keyboard. Furthermore, you find yourself wasting a ton of time waiting for your computer to reboot after a lockup. This isnt very conducive to a pleasant development experience, so I have a workaround! The drawbacks is that it needs two computers, but the upside is you dont have to reboot your computer every minute when developing, and can effectively debug. I’m sure this technique could be used to develop other software (bar the kernel itself) that has the potential to lock up you X server.
- Install your compiz dev environment on computer A, and make sure ssh is set up
- From computer B, ssh into computer A using the -Y flag (e.g. ssh email@example.com -Y)
- From computer A, navigate to your source directory. You can run vim, gedit, geany, or whatever development environment you want, and have the controls (even gui’s) on computer B, although the dev environment is running on computer A. You can make modifications, or compile from computer B now.
- Run compiz from computer B. This can be done with “compiz –replace –display :0.0” (assuming you dont have a crazy xserver setup). If it crashes, no big deal, you can easily recover by running metacity –replace –display :0.0.
- The real power of this setup is the ability to debug using gdb. This is pretty much impossible using one machine. Just run
$ gdb compiz
(gdb) set args –replace –display :0.0
and you can easily pin down segfaults, or debug tricky problems!
There you go! Advanced graphics development made easy 😀