简体   繁体   English

在远程调试中运行目标时,gdb无法执行命令

[英]gdb cant execute command while the target in running while remote debugging

I am using gdb and gdbserver for debugging my exe. 我正在使用gdb和gdbserver调试我的exe。 My target is same as local host currently. 我的目标当前与本地主机相同。 I start the gdbserver using 我使用以下命令启动gdbserver

gdbserver.exe :6000 MyTest.exe 1> NUL 2> NUL

and my gdb is started using 我的gdb开始使用

gdb.exe -ex "set target-async on" -ex "target remote :6000"

But when I try info threads or set or get a global variable , I get cannot execute command target running. 但是,当我尝试info threads或设置或获取全局变量时,无法执行命令目标运行。 I tried to use interrupt before set but this doesn't change anything. 我试图在设置之前使用中断,但这并没有改变。 Does any one know what could be wrong or what I'm doing wrong? 有谁知道可能是错的还是我在做什么错?

There is no input file to the gdb.exe in your code. 您的代码中没有gdb.exe输入文件。 Provide the same MyTest.exe file to gdb on host so that gdb can load the symbols 提供相同的MyTest.exe文件, gdb的主机,以便gdb可以加载符号

gdb.exe MYTest.exe
(gdb)set target-async on
(gdb)set target remote :6000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM