How to share the same serial port?

Art Berggreen
Thu Apr 30 09:13:00 GMT 1998

>I use gdb to do remote debugging, but the target board has only one
>serial port,
>my problem is, how to use this port to run remote gdb and to use this
>as the input/output port of the target program at the same time?

We do this with a customized remote-xxx.c target handler added to gdb
and a customized gdb stub file in the target.  When the target handler
is waiting for gdb traffic it puts the control terminal in raw mode
and transparently passes characters between the console and the serial
debug link.  When the gdb stub code handles an exception, it sends a
special escape sequence to the target handler.  The target handler detects
the escape, and restores the console terminal mode and resumes normal
gdb processing.  There are also a few special escapes on the console
input side to do things like sending a break sequence to the target.
We use this to force a break back into gdb in the target.

Art Berggreen

More information about the crossgcc mailing list