Skip to content

cortex-m: keep state during single-step to disambiguate halt reason#4040

Open
9names wants to merge 1 commit into
probe-rs:masterfrom
9names:fix/cortexm-gdb-step
Open

cortex-m: keep state during single-step to disambiguate halt reason#4040
9names wants to merge 1 commit into
probe-rs:masterfrom
9names:fix/cortexm-gdb-step

Conversation

@9names

@9names 9names commented May 31, 2026

Copy link
Copy Markdown
Contributor

On Cortex-M, DFSR.HALTED is set by C_HALT and C_STEP, so GDB single-step completion (C_STEP) looked the same as an explicit halt (C_HALT).
See https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/Debug-register-support-in-the-SCS/Debug-Fault-Status-Register--DFSR

Add a pending_step flag in CortexMState for the duration of C_STEP, and use that to resolve to the correct halt reason in CoreInterface::status().

Resolves #4030

@9names 9names force-pushed the fix/cortexm-gdb-step branch from ded193e to a98066d Compare May 31, 2026 10:43
@gamelaster

Copy link
Copy Markdown
Contributor

Hi @9names , I tested this on my target and it works great! Thank you.

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.

ARM: Step Over steps inside of function

2 participants