Fix: reuse GDB packet buffer for m/M-packets instead of VLA#2184
Merged
dragonmux merged 1 commit intoblackmagic-debug:mainfrom Feb 2, 2026
Merged
Fix: reuse GDB packet buffer for m/M-packets instead of VLA#2184dragonmux merged 1 commit intoblackmagic-debug:mainfrom
dragonmux merged 1 commit intoblackmagic-debug:mainfrom
Conversation
dragonmux
approved these changes
Feb 2, 2026
Member
dragonmux
left a comment
There was a problem hiding this comment.
LGTM, please rebase on main and we'll get this merged. Thank you for the contribtion! We quite like this way of working round the VLA problem - it's really a nice solution.
8be6515 to
67a5b23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detailed description
Tested on BMDA (env CC=clang, -Db_sanitize=address) and on blackpill-f411ce against GD32VF103. Dump and compare-sections seem to match, GDB receives 512 byte (1024 hex-encoded) packets.
g/G-packets still depend on VLA because BMP supports multiple architectures with different amounts of general-purpose registers.
{armv7-m 20*4, armv8-m.main 24*4} + fpv4-sp-d16 33*4, armv7-a/r 17*4 + VFPv3 33*4, armv8-a 31*8, rv32i 33*4, rv32e 17*4, rv64i 33*8.IMHO a static regcache of 512 bytes could be enough (with build-time static assert that no arch needs more), but it's not visibly broken now, so not touching.Your checklist for this pull request
Closing issues
Closes #2042. @perigoso