【发布时间】:2020-10-06 23:45:09
【问题描述】:
我目前正在使用 Qemu for i368 开发一个(简单的)内核。 我使用的是普通的 makefile 并通过 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 AD7BreakpointErrorEvent\n"},"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 就会停止,我可以再次设置断点。
【问题讨论】:
-
您是否使用
debug标志编译内核? -
是的 - 通过构建发布/调试检查了这一点,我看到调试版本大约大了 60%。我也做了文件
它说它没有被删除调试符号
标签: c++ visual-studio-code gdb qemu