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) Library Breakpoints (Read 9525 times)
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Library Breakpoints
Mar 21st, 2016 at 1:00pm
Print Post  
Have a sketch in 1.5.8 which uses two external libraries and builds OK.

I imported this to VS2015 and the libraries via VisualMicro.AddLibrary.User. This also build OK  for a standard non-GDB project for Arduino Due.

I need to put breakpoints in the library. Link http://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging.html has "... If you want to set breakpoints in library source files, add these files to you project as normal source files, instead of adding the library. ...". However if I add the .cpp or .h files via SolutionExplorer to the project it generates multiple "first defined here" errors. VisualMicro.AddCode does not appear to have an option to add an existing .cpp and .h file.


So I thought to uninstall these libraries then repeat step above. However, VisualMicroExplorer.ManageLibraries has "This library version was installed manually and can not be removed using this tool."

It appears that to stop VM using a library which is installed in Arduino.cc IDE 1.5.8 the library has to be deleted which will break builds in 1.5.8.

How is a library to be installed in VM so that breakpoints can be set in the code?

Link http://www.visualmicro.com/forums/YaBB.pl?num=1457444130/6#6 gives some instructions but I cannot locate the corrsponding menu options.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #1 - Mar 21st, 2016 at 1:05pm
Print Post  
Hi,

If you right click the project name in the solution explorer and then click "add>new arduino library" this will show you a special location where you can put local sketch libraries. Libraries in the location are included and work the same as a normal arduino library but can also be debugged. 

You can also place a copy of an installed library in the same location and visual micro will detect and use the local version.

Normal user libraries are installed into documents\arduino\libraries and built-in are below the arduino ide. You can delete user libraries which is what an uninstall would do but with the system described above you shouldn't need to bother deleting.

You should use the little icon above the solution explorer "show all files" to more easily see the physical folder/file structure on disk.
« Last Edit: Mar 21st, 2016 at 1:06pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: Library Breakpoints
Reply #2 - Mar 21st, 2016 at 1:57pm
Print Post  
Thanks.

These steps create new empty .cpp & .h files - so I copied the code from the pre-existing .h & .cpp files.

This generates multiple "first defined here" errors - presumably because the libraries with the same code are in the project? Renaming the directories containing the pre-existing libraries does not help, VM seems to pick up whatever is within the Arduino directory. By deleting the libraries from the Arduino directory and rescanning the newly created source files become inputs to the project and build OK. However, the Arduino.cc 1.5.8 installation is now broken.

I note that the first line of output is "Compiling debug version of 'PacketSerialSimplePWM' for 'Arduino Yún'" even though Arduino Due (Programming Port) is selcted in VM IDE.  However on the successful builds Output correctly lists 'Arduino Due (Programming Port)'.
« Last Edit: Mar 21st, 2016 at 2:47pm by RBB01 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #3 - Mar 21st, 2016 at 3:02pm
Print Post  
There is no need to change any ide or library 1.5.8 files/structure.

Please follow my guide to create a new local library and to click the "show all files" icon I explained about previously.

Then attach a screen shot of the ide with the project open and solution explorer expanded so I can see you have done this OK.

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


Posts: 24
Joined: Mar 3rd, 2016
Re: Library Breakpoints
Reply #4 - Mar 21st, 2016 at 3:25pm
Print Post  
Attached.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #5 - Mar 21st, 2016 at 4:01pm
Print Post  
Thanks. The picture does not show the solution explorer in "showing all files" mode
  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: Library Breakpoints
Reply #6 - Mar 21st, 2016 at 4:17pm
Print Post  
This is "show all files " clicked again but it shows less.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #7 - Mar 21st, 2016 at 4:21pm
Print Post  
That's great and it is the right view for you.

You can collpase the _vm folder it is not relevant

Now expand the \src folder so that we can see all sub folders and files

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


Posts: 24
Joined: Mar 3rd, 2016
Re: Library Breakpoints
Reply #8 - Mar 21st, 2016 at 4:33pm
Print Post  
Attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #9 - Mar 21st, 2016 at 4:42pm
Print Post  
Great.

Have you got pragma once in the .h files or an #if statement that ensures the .h is only compiled once?

If unsure then please zip your project and sub folders and either attach or email

It will also be useful to see a verbose compile output which is enabled using "visual micro>verbose"

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


Posts: 24
Joined: Mar 3rd, 2016
Re: Library Breakpoints
Reply #10 - Mar 21st, 2016 at 5:00pm
Print Post  
Following the procedure of my original post, with subsequent amendments, the project builds, uploads and enters debug successfully, so I will continue with this for now. When I create a new project using these libraries I will follow your procedure outlined above, and see if it builds OK.

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library Breakpoints
Reply #11 - Mar 21st, 2016 at 5:07pm
Print Post  
Okay I will retest thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint