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 Adding Breakpoint causes program syntax error (Read 2157 times)
dbaechtel
Newbies
*
Offline


Posts: 3
Joined: Jul 5th, 2023
Adding Breakpoint causes program syntax error
Jul 6th, 2023 at 6:14pm
Print Post  
Attached is the main Loop of my Arduino Uno application. It compiles without error, If I add a Breakpoint to line 398, the VS IDE indicates a syntax error on line 399. If I delete the breakpoint, the syntax error goes away. If I add the breakpoint again, the syntax error comes back. Why does adding a breakpoint cause syntax errors in the program? What is going on with the IDE? Cry BUG. Please Help.
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Breakpoint causes program syntax error
Reply #1 - Jul 6th, 2023 at 6:32pm
Print Post  
I assume the syntax error is an error you see during attempt to compile.

The serial debugger works differently to the way hardware debug works. Serial debug has to inject code into a hidden temp copy of the code during compilation. It adds code to the end of a line and attempts to navigate braces inside If or Case statements etc. 

In this case you have set a breakpoint on an If() line and I suspect the comment is causing some confusion. We will test. If that is the problem you can either put the breakpoint the line before the If() or inside/after the opening brace of the if() to debug when the if() resolves to true.

In short, the serial debugg allows breakpoints on blank lines, therefore try moving the breakpoint up one line.

Does this help ?
  
Back to top
IP Logged
 
fredcasper
Newbies
*
Offline


Posts: 1
Joined: Aug 9th, 2023
Re: Adding Breakpoint causes program syntax error
Reply #2 - Aug 11th, 2023 at 2:48am
Print Post  
Tim@Visual Micro wrote on Jul 6th, 2023 at 6:32pm:
I assume the syntax error is an error you see during attempt to compile.

The serial debugger works differently to the way hardware debug works. Serial debug has to inject code into a hidden temp copy of the code during compilation. It adds code to the end of a line and attempts to navigate braces inside If or Case statements etc. 

In this case you have set a breakpoint on an If() line and I suspect the comment is causing some confusion. We will test. If that is the problem you can either put the breakpoint the line before the If() or inside/after the opening brace of the if() to debug when the if() resolves to true.

In short, the serial debugg allows breakpoints on blank lines, therefore try moving the breakpoint up one line.

Does this help ?

That worked, thanks so much!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint