The launch.json
is as follows:
{ "version": "0.2.0", "configurations": [ { "name": "C/C++: gcc 生成和调试活动文件", "type": "cppdbg", "request": "launch", "miDebuggerPath": "/usr/bin/gdb-multiarch", "miDebuggerServerAddress": "127.0.0.1:25000", "program": "/root/xv6-labs-2021/kernel/kernel", "args": [], "stopAtEntry": false, "cwd": "/root/xv6-labs-2021", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "将反汇编风格设置为 Intel", "text": "-gdb-set disassembly-flavor intel", "ignoreFailures": true }, ], } ] }
make CPUS=1 qemu-gdb
in a seperate shell terminal..gdbinit
generated in the xv6 root directory. Comment out target remote 127.0.0.1:25000
. Remaining contents areset confirm off set architecture riscv:rv64 symbol-file kernel/kernel set disassemble-next-line auto set riscv use-compressed-breakpoints yes
F5
in vscode and