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 Automatic Debugging puts debug code outside of functions - 1.1603.20 (Read 3822 times)
Chris Crowe
Newbies
*
Offline


Posts: 7
Joined: Aug 4th, 2012
Automatic Debugging puts debug code outside of functions - 1.1603.20
Mar 21st, 2016 at 10:50pm
Print Post  
I have a project and I just reloaded it after a year or so and I am using the version 1.1603.20 of Visual Micro.


In one of my files I have this code (from the top of the file)

Code (C++)
Select All
#include "RelayController.h"
#include <Arduino.h>

RelayController::RelayController()
{
	const int RelayPins[] = { 8, 9,-1, -1 };

	for (int i = 0; i < 4; i++)
		if (RelayPins[i] > 0)
			pinMode(RelayPins[i], OUTPUT);
	TurnOffAllRelays();
}


RelayController::~RelayController()
{
}

void RelayController::TurnOnRelay(int RelayID)// 0 - 3
 



When I turn on Automatic debugging and compile the code the file that is created has some invalid code inserted.

_atmega2560\RelayController.cpp

Code (C++)
Select All
#include "RelayController.h"
#include <Arduino.h>


#include <VM_DBG/VM_DBG.h>

RelayController::RelayController()
{
const int RelayPins[] = { 8, 9,-1, -1 };

for (int i = 0; i < 4; i++)
if (RelayPins[i] > 0)
pinMode(RelayPins[i], OUTPUT);
TurnOffAllRelays();
}


RelayController::~RelayController()
{
}

ansport->print("_VMDPE\r\n");delay(2);delay(10);MicroDebug.breakWait(1);

void RelayController::TurnOnRelay(int RelayID)
{
if (RelayPins[RelayID] > 0)
{
digitalWrite(RelayPins[RelayID], 255);
}
}
 



As you can see the inserted code is written in the middle of 2 functions. 

Chris

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Automatic Debugging puts debug code outside of functions - 1.1603.20
Reply #1 - Mar 21st, 2016 at 11:11pm
Print Post  
Where did you place the breakpoint?
  
Back to top
IP Logged
 
Chris Crowe
Newbies
*
Offline


Posts: 7
Joined: Aug 4th, 2012
Re: Automatic Debugging puts debug code outside of functions - 1.1603.20
Reply #2 - Mar 22nd, 2016 at 3:07am
Print Post  
Tim@Visual Micro wrote on Mar 21st, 2016 at 11:11pm:
Where did you place the breakpoint?


As I said it has been a year since looking at this project and there was some breakpoints listed in the Breakpoints Window (Ctrl+D,B)

But they were not showing in the side bar.

I deleted them and the issue is resolved.

Sorry to bother you...

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Automatic Debugging puts debug code outside of functions - 1.1603.20
Reply #3 - Mar 22nd, 2016 at 11:55am
Print Post  
Visual studio stores breakpoints in the solution so I guess it is possible the ones you could see related to a different project/code.

Thanks for the update.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint