微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用gdbserver --multi运行文件

如何解决使用gdbserver --multi运行文件

给出:

gdbserver --multi :2345

在远程计算机上运行。我可以使用gdb连接到它:

(gdb) target remote 192.168.10.248:2345
Remote debugging using 192.168.10.248:2345
The target is not running (try extended-remote?)

(gdb) target extended-remote 192.168.10.248:2345
Remote debugging using 192.168.10.248:2345

接下来呢?如何在远程计算机上运行某个文件,例如说a.out并进行调试?

解决方法

接下来是什么?

(gdb) set remote exec-file a.out
(gdb) file a.out
Reading symbols from a.out...
(gdb) b main
Breakpoint 1 at 0x4015ab: file 1.cpp,line 60.
(gdb) r
  • set remote exec-file a.out用于设置您要使用的程序 要在目标中调试。
  • file a.out用于从程序中加载调试符号 在主机中。

在此处查看gdbserver --multi的完整示例:https://www.thegeekstuff.com/2014/04/gdbserver-example//

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。