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
Hot Topic (More than 8 Replies) Breakpoint data not displaying (Read 23658 times)
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Breakpoint data not displaying
Dec 31st, 2013 at 6:48pm
Print Post  
Well - got past my last big coding bumble...  Now with program basically in shape, I can't seem to get any breakpoints to show data!   I use both messages and hit-counts, and now nothing seems to be showing in any windows.

I can see the TX LED blinking on the Uno at a rate that I think means the break data is being sent - but I see nothing.

I pulled UNO from USB, restarted computer, and one break hit and displayed - after that nothing again.   It would appear I have my VS/VM setup hosed in some way to cause the I/O to not work.  Per my last go-around a few days ago, I do have LocalPort, RemotePort and related entry's blank.

Any ideas how I may be messing up the serial data? I am NOT using any serial IO in the app.

=Alan R.    Undecided
  
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 #1 - Dec 31st, 2013 at 7:39pm
Print Post  
Is your breakpoint in a condition or has a condition been applied? If not and it is in the loop() or fast running function then the serial buffer on the arduino might be overloaded.

If you close the ide then re-open it. Do not open the sketch project but instead open the serial monitor. You should see the debugger messages. Please post a couple of them.

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


Posts: 33
Joined: Dec 8th, 2013
Re: Breakpoint data not displaying
Reply #2 - Dec 31st, 2013 at 10:37pm
Print Post  
Hi Alan,

       If you post you code or the part you are having trouble with I would be more then happy to try it. 

  
