From 69e4f2d8064eee6d0de4a54e4e3b256346623307 Mon Sep 17 00:00:00 2001 From: os_lab_user Date: Sun, 24 Mar 2024 11:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 43 +++++++++++++++++++++++++++++++++++++++++++ background.sh | 2 ++ 3 files changed, 90 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 background.sh diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..099c58b --- /dev/null +++ b/.vscode/launch.json @@ -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 + }, + + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..c69f21a --- /dev/null +++ b/.vscode/tasks.json @@ -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"], // 我也不知道为什么这个进程名字是i38而不是i386 + }, + + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/background.sh b/background.sh new file mode 100644 index 0000000..0154b1e --- /dev/null +++ b/background.sh @@ -0,0 +1,2 @@ +echo "starting QEMU" +make gdb \ No newline at end of file