Skip to content

fix: GDB stub reading wrong code for vCont packet - #2388

Merged
RSDuck merged 2 commits into
melonDS-emu:masterfrom
jonko0493:fix/gdbstub-vcont
Sep 3, 2025
Merged

fix: GDB stub reading wrong code for vCont packet#2388
RSDuck merged 2 commits into
melonDS-emu:masterfrom
jonko0493:fix/gdbstub-vcont

Conversation

@jonko0493

Copy link
Copy Markdown
Contributor

I was attempting to use the gdb stub with lldb (in its gdb-remote mode) and noticed that the debugging session was always abruptly terminated whenever attempting to step or continue after a breakpoint was hit. It turns out that lldb sends the vCont packet for these actions, e.g. vCont;s:1. This is the correct format for this command as seen in the gdb documentation here -- specifically, it indicates continue, step, thread 1.

However, the current gdb stub implementation was reading the ; as the continue action code, assuming it was invalid, and then throwing an error. To me, this just seems like it should have never worked, but I'm also not super familiar with gdb's internals so I've fixed the issue without introducing a breaking change.

@RSDuck

RSDuck commented Sep 3, 2025

Copy link
Copy Markdown
Member

The current code does seem to contain a mistake, please handle it so that only the correct behaviour is accepted. It was previously not spotted because gdb uses c to continue.

@jonko0493

Copy link
Copy Markdown
Contributor Author

Sounds great, will change accordingly.

@RSDuck
RSDuck merged commit 4d635e7 into melonDS-emu:master Sep 3, 2025
6 checks passed
@jonko0493
jonko0493 deleted the fix/gdbstub-vcont branch September 3, 2025 15:39
Dionicio3 pushed a commit to Dionicio3/melonDS that referenced this pull request Oct 21, 2025
* fix: GDB stub reading wrong code for vCont packet

* Implementation did contain bug, fixup
Zection6V pushed a commit to ag-advania/melonPrimeDS that referenced this pull request Aug 13, 2026
* fix: GDB stub reading wrong code for vCont packet

* Implementation did contain bug, fixup
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

Successfully merging this pull request may close these issues.

2 participants