You need to log in to create posts and topics.

Debugger not stepping properly with Arduino

PreviousPage 3 of 4Next

@arcachofo, I don't know if this will help at all, but I observed that even without setting any breakpoints, once I click the "Pause" button, clicking the "Step" button does not advance the cursor to the next line. I am noticing that I can repeatedly pause and then click "Step" or "StepOver" or "Run To Breakpoint", and the line number remains same with the Clock Cycles remaining zero.

In one case something different happened, and clock cycles indicated 1 instead of 0. In this case the cursor did advance to the next line. Here's an example:

Line 10    Clock Cycles: 38373675       Time us: 2.39835e+06
Line 11    Clock Cycles: 1              Time us: 0.0625

I do not know how to make this happen reliably though. My typical experience is clicking "Step" or "StepOver" or "Run To Breakpoint" not advancing the line number and reliably reporting 0 clock cycles, which I think means nothing was executed when I attempted to step.

I do also want to note that as long as I don't pause, without any breakpoints, if I click the "Run To Breakpoint" button, the code just executes forever. If I set a simple rjmp instruction and a label, I can see that the code perpetually jumps to the label. If I only pause and continue by clicking the "Run To Breakpoint" button, again without having any breakpoints set, the debugger seemingly resumes execution. But, once I click the "Step" or "StepOver" buttons, debugger stops working. Once it stops working, this can be seen, with Line 11 in this example repeating over and over and over.

Line 14    Clock Cycles: 554365792      Time us: -1.8315e+08
Line 10    Clock Cycles: 44926410       Time us: 2.8079e+06
Line 10    Clock Cycles: 39326976       Time us: 2.45794e+06
Line 11    Clock Cycles: 1              Time us: 0.0625
Line 11    Clock Cycles: 0              Time us: 1.8e+06

I recorded this to make it a little easier to understand what I am describing. Please have a look if time allows. Thanks!

https://drive.google.com/file/d/1M-rzBDMfBd0JRGcYwdsMyU25rUcwuJb8/view?usp=sharing

Sorry, I know this has been a puzzling issue. I am just reporting observations in hopes that something may prove useful.

Hi.

Can you share a zip with the circuit and source code?

Thank you, attached.

Uploaded files:

Hi.

I could reproduce this issue in an X86 Mac.
Now at least I can try to debug it, but I'm not a Mac user so it can take some time.

This is great to hear. Thank you for confirming, sounds like this issue is not architecture-specific. I am happy to test any fixes that you might want some validation of.

Thanks again, Sam.

Hi Sam, I think this issue is solved.
If you want to confirm it try with this one: SimulIDE_1.1.0-2030_MacOs

Unfortunately I cannot open the program. I downloaded the archive and it decompresses without an issue, but I cannot run it. I does not appear to be related to signing or lack thereof. I am seeing the following message:

The application “simulide.app” can’t be opened.

No idea why... Maybe because I zipped it in Linux?
Can you try this one? SimulIDE_1.1.0-2030_MacOs

This is much better. I was able to open the program, though I had to explicitly allow its execution. It is now working as I would expect. I can step properly, I can run to breakpoint properly, jumps work correctly and stepping works fine after the jump. It certainly looks like you have it fixed. Thank you very much for digging into this and resolving it!

Glad to know that it is working.

Thanks to you for reporting and testing.

PreviousPage 3 of 4Next