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 Putting breakpoint in CPP file breaks code (Read 5112 times)
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Putting breakpoint in CPP file breaks code
Aug 8th, 2016 at 4:10pm
Print Post  
I am working on a large project and thus have multiple CPP and H files in addition to my loop in the .INO file. I am able to insert breakpoints anywhere in the INO file but if I insert them into any of my CPP files it breaks my entire code and nothing works. Everything freezes and it will not do anything.

If in the same place I put the breakpoint I have a Serial.print() that works just fine. So, in theory debug should work.

I am running a fairly normal code setup, although I am using the same interrupt that millis uses to debounce a couple buttons.

Any reason why this would be happening?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Putting breakpoint in CPP file breaks code
Reply #1 - Aug 8th, 2016 at 4:35pm
Print Post  
If you are using the millis() timer you could try switching off the throttle in the visual micro debugger project properties. 

ThrottleEnabled=False

If that fails please switch on vMiro>compiler>show build folder

Then email one of the cpp's that contains breakpoints after a debug upload. the cpp will be in the temp build folder.

Thanks
  
Back to top
IP Logged
 
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Re: Putting breakpoint in CPP file breaks code
Reply #2 - Aug 8th, 2016 at 4:49pm
Print Post  
Disabling the millis() throttle seems to have fixed it. Any reason why that was a causing an issue before? Was it stripping out my code that's in the same time interrupt as millis()?

If I didn't miss it in the documentation would it be possible to add a note that you could run into issues if you're using CPP and H files and timer0?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Putting breakpoint in CPP file breaks code
Reply #3 - Aug 8th, 2016 at 4:57pm
Print Post  
Hi

see if this makes sense to you. First of all there is a note in the breakpoint docs about switching off the throttle if using timers and isr's but will check it is clear when I get a mo.

there isn't a difference between .ino and .cpp. in fact .ino is saved into a .cppthen compiled. I suspect your timer code hadn't been hit when methods in the .ino were hit.

All switching off throttle does is to prevent visual micro from using the standard aduino delay() method. 

The delay() is used to prevent two breakpoints from executing within approx 80-100ms of each other which prevents newer users from using non-breaking trace points inside a fast loop which then flood the pc with serial messages.

Did your breakpoints break or just trace?
  
Back to top
IP Logged
 
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Re: Putting breakpoint in CPP file breaks code
Reply #4 - Aug 8th, 2016 at 5:07pm
Print Post  
That makes sense. 

Yes, my code was actually breaking. 

With further testing I've found that even with throttling disabled I will continue to have breakpoint issues. It seems to be very dependent on what function and where I put the breakpoint. If I put it one spot everything. Yet, if I put the same breakpoint somewhere else it crashes the entire program.....

So it seems I've got it partially working, but not to a point where its actually useful for what I need.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Putting breakpoint in CPP file breaks code
Reply #5 - Aug 8th, 2016 at 5:10pm
Print Post  
Okay. what it does it clearly visible in the temp folder so should relatively easy to track.

You can zip and email the build folder to info[at]visualmicro.com if you want me to look into it.

By the way, did you use the free 45 day trial to test debug?

Thanks
« Last Edit: Aug 8th, 2016 at 5:11pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint