在 C 中运行 shell 命令后,调试器挂在模拟代码上

问题描述

就在程序到达这一点时,调试器不再响应

system("ls"); 

注意:当您在 Intel® SDE 中调试模拟代码时会发生这种情况。

int main() {
    system("ls"); // <- hangs while debugging
    // ..
    return 0;
}

我在 Linux 上编译和调试模拟代码如下:

#终端 1

:~ g++ -O0 -no-pie -fno-pie -g main.cpp -o main
:~ sde64 -debug  -- ./main
Application stopped until continued from debugger.
Start GDB,then issue this command at the (gdb) prompt:
  target remote :41685

#Terminal 2

:~ gdb ./main
(gdb) target remote  :41685
(gdb) b main
(gdb) c
(gdb) n
(gdb) n

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)