Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug in VS Code #4

Open
Fudanyrd opened this issue Oct 2, 2024 · 0 comments
Open

Debug in VS Code #4

Fudanyrd opened this issue Oct 2, 2024 · 0 comments

Comments

@Fudanyrd
Copy link

Fudanyrd commented Oct 2, 2024

Hi. I have figured out a way to debug kernel8.elf in vscode. Hopefully this will be useful.

In .vscode/tasks.json:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "make",
            "args": [],
            "options": {
                "cwd": "${workspaceFolder}/build/"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

In .vscode/launch.json:

{
    "configurations": [
        {
            "name": "C/C++: gcc build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/kernel8.elf",
            "args": [
            ],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/build/",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                },
                {
                    "description": "set architecture",
                    "text": "set architecture aarch64",
                    "ignoreFailures": false
                },
                {
                    "description": "set gdb port",
                    "text": "target remote localhost:1234",
                    "ignoreFailures": false
                },
                {
                    "description": "set kernel position",
                    "text": "file ${workspaceFolder}/build/src/kernel8.elf",
                    "ignoreFailures": false
                },
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ],
    "version": "2.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant