remote debugging i.e. rgdb questions

Daron Chabot daron.chabot at usask.ca
Wed Mar 21 22:33:29 UTC 2007


On Wed, 2007-03-21 at 13:22 -0700, Amalaye Oyake wrote:
> Hello,
> 
> I am trying to set up remote debugging for an i386-rtems/pc686 target per
> the documentation. It seems that the rgdb stuff is not working. Perhaps I
> need to reconfigure and build? My output is below, at the bottom.

Did you configure the rtems source with the --enable-rdbg switch ??

If you are going by the RTEMS/gdb User's Guide, forget everything you've
read so far :-)  AFAIK, that document is outdated. Way...

> Also from what I have gleaned there are two gdb stubs (implementations). The
> stub from the guys at Canon Research which uses sunrpc and is the 'default'
> stub ... and Till Straumann's gdb stub which seems to be have some cexp
> hooks?

Using the "configure" switch above will build the gdb-stub for the i386-
rtems target.

When it comes to building GDB itself for use on your debug/development
host, you have two options here:

1) use gdb "as is" (vanilla):
   i.e. build with the usual
   ./configure --target=i386-rtems --prefix=/foo/rtems
   - You can connect host to target via rs-232 or over ethernet.
   I haven't personally used the ethernet method, but I can vouch
   that debugging over a serial line works well.
   - On the target, add the following to the start of your Init task:
   init_remote_gdb( );
   rtems_task_wake_after( about 1 second );
   breakpoint( );
   - this will cause the target to pause, waiting for the host to
   connect.
   - from the host, the command to connect to target over rs-232 is:
	(gdb) target remote /dev/ttySx
   where "x" is the number of the connected serial port.
   - after a successful connection, add other breakpoints, and
   "continue"...

2) add the patches provided with Till's gdb-stub, and follow
   his directions *closely*.
   - much of 1), above, still applies.
   - this option is more work, but the result has several very
   useful benefits, especially if you're already using Cexp.
   - there are some disadvantages as well; just read his docs
   and weigh your requirements.


Good luck !

-- dc




More information about the users mailing list