Stepping ends up in an ISR #124
Replies: 3 comments 2 replies
-
Hi @celephicus Bloom doesn't currently provide any configuration option for stop timers, but I assumed the EDBG tools would stop the timers by default. But I have not confirmed this, so it's possible that the timers are still running whilst the target is stopped. I have prepared an unofficial build for you, v1.0.3, which accepts the target:
# ...
stopTimers: true DEB: https://github.com/bloombloombloom/Bloom/releases/download/v1.0.0/Bloom-1.0.3-Linux-x86_64-unofficial.deb That build will configure the EDBG tool to stop the timers when the target is stopped, if
Not sure how it would do that, but my guess is that it just disables all interrupts via the status register, before performing the step. This is something I could implement in Bloom, but not in the upcoming release. |
Beta Was this translation helpful? Give feedback.
-
Thinking about this some more: In Bloom v2.0.0, I have introduced four GDB monitor commands, for accessing registers on the target. One of them,
And to enable:
"cpu" is the peripheral key (in which the status register resides), "sreg" is the register key of the status register, "i" is the bit field key, and "0bX" is the value we wish to write to the bit field. So in v2.0.0, you will have the ability to disable global interrupts whenever you want, via GDB. You can put this into a user defined GDB command, to create a "step without interrupts" command. Something like this:
Now you can invoke that "next-ni" command, to perform a
For more on user-defined GDB commands: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Define.html But you'll have to wait for v2.0.0 to try this out. I'm looking to push that release in the next 3-4 weeks. Here's the draft documentation for the And here's the list bit fields (including their keys), from the new target details page (which will be going live with the v2.0.0 release): |
Beta Was this translation helpful? Give feedback.
-
Hi navnavnav, I addressed this issue in a blog post. It seems to be a GDB bug or a feature (?). I addressed it in my debugWIRE hardware debugger by executing each single instruction step (that is what GDB will tell the GDB server) in the internal execution register (or using simulation for 2-word instructions). This makes next-step instructions independent of interrupts. They either do not happen (when single-stepping) or happen in the background (when stepping over a function call). As far as I can tell, you can issue such offline execution also in the EGDB protocol. Note that all this orthogonal to whether timers (and PMW) are active or not while you are in stopped state. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Working on a Mega328P with loys of interrupts. When I set a breakpoint in the mainline code, after a few steps with gdb "next" command I end up in an ISR. I can't seem to escape from these beyond setting another breakpoint in my code and using "continue". Any advice? Atmel Studio could stop the device clocks when it was halted, which reduced the occurrence. Avarice has a command line option that avoided next or step entering ISR's at all.
tom AT redgumandrust com au
Beta Was this translation helpful? Give feedback.
All reactions