How do I debug a PyGTK application without an interactive session?
If you need to debug an application but are unable to obtain an interactive session to trace it from (for instance, if it crashes at startup or shutdown), you can use the following recipe, contributed by Gustavo Carneiro: 1. Install Xnest; 2. Add a test user to your system; 3. Run a nested window GDM session (in System Tools); 4. Login as the test user; 5. In your own user session: • open a shell • change DISPLAY to the test user nested session display (eg. :20) • run: gdb python • inside gdb: run /foo/bar/myapplet.py 6. In the test user nested session, trigger the error. 7. View the python backtrace in your shell, or trigger an interrupt in gdb to capture a stack trace.