Back to top
 
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #3 - Jan 1st, 2014 at 5:56pm
Print Post  
Tim, Charlie - I understand how conditions can cause a breakpoint to not hit.  I created a simple test program that had a INT in setup and the int++ was done in the LOOP with a delay then incremented again.  Insanely simple - break never was hit - and as I say - I can see the TX light blinking (prob sending the break data message - but nothing is displayed.

I have started using Arduino 1.5.5 - can't imagine that has anything to do with it...   it is just that the most simple breakpoint or hitcount won't show a thing!    Cheesy

Wondering if the serial ports have gotten hosed or something...
=A.
  
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 #4 - Jan 1st, 2014 at 6:39pm
Print Post  
Hi,

Yes nothing to do with the Arduino version. Please answer previous question thanks. 

Quote:
If you close the ide then re-open it. Do not open the sketch project but instead open the serial monitor. You should see the debugger messages. Please post a couple of them.

Thanks
« Last Edit: Jan 1st, 2014 at 6:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #5 - Jan 2nd, 2014 at 3:24am
Print Post  
Ok - think now I've done those steps.  The Project compiles and runs - but all logic isn't working yet - hence the need for debug. Smiley  Meaning to say I don't think there are currently any serious coding errors in it that would cause the serial port to not respond - or other bizarrness.

I've set ONE break point in SETUP where a call is made to run a flashing-8's routine.  Very simple - only executed once per run of the Project (it has 6 .ino sketches).  And the breakpoint message does not show.

I closed the Project, left VS running and Serial monitor open. Reset the Arduino to have it run thru SETUP again -   All that shows in the Serial Monitor is "Port Open" - no debug message, no debug windows show as it usually does.

Here is the SETUP code where the break won't hit:

Code
Select All
#include <Arduino.h>

#include <MenuMgr.h>
#include <I2C.h>
#include <RESRotEncLib.h>
#include <Bounce.h>
#include <BEDstep.h>
#include "MicroIndexer.h"  // All defs for this project in this file

// Instantiate a seven-seg Display Object
I2C TheDisplay;

// Instantiate Motor Object
BEDstep TheMotor = BEDstep(STEP_PIN,DIR_PIN);

// Instantiate each Menu Object
MenuMgr Count_menu;
MenuMgr Deg_menu;
MenuMgr Speed_menu;
MenuMgr Clear_menu;
MenuMgr MicStp_menu;		// micro step menu item

MenuMgr CurrentMenu[4];		// Array of menu items orded by MENU_xxxx

void setup() {
	// System Setup Set up I/O pins, init various items
	initMenus();
	initSwitchs();		// setup switches as inputs
	//mpin_init();		// set up motor pins
	SevenSeg_init();	// init display, start oscillator
	flash_8s();			// Show the display is alive
} 


« Last Edit: Jan 2nd, 2014 at 3:26am by Harrzack »  
Back to top
 
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #6 - Jan 2nd, 2014 at 4:02am
Print Post  
More info - using a VERY short test program, Iv'e gotten some text out of the Serial Monitor:

Code
Select All
Port open
VMDPV_1|_VMDPV
VMDPE_3_VMDPE
VMDPE_2|153_VMDPE
VMDPE_3_VMDPE
VMDPE_2|7503_VMDPE
VMDPE_3_VMDPE
VMDPE_2|-18213_VMDPE
VMDPE_3_VMDPE
VMDPE_2|6707_VMDPE
VMDPE_3_VMDPE
VMDPE_2|7523_VMDPE
VMDPE_3_VMDPE
VMDPE_2|-17213_VMDPE
VMDPE_3_VMDPE
VMDPE_2|-8829_VMDPE 



And here is the program:
Code
Select All
int x,y;

void setup(){
	x= 3;
}

void loop() {
	x *=50;
	delay(1000);
	y=x+3;
} 



I've tried with one break on "y=x+3" to print y,
and then with a second hit-counter on "loop".  No debug text shows, but the above data did show on the COM12 port.

=Alan R.      Shocked
  
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 #7 - Jan 2nd, 2014 at 11:31am
Print Post  
Hi, thanks for the serial output. It shows there are 3 breakpoints working fine. That one breakpoint is passing back watch expression data. No breakpoints cause a break, the arduino is in "Trace" mode.

So the debugger should be displaying the correct trace and watch data. Cab you post an image of the Ide when debug is running (or supposed to be running). I would like to see the micro trace output window and the serial window settings while debug is supposed o be active.

Thanks very much for all the info
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #8 - Jan 2nd, 2014 at 2:00pm
Print Post  
Tim - would love to post screen shots, but don't see any forum options to "include file" or how to put an image in a reply.

In the short test program I got the Expressions window to show and saw data.  When I try in my Project app - it seems that if I set a break in the loop, the Expressions window opens, but the Debugger is blocking calls - the app only partially works!  I'm reading some buttons and a mechanical rotary encoder. The RE is turned to select MENU led's and display the contents of an integer ('register') in a 7-seg display.  The 7-seg and led's are being run via the I2C bus, and I'm connecting to I2C via the Uno alternate pins, 27&28.

I have screenshots and will try and figure out how to get them up...

=A.

  
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 #9 - Jan 2nd, 2014 at 2:07pm
Print Post  
Please email images to info [at] visualmicro.com thanks. Also please email copy of your sketch folder if possible so I can see code and your settings.

Please switch project property "enable break/pause" to False while you test this. Then we don;t have to wonder if the system has paused at breakpoint waiting for F7 or F5 etc.

Thanks
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #10 - Jan 2nd, 2014 at 2:26pm
Print Post  
Will get an email off to you shortly - with code and pix!

tks

=A.
  
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 #11 - Jan 2nd, 2014 at 2:50pm
Print Post  
Thanks for the email. According to the config only one breakpoint was included in the last upload to the Arduino

An extract shown below (let me know if you want it removed) shows there is a breakpoint in the            case MENU_COUNT: statement. 

The code on the Arduino appears to be a different config that was shown by your previous serial output and also different to the current source code. Can you please confirm which code and breakpoints have been uploaded. I also suggest adding a breakpoint on void Motor_Step() { so that you can watch MenuIndex and see what value it contains.

One other point is that the comment in the code suggests the breakpoint is in code that is called for each loop(). This can flood the arduino serial, I suggest using the breakpoint condition to check to see if something of interested has happened or for exception reporting. This will reduce the serial output dramatically.

Thanks

Code
Select All
 <BreakPoints>
      <BreakPoint Index="1" Name="MotorHandler.ino, line 14" Id="06f3a86b-ae00-410d-93d6-44d4bbbc2c87" Enabled="1" Message="ROTATE!" MessageTextType="0" PreProcessedMessage="ROTATE!" Condition="" ConditionType="1" CurrentHits="0" File="h:\ard\sketches\microindexer\motorhandler.ino" FileLine="14" FileColumn="1" FunctionName="Motor_Step()" FunctionLineOffset="4" FunctionColumnOffset="1" HitCountTarget="1" HitCountType="1" Language="C++" LocationType="3" Tag="&lt;vmbp Id='cb019047-c11e-4be5-8957-a3c6ab99e32e'/&gt;" Type="1" ToString="System.__ComObject" BreakWhenHit="0">
        <Source>7
8	//Called from LOOP when System is IDLE to check for RUN or JOG button press
9	// RUN/JOG switches set a MOTOR_STATE which allows 1 run cycle.
10
11	void Motor_Step() {
12		switch(MenuIndex) {
13		case MENU_COUNT:
>>BREAKPOINT ON THIS LINE>>			rate = .7;
15			stepct = long(CurrentMenu[MenuIndex].get_display());
16			TheMotor.rotate(stepct,rate);
17			MotorState = MOTOR_IDLE;		// Stepping done - set motor idle
18		break;
19		case MENU_ANGLE:
20			// set by degrees
21		break;
22		}
23	}
</Source>
      </BreakPoint>
    </BreakPoints> 

« Last Edit: Jan 2nd, 2014 at 3:22pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #12 - Jan 6th, 2014 at 4:42pm
Print Post  
I'm not clear as to what happened, overall. I was NOT getting even a single breakpoint to display - but did see the UNO TX light flashing - so I knew it was prob working.

With the sketch freshly uploaded, and VS running, and the Expressions window open, but no break-data, I clicked the tiny "Show Serial Monitor" icon (as you prev mentioned), and the "Expressions on COM12" window redrew - and break data began appearing.   Cheesy

Dunno how it got 'broke' but this brings it back - and <moi> is a happy camper again!

=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 #13 - Jan 6th, 2014 at 4:47pm
Print Post  
Well done. The upload will certainly of helped to ensure we have the same code running as on the mcu. That then sounded like a timing issue where the serial connection had not started properly. Clicking the show serial monitor icon does re-start the serial.

For the next release due shortly we are working on the serial connection which now also supports network and will ensure this area is looked at more closely.

Thanks for the update
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #14 - Jan 8th, 2014 at 12:09pm
Print Post  
Every silver lining has it's cloud!    Sad
After a couple days working on my proj, I have to say the debugger is NOT working to specs!  I'm only ever using one breakpoint, and they rarely hit.  If I use the click-serial-monitor' button - sometimes I see data, but mostly not. For all intent purposes, I have no debugger...  Bummer.  Anxiously awaiting the next update.
=A.
  
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 #15 - Jan 8th, 2014 at 4:06pm
Print Post  
Hi,

I am sorry you have having a problem. You are the only person reporting this problem so we have to consider your config and code to allow us to replicate or understand what is going wrong. This is not to suggest you are doing anything wrong but to allow us to discover where the confusion is and to improve the wiki with a solution.

We can easily see what is happening in the code. Switch on "tools>options>visual micro>compile>always show builder folder" then compile and upload a debug version. The Micro Build output will show you the build location. Open the location, zip it and email to info [at] visualmicro.com. Thanks!

This problem will be related to serial or a breakpoint conditional logic. Please keep in mind that there is nothing magical about the debugger, it just adds serial messages to a temp copy of the code prior to upload. This means that we use well proven Arduino code (Serial) and its easy to see what the code is doing and why.

Thanks
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #16 - Jan 8th, 2014 at 4:23pm
Print Post  
Ok Tim - BLD folder is on the way!  Anxious to see where I may have stepped on my weenie!   Cheesy

=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 #17 - Jan 8th, 2014 at 4:32pm
Print Post  
Hi Alan,

Got the file but can't find any breakpoints in the code. 

Where do you see your breakpoint in normal code view? In which source code file and at what line number?

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 #18 - Jan 8th, 2014 at 4:51pm
Print Post  
ps: Without a breakpioint you should only see one debugger trace message when the Arduino starts. After that nothing. The debugger always inserts a startup notification in the setup() and I can see that in your code. However there are no breakpoints in the loop() or any related code files.
  
Back to top
IP Logged
 
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
Re: Breakpoint data not displaying
Reply #19 - Jan 8th, 2014 at 5:36pm
Print Post  
Sorry - didn't realize you wanted me to add a BKP.  Put one at line 66 in MicroIndexer.uno - that is the "main" file.   

I just tried it and got nothing.  The program is running well now, just need breakpoints to check various values for the stepper delays and such...

Not getting email notifications of your replies - and I do have the check-box selected...
  
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 #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] 
Send TopicPrint