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
Very Hot Topic (More than 25 Replies) Fixed: Breakpoint Not Hit - arduino code was using a different serial speed than the default (Read 32041 times)
Roberto Imai
Junior Member
**
Offline


Posts: 22
Joined: Sep 9th, 2012
Re: Breakpoint Not Hit
Reply #20 - Sep 24th, 2012 at 9:43pm
Print Post  
Yes, I was talking about libraries .cpp files.
The reference to global variables does work.
I can set a breakpoint on the ino code and reference a global variable from ReefAngel Class and works just fine Smiley
It didn't find my breakpoints inside any libraries though Sad
I even tried one of the core Arduino libraries and did not work either.
I was trying to add a breakpoint on HardwareSerial.being() function inside HardwareSerial.cpp just to see if it was because of my custom libraries or not, but it seems none are working now. I'll wait for more good news Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #21 - Sep 24th, 2012 at 9:57pm
Print Post  
Bryan, I received your email thanks and have added the image to your post.

You are certainly talking about debug for .cpp in libraries. That is a neat system you guys are working with!

I have a few tips:

1) I notice you are trying to set a breakpoint on the call to initialise the wire i2c system. I know it is just an example for the picture because it isn't a useful breakpoint but have this information just in case. 

If you want to see what i2c device ids are available when the arduino boots up then there is visual micro debug option called "Startup I2C Report". Enabling this option will give you a list of connected i2c device ids in the debug output windows. 

If you are connecting and disconnecting i2c devices when the arduino is running then let me know because there is a {special variable} name you can add to breakpoints that will give an i2c report at any time during a debug session.

2)

All the classes in the reefAngel:Init should be accessible to breakpoints in the main .ino file.

I guess you can use something like this as a debug message from the .ino:-

Code
Select All
Joystick x pos ={Joystick.x} 



Does the main .ino file call something like ReefAngel.Init()? If so then you can add breakpoint conditions to that line (or anywhere after it) such as :-

Code
Select All
The value of joystick x pos ={Joystick.x} and other stuff = {LCD.blah},{TempSensor.blahblah} 



The breakpoint message about would result in 3 watched expressions
  • Joystick.x
  • LCD.blah
  • TempSensor.blahblah


And one debugger message

Quote:
The value of joystick x pos =456 and other stuff = 123,456


Or simply debug expressions without a message
Code
Select All
{Joystick.x}{LCD.blah}{TempSensor.blahblah} 



Hope this helps for now
« Last Edit: Sep 24th, 2012 at 10:26pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #22 - Sep 24th, 2012 at 10:01pm
Print Post  
Robero. 

Ignore my previous message I posted it before I saw your answer.

Yes we could add debug to some of the arduino core but probably should not. many things can't work until arduino is loaded such as hardwareSerial for debug Smiley

The location you picked for a test is certainly one location that will never work for debug. The debug can't be used before HardwareSerial is loaded  Cry
  
Back to top
WWW  
IP Logged
 
Roberto Imai
Junior Member
**
Offline


Posts: 22
Joined: Sep 9th, 2012
Re: Breakpoint Not Hit
Reply #23 - Sep 24th, 2012 at 10:11pm
Print Post  
Yes, I was able to get that part working by referencing global variables, but will there be a way to debug private variables or temporary variables?
For example, I have a for (int a;a<10;a++) inside one of my libraries and I wanted to debug inside this loop. I know I can't do it now, but is it a possibility in the future?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #24 - Sep 25th, 2012 at 2:36am
Print Post  
Yes certainly and it makes sense. I just wasn't sure of the audience when I did it originally so excluded the libraries but it seems okay to do this. 

I wouldn't want your fish to die if something does wrong so I try to be careful as possible.   

New users don't know what they are doing, some programs have timing critical functions and the debug certainly can slow things down if you put a break-point in a very fast loop. But I have to assume that people take responsibility for their own actions  Undecided

  
Back to top
WWW  
IP Logged
 
Bryan
Junior Member
**
Offline


Posts: 58
Location: Canada
Joined: Sep 8th, 2012
Re: Breakpoint Not Hit
Reply #25 - Sep 25th, 2012 at 6:30am
Print Post  
Roberto Imai wrote on Sep 24th, 2012 at 10:11pm:

For example, I have a for (int a;a<10;a++) inside one of my libraries and I wanted to debug inside this loop. I know I can't do it now, but is it a possibility in the future?


Would be the cat's meow if it could, as it's usually these type of scenarios that little bugs creep in and can be the hardest to debug. Smiley
« Last Edit: Sep 25th, 2012 at 6:50am by Bryan »  
Back to top
 
IP Logged
 
Bryan
Junior Member
**
Offline


Posts: 58
Location: Canada
Joined: Sep 8th, 2012
Re: Breakpoint Not Hit
Reply #26 - Sep 25th, 2012 at 6:37am
Print Post  
Tim@Visual Micro wrote on Sep 24th, 2012 at 9:57pm:


1) I notice you are trying to set a breakpoint on the call to initialise the wire i2c system. I know it is just an example for the picture because it isn't a useful breakpoint but have this information just in case.


Yes, i was just trying to set a breakpoint in a *.cpp class no particular interest in debugging at that particular breakpoint. Tried your suggestions of quoting global variables and it works, will be very helpful, Cheesy Cheesy

I too have found the "Find References" very useful, Roberto's project is very complex and with a click of the mouse I can find where the relevant code is. Smiley
  
Back to top
 
IP Logged
 
Bryan
Junior Member
**
Offline


Posts: 58
Location: Canada
Joined: Sep 8th, 2012
Re: Breakpoint Not Hit
Reply #27 - Sep 25th, 2012 at 6:39am
Print Post  
Tim@Visual Micro wrote on Sep 24th, 2012 at 9:57pm:
That is a neat system you guys are working with!


Can't take any credit for it, it is all Roberto's work.  Smiley 
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #28 - Sep 25th, 2012 at 5:01pm
Print Post  
Roberto. Wow your ReefAngel project looks like the neatest and most well structured Arduino project on the planet!
« Last Edit: Sep 25th, 2012 at 5:01pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Roberto Imai
Junior Member
**
Offline


Posts: 22
Joined: Sep 9th, 2012
Re: Breakpoint Not Hit
Reply #29 - Sep 25th, 2012 at 6:06pm
Print Post  
Smiley thanks
Fun too!!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #30 - Sep 25th, 2012 at 7:14pm
Print Post  
Yes it makes me want to get some fish. I have some Koi  but they are really boring.

I would end up killing them so best avoided.

I've been thinking about the debug in libraries. My concerns are probably better understood when considering the copter, plane and drone projects. I have been worried about new users thinking they can place breakpoints anywhere. 

However, having provided the capability to debug .ino and .cpp sketch files I don't think my concerns make sense. I think I am just a worrier  Cheesy
  
Back to top
WWW  
IP Logged
 
Roberto Imai
Junior Member
**
Offline


Posts: 22
Joined: Sep 9th, 2012
Re: Breakpoint Not Hit
Reply #31 - Sep 25th, 2012 at 7:50pm
Print Post  
You could make it as a setting in your general options.
Enable disable debug of libraries.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoint Not Hit
Reply #32 - Sep 25th, 2012 at 8:43pm
Print Post  
Yes that's a good idea. I think we also need a better disclaimer when the debugging is activated for the first time. Thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint