GDBbundle

This file describes how to use the GDBbundle I wrote for the TextEdit demo application released by NeXT.

The GDB bundle was designed to be used specifically with TextEdit. It can't be used neither by the Edit application or by ProjectBuilder although it would be nice to have it also integrated into ProjectBuilder.

GDBbundle uses its own gdb which is a modified version of NeXT's version that makes possible sending back in the client bundle the output generated by gdb commands. There are also some other additions to the gdb to make possible getting the local variables of a frame. To install the modified version of gdb just copy it into a public place like /usr/local/bin. Be sure this directory is searched first when the shell searches for commands; you can do this by changing the PATH environment variable.

You have to follow the following simple steps to have a gdb session:

1. Start TextEdit.
2. From a terminal window start gdb with the following command line:

  $ gdb -connect TextEdit progname

This will start gdb and will make it connect to the TextEdit application. You'll have to have the TextEdit application already started, it will not start it for you.

It is possible to have a remote debugging session with GDBbundle. You'll have to start the TextEdit application on the machine you want to have the windows. Then start gdb with the following command:

  $ gdb -connect TextEdit:remote_machine progname

This will start gdb and will make it connect to the TextEdit application. You'll have to have the TextEdit application already started, it will not start it for you.

The modified version of gdb prints a message saying it tries to make a connection with TextEdit on a host:

Sep 01 23:25:30 gdb[4800] Debugger Controller: looking for connection named TextEdit on host *nil*

If you don't see this message then you're most probably running the system gdb!

Known bugs and limitations

GDBbundle and the actual TextEdit application have the following bugs and limitations:

· sometimes when you change the function before the results came back from gdb, the client gets confused and enters into an infinite loop. The only solution is to quit TextEdit and enter again.
· first time the last function is clicked it doesn't get selected. Click on the "start" function and then again on the function you want.
· gdb does not have command line history and editing when working with GDBbundle.

Copyright and copying terms

The TextEdit application was written by NeXT; all the right are reserved by NeXT. The GDBbundle was written by Ovidiu Predescu and all the rights are reserved. The TextEdit and GDBbundle are released together under the GPL license. Donations are welcome; please contact me for my address.

Happy hacking,
Ovidiu Predescu <ovidiu@net-community.com>