Debug application?

Submitted by coredump on Sat, 2006-05-27 10:29.

Okay, I think I have everything installed properly and would like to trace through one of the applications in the default model. How do I do that?

In a running system, its started directly by the middleware and not via the command line.

Thanks in advance.

Submitted by nv on Sat, 2006-05-27 12:32.

Yes, the middleware manages the full life cycle of the application, so you wouldn't normally start it via the command line.

If your goal is to use a debugger, I guess you can attach gdb to a running process by specifying the pid ($ gdb appname pid), but by then the process is up and running and you may miss the interesting parts.

The other trick is to replace the application binary by a simple shell script and have the shell script start the actual application. So when sisp_amf starts the application, its actually starting the shell script. The script then does any necessary initialization and starts the actual binary via gdb making sure that its own environment and arguments are passed on to the application. You can tty redirect gdb and/or use a .gdbinit file to give it commands.

This approach of using a script can even be used in a real system. Another advantage is that your script can do any application specific cleanups when the application terminates gracefully or due to an error.

The above is assuming you are debugging on a development w/s. If you want to do remote debugging of a target, I suggest you search for "gdb remote debugging" under linux.