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 No breakpoint in C++ class member functions (Read 5446 times)
fatboyatdesk
Newbies
*
Offline


Posts: 2
Joined: Apr 19th, 2013
No breakpoint in C++ class member functions
Apr 25th, 2013 at 3:19am
Print Post  
I have a couple of small classes in my sketch. My breakpoint on the loop seems to hit and trace but not for methods in my class. Is this expected?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: No breakpoint in C++ class member functions
Reply #1 - Apr 25th, 2013 at 11:52am
Print Post  
It might depend if the class is static or not. If possible please email the sketch to info [at] visualmicro.com so i can take a look.

Is the class in a library or a sketch code file?

The debugger has to inject serial code to work. It basically does what you would do yourself if you debugged an arduino sketch using the recommendation from arduino.cc to add serial.println() statements. 

The debugger adds/injects serial.println() statements with a known format so that VS can detect the serial output and "pretend" to be debugging.

This is not a perfect solution but works a lot better than users having to manually add serial.print statements to their code. 

If it can be made better that would be great, I might know more and be able to give better information after I see your sketch.
« Last Edit: Apr 25th, 2013 at 11:55am by Tim@Visual Micro »  
Back to top
IP Logged
 
Peter9
Newbies
*
Offline


Posts: 5
Joined: Apr 29th, 2013
Re: No breakpoint in C++ class member functions
Reply #2 - Apr 30th, 2013 at 8:26pm
Print Post  
Is there any news on this?
I'm having similar problems with class debugging.
Worse still, when I try to use it, it seems to stop the rest of the sketch from running, which is weird.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: No breakpoint in C++ class member functions
Reply #3 - Apr 30th, 2013 at 10:31pm
Print Post  
Sorry did you send your sketch?

As concerns the sketch stopping, you can only put breakpoints where a serial statement could possibly be put. This means that you can't put breakpoints in code that is initialized before the arduino core (and hardware serial classes) have been initialized. It's too early. This is the only cause of a crashing arduino that I have heard about so far.
  
Back to top
IP Logged
 
Peter9
Newbies
*
Offline


Posts: 5
Joined: Apr 29th, 2013
Re: No breakpoint in C++ class member functions
Reply #4 - May 1st, 2013 at 8:57pm
Print Post  
You're right. I knew it would be something like that, but couldn't think what.
It was a class initialized outside a function, but putting it in the loop() makes the breakpoints work.

Thanks for the help.
Now to see what I did wrong in the code...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint