[sugar] Launching and debugging activities under gdb

Don Hopkins dhopkins
Tue May 22 17:52:03 EDT 2007

It would be useful to be able to run activities from a command line, so 
you can launch and debug them under gdb.
I looked in /proc/<process_id> to figure out the command line and 
environment that were being executed to launch an activity, and I typed 
the same thing into the shell to launch it by hand.
The activity started and ran without any errors, but no window showed up.
Of course I can attach gdb to an activity that's already running, but 
all the interesting bugs happen while the activity is starting up, and I 
can't type fast enough to catch it.

What else do I need to do, in order to get an activity to launch from 
the command line or gdb?
Is dbus passing in some one-time environment variables, or setting up a 
rendezvous that's not set up when I run an activity from the command line?
Is there some way I can invoke an activity manually from Python?

Also, it would be great to be able to turn off the stdout/stderr 
redirection so I get all the stack dumps, prints and debug messages 
dumped out to the debugger window!
The way some error messages go into shell.log and others into Read.log 
(but no stack traces!) make it very hard to debug and figure out what 
order things happened in.
Doing a tail -f of the log files gets confused when the files get 
truncated/removed, so I have to restart the tail each time I start the 
application. (The inode number of shell.log stays the same, but Read.log 
gets removed each time I restart Sugar, so the inode number changes and 
tail loses track of the log file.)

Another thing that would make debugging easier:
Does anyone know of a handy-dandy off-the-shelf Python command line 
telnet server that I can run, so I can telnet into my application after 
it launches and meddle around with it Python?

Thanks for any advice you can share to make debugging sugar applications 


More information about the Sugar-devel mailing list