This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to share the same serial port?


>
>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.

Art Berggreen
ACC
art@acc.com