dist/tools/PyCortexMDebug: Integrate GDB extension into RIOT#21863
Merged
crasbe merged 4 commits intoRIOT-OS:masterfrom Nov 11, 2025
Merged
dist/tools/PyCortexMDebug: Integrate GDB extension into RIOT#21863crasbe merged 4 commits intoRIOT-OS:masterfrom
crasbe merged 4 commits intoRIOT-OS:masterfrom
Conversation
Member
|
It's still failing a static test, I'll test it in the meantime though :) |
Member
|
Normal building/flashing/debugging works fine. When I use |
Member
Author
|
Indeed, should be fixed now |
Member
|
Squash 👍 |
Member
|
(Also wow that is such a neat feature) |
crasbe
reviewed
Nov 10, 2025
- Do not provide defaults for `${DBG}`, `${TUI}`, `${GDB_PORT}`,
`${TELNET_PORT}` with special shell functions, but use canonical
syntax for that
- Add `${DBG_EXTRA_FLAGS}` and pass them to GDB, as we do in OpenOCD
- Run `${DBG}` with `sh -c "..."` just like done in `openocd.sh` to
allow passing flags to GDB in the same way independent of whether
JLink or OpenOCD is used.
When running
make RIOT_USE_PYCORTEXMDEBUG=1 debug
RIOT will now fetch PyCortexMDebug and instruct GDB to load that
extension on start. If additionally RIOT provides `SVD_VENDOR` and
`SVD_MODEL` to identify the SVD file to load, an
`svd_load $(SVD_VENDOR) $(SVD_CLIENT)` is also passed to GDB.
Co-authored-by: crasbe <[email protected]>
Co-authored-by: Ann🐸 <[email protected]>
With this, running `make RIOT_USE_PYCORTEXMDEBUG=1 debug` for any nRF52 based boards will directly load the correct SVD file.
With this, running `make RIOT_USE_PYCORTEXMDEBUG=1 debug` for any STM32F7 based boards will directly load the correct SVD file. Co-authored-by: crasbe <[email protected]>
811c09e to
dde6e6e
Compare
AnnsAnns
approved these changes
Nov 11, 2025
Member
AnnsAnns
left a comment
There was a problem hiding this comment.
Thank you for the continued review over the night 😄
Here is my approval, though crasbe should probably also approve
Contributor
Oh, you actually tested this, your approval is enough :) |
Member
Yeah but you also reviewed it, didn't want to overrule your review ;P |
Member
Author
|
Thx ❤️ |
13 tasks
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.
Contribution description
When running
RIOT will now fetch PyCortexMDebug and instruct GDB to load that extension on start. If additionally RIOT provides
SVD_VENDORandSVD_MODELto identify the SVD file to load, ansvd_load $(SVD_VENDOR) $(SVD_CLIENT)is also passed to GDB.For nRF52 and STM32F7 based boards,
SVD_VENDORandSVD_CLIENTare already provided.Testing procedure
wget -O ~/.cache/cmdebug/cmsis-svd-data.zip https://github.com/cmsis-svd/cmsis-svd-data/archive/refs/heads/main.zip. (This is documented in theREADME.mdindist/tools/PyCortexMDebugand can be automated in a follow up.)make BOARD=nucleo-f767zi -C examples/basic/default flashmake RIOT_USE_PYCORTEXMDEBUG=1 BOARD=nucleo-f767zi -C examples/basic/default debugLoading SVD file STMicro/STM32F7x7...svdcommand works, e.g. trysvd SYSCFG EXTICR1nrf52840dkdefaults to using J-Link when installedExpected results:
svd_loadcommand is provided in GDB and works out of the box for both J-Link and OpenOCDsvd_load <SVD_VENDOR> <SVD_MODEL>command and directly inspect memory withsvdIssues/PRs references
None