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 [2]  Send TopicPrint
Hot Topic (More than 8 Replies) Breakpoint data not displaying (Read 23657 times)
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint data not displaying
Reply #20 - Jan 8th, 2014 at 5:47pm
Print Post  
Hi,

Sorry. I suspect email notifications are being dumped by your email provider. I think our ISP has allowed someone to use their email server and caused it to be blacklisted. We will move our outgoing email server over the next week to a dedicated server that won't suffer from the abuse of others!

Yes I certainly need to see the build output with a breakpoint so I can see what is failing. Now that you have added a breakpoint can you please email the build output again. Thanks

  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint data not displaying
Reply #21 - Jan 8th, 2014 at 7:02pm
Print Post  
Thanks for the email with the files. It was my fault previously for not explaining properly. Nice code!

I see the problem. This is to do with the way the injected debugger has to work. We inject serial statements into the temp copy of the code, at the END of the line of code. Normally you might expect a debugger to stop or report at the start of a line but with code injection it is easier to report at the end of the line.

In doing this we have to workout how to add a serial.print() to the end of the line of code you have added a breakpoint to. As you can imagine some code lines are easier to workout an "end point" than others. In the case of one line if statements, for example, visual micro attempts to change the code line into a multi-line if statement so that it can then insert the special breakpoint serial messages.

Yhe debugger overviews do try to make the point about adding breakpoints to as simple as possible lines of code. It's not a perfect science and we always look to improve the system based on real world experience.

Your example shows that you placed a breakpoint on a switch statement and I guess it now makes sense to you that this would be a problem. It's a tough place to inject a breakpoint notification message. Your final code actually looked a bit like the following example, after the debugger had done its stuff. 

Notice the serial.print is in an invalid location, I am surprised the compiler didn't pick this up. Oops!

Code
Select All
if(SystemState == STATE_IDLE) {
switch(MotorState) { Serial.print("Breakpoint here!! Ooops!");
case MOTOR_IDLE: 



Actually if you had inserted the breapoint the line before I think it would work okay. The breakpoint would only be hit when system state is idle and a "When Hit" condition of "Motor idle = {MOTOR_IDLE}" should show the current Idle state.

Does this make sense. It's a weakness of injected debugging and something we will improve gradually over time. I notice your code is very neat and makes a lot of use of nested single line statements. These will present a problem and will require some thought by you. Visual Micro can't currently make good judgement about where complex single line nested statements start and end so best to keep away from them.

Normally to debug Arduino, Serial.print statements are manually added to the code and must be removed at some later stage. This debugger does prevent the need to hack the code in that way but it might be that you still need to alter a few one liners to be enclosed in braces { } when diagnosing code issues.

Your code is so neat I am not surprised you have had so many problems. I guess the biggest point I can make is to be clear that we inject to the end of a line of code and it is not an exact science when faced with anything other than simple and clear bracketing {}. 

Sometimes it is also useful to note that because we inject you can place a breakpoint on blank/empty lines of code but please keep in mind how a new line of code will affect program flow {}.

Whilst not a perfect solution I hope this helps remove some frustration an thanks for your patience
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #22 - Jan 8th, 2014 at 8:05pm
Print Post  
Wow - thanks for the kind words on the code...  after 30 years I SHOULD start to get it right.... LOL!

Ok - I hear all you are saying.  This is my most ambitions Arduino project to date so I guess it is no surprise I may have pushed the envelope a tad.

I have in the past, stuck a single line of code like "x = 1;" to be able to break in the area where I want to see the vars in that area.  So my understanding is, that if I break on statements were simple operations are being done, I should be ok?

Thanks for the lengthy and detailed reply...  I'll stash it away in my Arduio Evernote collection.

=Alan R.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint data not displaying
Reply #23 - Jan 8th, 2014 at 9:20pm
Print Post  
Yes it's solid as a rock on simpler code.

Thanks again
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint