我如何通过gdbserver会话来访问STDIN / STDOUT [英] How can I reach STDIN/STDOUT through a gdbserver session

查看:156
本文介绍了我如何通过gdbserver会话来访问STDIN / STDOUT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我开始一个普通的'gdb'会话,那么我可以直接在 STDIN 中看到 STDOUT 终端:

  $ gdb wc 
GNU gdb(Gentoo 7.10.1 vanilla)7.10.1
。 ..
gdb>运行
启动程序:/ usr / bin / wc
asdf
1 1 5
[低于1(进程28131)退出正常]
gdb>退出
$

我可以使用gdbserver吗?



下面是我尝试过的(gdbserver):

$ p $ $ gdbserver / dev / ttyS0 wc
已创建流程wc; pid = 28156
在端口2345上收听

和客户端:

  $ gdb 
GNU gdb(Gentoo 7.10.1 vanilla)7.10.1
...
gdb> c
继续。

编程接收到的信号SIGINT,中断。
0x00007ffff7ddbc40 in _start()from target:/lib64/ld-linux-x86-64.so.2
gdb>

但是,好像 STDIN / STDOUT 在使用gdbserver时未连接。



如何在串行线路上运行远程调试,还可以通过同一个串行线调试应用程序的 STDIN / STDOUT 如何在串行线上运行远程调试,以及如何访问STDIN /文件系统中的STDIN /我正在通过同一个串行线调试应用程序的STDOUT?

您需要使用屏幕 tmux 通过单一串行线路复用 gdb< - > gdbserver< / code>和键盘 - >应用程序通信。


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.

这篇关于我如何通过gdbserver会话来访问STDIN / STDOUT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