Add gdb for init.elf

This commit is contained in:
Alex 2023-05-05 17:08:36 +03:00
parent 607d0dc048
commit d0ec077c09
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 45 additions and 0 deletions

40
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,40 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "/system/init.elf",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/out/system/init.elf",
"cwd": "${workspaceRoot}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceRoot}",
"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 ${workspaceRoot}/out/system/init.elf",
"description": "Load binary."
},
]
}
]
}

View File

@ -48,6 +48,11 @@ else ifeq ($(OSARCH), aarch64)
CFLAGS += -pipe
endif
ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG -ggdb3 -O0 -fdiagnostics-color=always -fverbose-asm
LDFLAGS += -ggdb3 -O0
endif
build: $(FILENAME)
$(OBJDUMP) -d $(FILENAME) > file_dump.map
mv $(FILENAME) ../../../out/system/$(FILENAME)