aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/extensions.json1
-rw-r--r--.vscode/launch.json34
-rw-r--r--.vscode/tasks.json1
-rw-r--r--source/cmake/Platforms/x86_64.cmake4
4 files changed, 29 insertions, 11 deletions
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 42538eb..8122897 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -4,7 +4,6 @@
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
- "webfreak.debug",
"zixuanwang.linkerscript"
]
} \ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 8c56401..81bf456 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,14 +1,30 @@
{
"version": "0.2.0",
"configurations": [
- {
- "name": "(gdb) Attach to QEmu",
- "request": "attach",
- "type": "gdb",
- "executable": "${workspaceFolder}/build/Debug/bin/kernel",
- "target": "127.0.0.1:1234",
- "remote": true,
- "cwd": "${workspaceFolder}",
- }
+ {
+ "name": "(gdb) QEMU",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${workspaceFolder}/build/Debug/bin/kernel",
+ "MIMode": "gdb",
+ "miDebuggerServerAddress": "localhost:1234",
+ "cwd": "${workspaceFolder}",
+ "stopAtEntry": true,
+ "setupCommands": [
+ {
+ "description": "Enable pretty-printing for gdb",
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ },
+ {
+ "description": "Load file",
+ "text": "-file-exec-and-symbols ${workspaceFolder}/build/Debug/bin/kernel"
+ },
+ {
+ "description": "Set breakpoint on _start",
+ "text": "-break-insert _start"
+ }
+ ]
+ }
]
} \ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index c280971..d77bb56 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -13,6 +13,7 @@
"-cdrom",
"${workspaceFolder}/build/Debug/teachos.iso"
],
+ "isBackground": true,
"presentation": {
"reveal": "always"
},
diff --git a/source/cmake/Platforms/x86_64.cmake b/source/cmake/Platforms/x86_64.cmake
index b681937..25aa27b 100644
--- a/source/cmake/Platforms/x86_64.cmake
+++ b/source/cmake/Platforms/x86_64.cmake
@@ -9,6 +9,8 @@ string(REGEX REPLACE "/crtbegin.o" "" CMAKE_SYSROOT "${CRT_BEGIN}")
mark_as_advanced(CMAKE_SYSROOT)
set(CMAKE_CXX_FLAGS_INIT "-m64 -mno-red-zone -mcmodel=large -fno-exceptions")
+set(CMAKE_CXX_FLAGS_DEBUG "-ggdb3")
+set(CMAKE_ASM_FLAGS_DEBUG "-ggdb3")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-nostartfiles")
set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> \
@@ -20,4 +22,4 @@ set(CMAKE_CXX_LINK_EXECUTABLE
-o <TARGET> \
<LINK_LIBRARIES> \
${CMAKE_SYSROOT}/crtend.o"
-)
+) \ No newline at end of file