m68k serial GDB hookup rfc

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Mon May 13 12:13:59 UTC 2002


in the last weeks I have adapted the GDB m68k serial debug 
stub (m68k-stub) to an RTEMS system (at leasdt for MC68040 and 
for CPU32 targets). Instead of adding polled serial I/O 
functions dedicated to the specific hardware, I have written a 
submodule that should be able to hook up to any polled termios 
device driver. SO I think this might become a rather universal 
solution for adding a serial GDB/debug link to many RTEMS 

Now I am looking for a rather universal, configurable  
solution to optionally add the debugging stub to a given 
application. The best point to initialize the stub would be in 
bsppost.c , short time after the drivers have been initalized. 

What I would like to do is the following:

- add sort of a serdbg section to the configuration structures 
to the application's "init" module, containing the serial 
device name to use, the baud rate, a flag, whether execution 
should stop in bsppost or should continue automatically.

- add a call to the serial debug init function to "bsppost". 
But this call should only be taken, when the serial 
configuration data is present or filled out

- add the "m68k-stub" and related functions to either 
"libcpu/shared" or "libcpu/m68k/shared", depending whether 
this code is CPU/model dependent or not.

- move the "thread awareness code" available for the MIPS 
serial debugging to "libcpu/shared", because it looks rather 
CPU independent

What I would like to get with this is:

- adding/ommitting the serial debug code simply by 
adding/ommitting the corresponding configuration settings in 
the init module (existing applications should link without 
code modification)

- the debug code should not be linked to an RTEMS system that 
does not need/use it.

I am still not yet sure how to implement the optional addition 
of the debug code. Is it ok if I add an optional table to 
"confdefs.h", to modify the shared/bsppost.c, to add some 
stuff to libcpu/shared etc?

Any comments welcome...


IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-

More information about the users mailing list