Remote console output

Michael Snyder msnyder@vmware.com
Thu Feb 10 18:15:00 GMT 2011


alsp wrote:
> Hi,
> 
> I hope this is the correct mailing list for this, sorry if it isn't.
> 
> I'm experimenting with remote GDB debugging at the moment - I've got a
> simple program that prints to the console using printf which I can
> successfully run and debug with gdbserver and a gdb client.
> 
> As I expected, the printf output is appearing on the gdbserver console
> rather than the client gdb console. However, I was wondering if there is a
> way to change this behaviour so that any console output from the executing
> program appears on the client gdb console. How can I do this?
> 
> I'm sure there must be a way of doing this for debugging on embedded devices
> that have no display?
> 
> Thanks for any help.
> 
> Alan

With embedded devices, you may have a standard library that cooperates 
with gdb and the gdb stub.  In that case, the printf function will be 
implemented so as to send a special "O" packet to gdb, containing the
text to be printed.

If your target is linux, you would have to modify the glibc version of 
printf.




More information about the Gdb mailing list