Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Library debugging (Read 562 times)
Alexey V. Popov
Junior Member
**
Offline



Posts: 25
Library debugging
May 22nd, 2020 at 3:33pm
 
It seems to me that I saw somewhere before tooltips how to debug a library through Shared Projects. Unfortunately, I can`t find it now.

I moved my libraries in two shared projects in the same solution with main project. Breakpoints in main uno file work fine, but breakpoints in shared project do nothing.

So, is it posssible to debug libraries in such simple way and how?
Back to top
 
 
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline



Posts: 25
Re: Library debugging
Reply #1 - May 24th, 2020 at 12:55pm
 
Arduino Mega, USB UART connected to pins 14 and 15.

Visual Studio 2019
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10895
United Kingdom
Re: Library debugging
Reply #2 - May 24th, 2020 at 2:24pm
 
There is a fix for the SoftwareSerial debugging here:-

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Request

When you post problems please attach the information shown in the yellow box above. This avoids lots of questions and would have shown that you were using SoftwareSerial debu on Tx/Tx Pins
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline



Posts: 25
Re: Library debugging
Reply #3 - May 24th, 2020 at 3:15pm
 
If I use Hardware serial and put a breakpoints in uno-file everything is OK.

If I add breakpoints in Shared project, at least one,  with simpleĀ  message and no stop scetch does not start properly. In output I have the messages:
Launching Debugger...
Program Running 'Mounter'
Mounter Started!
User Experience: The serial debugger was delayed waiting for an incoming line of data. If the Serial.print() command is used between breakpoints, then ensure that a line termnator is sent using .println() or .print("\r\n"). Optionally, use #if defined(VM_DEBUG) to add code that is only active when debugging. (if this is expected then switch this user experience message off in tools>options>visual micro>micro debug)

Build log is attached.
Back to top
« Last Edit: May 24th, 2020 at 3:16pm by Alexey V. Popov »  

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline



Posts: 25
Re: Library debugging
Reply #4 - May 24th, 2020 at 3:23pm
 
As I see on LEDs and display, scketch hangs up in setup() function on the call to library in Shared Project where I have breakpoint.
If I remove breakpoint in Shared Project - everything is OK again.
Back to top
« Last Edit: May 24th, 2020 at 3:24pm by Alexey V. Popov »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10895
United Kingdom
Re: Library debugging
Reply #5 - May 24th, 2020 at 3:52pm
 
okay we will test shared lib debugging with the usb debugger during the week.

GDB Stub is an alternive to try and maybe better for libs anyway.

Back to top
« Last Edit: May 25th, 2020 at 8:24pm by Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline



Posts: 25
Re: Library debugging
Reply #6 - May 24th, 2020 at 4:03pm
 
Visual Micro wrote on May 24th, 2020 at 3:52pm:
okay we will test shared lib debugging with the usb debugger during the week.

Thank you!

Quote:
GDB Stub is an alternive to try and maybe better for libs anyway.

Is there some documetation how to switch to GDB?

Back to top
« Last Edit: May 25th, 2020 at 8:21pm by Visual Micro »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10895
United Kingdom
Re: Library debugging
Reply #7 - May 24th, 2020 at 8:29pm
 
EDIT: The avr gdb stub doc is here https://www.visualmicro.com/page/AVR-Debugging.aspx
Back to top
« Last Edit: May 25th, 2020 at 8:25pm by Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 524
Re: Library debugging
Reply #8 - May 26th, 2020 at 3:39pm
 
We can confirm that using the Mega 2560 / Uno with the Documented GDB Stub, and Shared Projects, will allow the Shared Project Code to be debugged using GDB.

To ensure this works, also check that the Optimization is set to "No Project Optimization", as well as ensuring all GDBStub pre-requisites (header, setup() etc..) are all included in your sketch project.

A Screenshot of this in action is below, and let us know if any further information is required.

...
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print