From f038f6110e475f2cf5d2502a2ccf5d527473ace8 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Fri, 20 Dec 2024 04:01:33 +0200 Subject: [PATCH] chore: Update vscode config Signed-off-by: EnderIce2 --- Kernel/.vscode/c_boilerplates.code-snippets | 5 + Kernel/.vscode/extensions.json | 14 -- Kernel/.vscode/launch.json | 159 ++++---------------- Kernel/.vscode/tasks.json | 2 +- 4 files changed, 32 insertions(+), 148 deletions(-) delete mode 100644 Kernel/.vscode/extensions.json diff --git a/Kernel/.vscode/c_boilerplates.code-snippets b/Kernel/.vscode/c_boilerplates.code-snippets index 7ec82196..728fbeb9 100644 --- a/Kernel/.vscode/c_boilerplates.code-snippets +++ b/Kernel/.vscode/c_boilerplates.code-snippets @@ -1,5 +1,7 @@ { "Fennix Kernel C++ Header": { + "isFileTemplate": true, + "scope": "c,cpp", "prefix": [ "head", ], @@ -31,6 +33,8 @@ "description": "Create kernel header." }, "Fennix Kernel C Header": { + "isFileTemplate": true, + "scope": "c,cpp", "prefix": [ "headc", ], @@ -74,6 +78,7 @@ "description": "Create kernel documentation brief." }, "License": { + "isFileTemplate": true, "prefix": [ "license", ], diff --git a/Kernel/.vscode/extensions.json b/Kernel/.vscode/extensions.json deleted file mode 100644 index 3ccb126d..00000000 --- a/Kernel/.vscode/extensions.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "recommendations": [ - "jeff-hykin.better-cpp-syntax", - "aaron-bond.better-comments", - "ms-vscode.cpptools", - "maziac.hex-hover-converter", - "zixuanwang.linkerscript", - "webfreak.debug", - "ibm.output-colorizer", - "wayou.vscode-todo-highlight", - "gruntfuggly.todo-tree", - "maziac.asm-code-lens" - ] -} \ No newline at end of file diff --git a/Kernel/.vscode/launch.json b/Kernel/.vscode/launch.json index c125338b..dd87f5bd 100644 --- a/Kernel/.vscode/launch.json +++ b/Kernel/.vscode/launch.json @@ -2,10 +2,10 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch QEMU and debug the kernel", + "name": "Launch QEMU & debug the kernel", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/fennix.elf", + "program": "${workspaceFolder}/../Kernel/fennix.elf", "cwd": "${workspaceFolder}", "args": [], "targetArchitecture": "x64", @@ -14,6 +14,7 @@ "miDebuggerArgs": "", "externalConsole": false, "additionalSOLibSearchPath": "${workspaceFolder}", + "internalConsoleOptions": "neverOpen", "customLaunchSetupCommands": [ { "text": "target remote localhost:1234", @@ -31,145 +32,37 @@ "description": "Make breakpoint pending on future shared library load." }, { - "text": "file ${workspaceFolder}/fennix.elf", - "description": "Load binary." + "text": "file ${workspaceFolder}/../Kernel/fennix.elf", + "description": "Load binary" }, { - "text": "source ${workspaceFolder}/.gdbinit" + "text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest", + "description": "Load /bin/utest", + "ignoreFailures": true + }, + { + "text": "source ${workspaceFolder}/../tools/.gdbinit" } ], "preLaunchTask": "launch-qemu" }, { - "name": "Attach to a running VM instance", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/fennix.elf", - "cwd": "${workspaceFolder}", - "args": [], - "targetArchitecture": "x64", - "MIMode": "gdb", - "miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb", - "miDebuggerArgs": "", - "externalConsole": false, - "additionalSOLibSearchPath": "${workspaceFolder}", - "customLaunchSetupCommands": [ - { - "text": "target remote localhost:1234", - "description": "Connect to QEMU remote debugger" - } + "type": "gdb", + "request": "attach", + "name": "Launch QEMU & attach to gdbserver", + "executable": "${workspaceFolder}/../Kernel/fennix.elf", + "target": ":1234", + "remote": true, + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText", + "gdbpath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb", + "autorun": [ + "set auto-load safe-path ${workspaceFolder}", + "source ${workspaceFolder}/../tools/.gdbinit", ], - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "text": "set breakpoint pending on", - "description": "Make breakpoint pending on future shared library load." - }, - { - "text": "file ${workspaceFolder}/fennix.elf", - "description": "Load binary." - }, - { - "text": "source ${workspaceFolder}/.gdbinit" - } - ], - }, - { - "name": "Attach to VM w/utest", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/fennix.elf", - "cwd": "${workspaceFolder}", - "args": [], - "targetArchitecture": "x64", - "MIMode": "gdb", - "miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb", - "miDebuggerArgs": "", - "externalConsole": false, - "additionalSOLibSearchPath": "${workspaceFolder}", - "customLaunchSetupCommands": [ - { - "text": "target remote localhost:1234", - "description": "Connect to QEMU remote debugger" - } - ], - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "text": "set breakpoint pending on", - "description": "Make breakpoint pending on future shared library load." - }, - { - "text": "file ${workspaceFolder}/fennix.elf", - "description": "Load binary." - }, - { - "text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest", - "description": "Load /bin/utest.", - "ignoreFailures": true - }, - { - "text": "source ${workspaceFolder}/.gdbinit" - } - ], - "preLaunchTask": "launch-qemu", - }, - { - "name": "Attach to VM w/utest_linux", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/fennix.elf", - "cwd": "${workspaceFolder}", - "args": [], - "targetArchitecture": "x64", - "MIMode": "gdb", - "miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb", - "miDebuggerArgs": "", - "externalConsole": false, - "additionalSOLibSearchPath": "${workspaceFolder}", - "customLaunchSetupCommands": [ - { - "text": "target remote localhost:1234", - "description": "Connect to QEMU remote debugger" - } - ], - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "text": "set breakpoint pending on", - "description": "Make breakpoint pending on future shared library load." - }, - { - "text": "file ${workspaceFolder}/fennix.elf", - "description": "Load binary." - }, - { - "text": "set debug-file-directory /usr/lib/debug", - "description": "Set debug-file-directory to /usr/lib/debug.", - "ignoreFailures": true - }, - { - "text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest_linux", - "description": "Load /bin/utest_linux.", - "ignoreFailures": true - }, - { - "text": "source ${workspaceFolder}/.gdbinit" - } - ], - "preLaunchTask": "launch-qemu", + "internalConsoleOptions": "neverOpen", + "printCalls": false, + "preLaunchTask": "launch-qemu" }, ] } \ No newline at end of file diff --git a/Kernel/.vscode/tasks.json b/Kernel/.vscode/tasks.json index 60e214ec..1c699043 100644 --- a/Kernel/.vscode/tasks.json +++ b/Kernel/.vscode/tasks.json @@ -4,7 +4,7 @@ { "label": "launch-qemu", "type": "shell", - "command": "make -j$(shell nproc) build && make -C ../ build_image && make -C ../ vscode_debug_only", + "command": "make -C ../ build && make -C ../ vscode_debug_only", "isBackground": true, "problemMatcher": [], "group": {