Browse Source

第一次实验调试环境

main
os_lab_user 9 months ago
parent
commit
69e4f2d806
3 changed files with 90 additions and 0 deletions
  1. +45
    -0
      .vscode/launch.json
  2. +43
    -0
      .vscode/tasks.json
  3. +2
    -0
      background.sh

+ 45
- 0
.vscode/launch.json View File

@ -0,0 +1,45 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "obj/bootblock.o",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/labcodes_answer/lab1_result",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"preLaunchTask": "make gdb",
"postDebugTask": "shutdown gdb",
"miDebuggerServerAddress": "localhost:1234",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "Replay",
"type": "lldb",
"request": "custom",
"targetCreateCommands": [],
"processCreateCommands": ["gdb-remote 127.0.0.1:1234"],
"reverseDebugging": true
},
]
}

+ 43
- 0
.vscode/tasks.json View File

@ -0,0 +1,43 @@
{
"tasks": [
{
"label": "make gdb",
"type": "shell",
"command": "bash ${workspaceFolder}/background.sh",
"isBackground": true,
"options": {
"env": {
"DISPLAY": ":0",
},
"cwd": "${workspaceFolder}/labcodes_answer/lab1_result"
},
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "starting QEMU",
"endsPattern": "starting QEMU",
}
}
]
},
{
"label": "shutdown gdb",
"type": "process",
"command": "pkill",
"isBackground": false,
"args": ["qemu-system-i38"], // i38i386
},
],
"version": "2.0.0"
}

+ 2
- 0
background.sh View File

@ -0,0 +1,2 @@
echo "starting QEMU"
make gdb

Loading…
Cancel
Save