Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Breakpoint not tripping (Read 2054 times)
dbaechtel
Newbies
*
Offline


Posts: 3
Joined: Jul 5th, 2023
Breakpoint not tripping
Jul 6th, 2023 at 6:51pm
Print Post  
Attached is a screenshot of my main program loop. The tracepoint on line 376 shows the start_ms value is != 0. "line 376      loop()      start_ms=7254". But the breakpoint on line 379 is not triggered. The program runs all the way to the breakpoint on line 402. Why is this happening? How can I debug my Arduino app with VS micro if I cannot trust the breakpoint operation? BUG.  Cry
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Breakpoint not tripping
Reply #1 - Jul 6th, 2023 at 6:57pm
Print Post  
The Serial Debuggers breakpoints are added at the end of the line in the temp copy of the code before upload.

If you move the breakpoint down to the { brace it will trigger when the if condition is met, or move it to the line above (378) where the dur variable can still be inspected.

Alternatively the GDBStub for the Uno may be an alternative option, which does not work by adding code in:
https://www.visualmicro.com/page/AVR-Debugging.aspx
  
Back to top
IP Logged
 
dbaechtel
Newbies
*
Offline


Posts: 3
Joined: Jul 5th, 2023
Re: Breakpoint not tripping
Reply #2 - Jul 6th, 2023 at 7:10pm
Print Post  
Why doesn't the Breakpoint on line 379 trip when the if condition on line 376 is true?
How can I debug my Arduino application with vs micro if I cannot trust the breakpoint operation?
Cry
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint not tripping
Reply #3 - Jul 6th, 2023 at 7:22pm
Print Post  
It's probably worth reading the serial debugger guides in our docs. Everything I have said is clearly shown. You don't appear to have followed my comments in my previous response. 

Move breakpoint at 376 to 378 which is a simpler code line. 

other things to bear in mind

Bear in mind a fast cpu loop() can work faster than the pc in terms of rendering data to serial monitors and debug windows. You are right to try to debug inside conditions, that will help to keep the number of debug packets down. The breakpoints also provide conditions and the counter is treated as millis()

Your other post here https://www.visualmicro.com/forums/YaBB.pl?num=1688667266/2#2
« Last Edit: Jul 6th, 2023 at 7:24pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint