If I start a normal 'gdb' session, then I can reach STDIN
and see STDOUT
directly in the terminal:
$ gdb wc
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
...
gdb> run
Starting program: /usr/bin/wc
asdf
1 1 5
[Inferior 1 (process 28131) exited normally]
gdb> quit
$
Can I do the same with a gdbserver???
Here is what I have tried (gdbserver):
$ gdbserver /dev/ttyS0 wc
Process wc created; pid = 28156
Listening on port 2345
and client:
$ gdb
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
...
gdb> c
Continuing.
Program received signal SIGINT, Interrupt.
0x00007ffff7ddbc40 in _start () from target:/lib64/ld-linux-x86-64.so.2
gdb>
But, it seems like STDIN
/STDOUT
is not being connected when using the gdbserver.
How can I run remote debugging over the serial line, and also access STDIN
/STDOUT
of the application that I'm debugging over the same serial line??
How can I run remote debugging over the serial line, and also access STDIN/STDOUT of the application that I'm debugging over the same serial line??
You'll need to use screen or tmux to multiplex gdb<->gdbserver
and keyboard->application traffic over a single serial line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With