我目前正在开发一个(简单(内核,使用 Qemu for i368。 我使用的是普通的生成文件,并通过 GDB 调试到 Qemu 工作性能 我移动到 CMake,由于某种原因,我只能在我的代码已经在断点中时命中断点。
我也无法暂停,我从调试窗口得到的反馈是暂停成功 设置断点时,它告诉我尝试绑定断点
一个提示可能是,当我停止调试会话时,我从 vscode 收到一个弹出窗口,说超时
我的启动.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch with GDB",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"cwd": "${workspaceRoot}",
"args": [],
"targetArchitecture": "x86",
"MIMode": "gdb",
"miDebuggerPath": "/bin/gdb",
"miDebuggerArgs": "",
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
},
"customLaunchSetupCommands": [
{
"text": "target remote localhost:1234",
"description": "Connect to QEMU remote debugger"
}
],
"setupCommands": [
{
"text": "file ${command:cmake.launchTargetPath}",
"description": "Load binary."
},
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}
暂停响应
<-- C (pause-67): {"command":"pause","arguments":{"threadId":1},"type":"request","seq":67}
--> R (pause-67): {"type":"response","request_seq":67,"success":true,"command":"pause","body":{},"seq":1321}
设置断点时的响应:
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340258) Send Event AD7BreakpointErrorEventn"},"seq":1327}
1: (340258) Send Event AD7BreakpointErrorEvent
--> R (setBreakpoints-69): {"type":"response","request_seq":69,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":4,"verified":true,"line":73}]},"seq":1329}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":4,"verified":false,"message":"Attempting to bind the breakpoint....","line":73}},"seq":1331}
如果我在 Qemu 终端中键入 stop,则 vscode 停止,我可以再次设置断点。
我有同样的问题,但还没有解决。 但我发现了一些可能对你有用的东西。 根据他们在这个问题下的讨论: https://github.com/Microsoft/vscode-cpptools/issues/833 你可以试试
- 将调试器的目标异步设置为关闭:
"setupCommands": [
{
"text": "set target-async off"
}
- 将 SIGINT 发送到本地调试器进程
-exec -interpreter-exec console "signal 2"
看看它是否可以暂停。
我遇到了类似的问题,尝试使用选项"MIDebuggerServerAddress"连接远程目标:"targetIp:port",而不是自定义启动设置命令中的命令。