next up previous contents
Next: Features supported by MOSS's Up: Remote debugging Previous: Preparing to debug

Running applications under the remote debugger

When you try to run an application under the new debugging-enabled version of MOSS, you'll notice that it appears to hang before the program starts running. MOSS hasn't actually hung (hopefully!); it is simply waiting for instructions to come over the serial line from the remote debugger. At this point, run GDB on your debugging machine, specifying your application's executable as the program to debug. Then, instead of running the program directly (which wouldn't work anyway since it's a MOSS executable and you'd be running it under a completely different environment), type `target remote /dev/ttyS0' (or whatever serial port the null modem cable is connected to).

At this point, if everything worked correctly, the GDB prompt should come back with the program position pointing at the first instruction in the application executable. This will typically be the crt0 code supplied with MOSS. If you want to proceed immediately to the main() routine, just type `g main'. At any rate, you can now set breakpoints or otherwise debug the program as you would a program running on a local machine.



Bryan Ford