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

(riscv)Error executing command 'gdb-set target-async on' [conflicting gdbinit files] #454

Closed
lapuzen3 opened this issue Feb 25, 2025 · 4 comments

Comments

@lapuzen3
Copy link

lapuzen3 commented Feb 25, 2025

version: 0.27.0
OS: macOS Sequoia 15.3.1
GDB: riscv64-elf-gdb 16.2

I am currently trying to attach my gdb to qemu, emulating riscv64.

My launch.json setting is this:

{
        "type": "gdb",
        "gdbpath": "riscv64-elf-gdb",
        
        "request": "attach",
        "stopAtConnect": true,
        "autorun": [
          "set mi-async on",
          "file ${workspaceFolder}/kernel/kernel",
          "-enable-pretty-printing"
        ],
        "name": "remote debug xv6",
        "executable": "kernel/kernel",
        "target": ":25501",
        "remote": true,
        "cwd": "${workspaceFolder}",
        
        "showDevDebugOutput": true
    }

And due to the debug console, "0x0000000000001000 in ?? ()", I think the attach was successful.
However, after that, gdb terminates and my qemu session terminates also.
Is it due to 'set target-async' command?
How can I fix this?
Image

Image
@GitMensch
Copy link
Collaborator

How did you fix this yourself (which is the state of the issue)?

[note: the real error message says you need to interrupt before executing set mi-async on]

@lapuzen3
Copy link
Author

I found that there was already set .gdbinit file, and it was like this:

set confirm off
set architecture riscv:rv64
target remote 127.0.0.1:25501
symbol-file kernel/kernel
set disassemble-next-line auto
set riscv use-compressed-breakpoints yes
set mi-async on

So I think that it made collision with the launch.json configuration. When I deleted that line target remote ..., I got right.
I tried to solve this problem literally 10 hours or something. How silly am I!!

@lapuzen3
Copy link
Author

[note: the real error message says you need to interrupt before executing set mi-async on]

And I was working with my GPT, he said that was the problem. Therefore I kinda obsessed with that problem. T.T

@GitMensch
Copy link
Collaborator

Thanks for the information - so it was a "user issue outside of the extension" (it does not know which gdbinit files are used, the only thing it could do is requesting GDB to not load any gdbinit files - but that will break a bunch of working installations; and one can already add debugger_args: ["-n", "-x"] for that purpose.

@GitMensch GitMensch closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
@GitMensch GitMensch changed the title (riscv)Error executing command 'gdb-set target-async on' (riscv)Error executing command 'gdb-set target-async on' [conflicting gdbinit files] Feb 26, 2025
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

2 participants