How to share the same serial port?

Art Berggreen art@acc.com
Thu Apr 30 19:57:00 GMT 1998


In our case we want both input and output, and we want the target device
to use its normal console UART driver when gdb doesn't have control.

Art

>Getting debug output from the target to stdout on the gdb terminal can
>also be done by sending the 'O' packet.  It's not documented, but if you
>look the switch statement in the standard remote.c, a packet of this
>type is interpreted as "console output" from the target.  There is,
>however, no standard way (as far as I know) of getting stdin from the
>gdb session into the target.
>
>-Brian
>
>>>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
>>>port
>>>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.
>>



More information about the crossgcc mailing list