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 debugging (Read 2743 times)
Alexey V. Popov
Junior Member
**
Offline


Posts: 25
Joined: Jan 6th, 2016
Library debugging
May 22nd, 2020 at 2:33pm
Print Post  
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
Joined: Jan 6th, 2016
Re: Library debugging
Reply #1 - May 24th, 2020 at 11:55am
Print Post  
Arduino Mega, USB UART connected to pins 14 and 15. 

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library debugging
Reply #2 - May 24th, 2020 at 1:24pm
Print Post  
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
WWW  
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline


Posts: 25
Joined: Jan 6th, 2016
Re: Library debugging
Reply #3 - May 24th, 2020 at 2:15pm
Print Post  
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. 
« Last Edit: May 24th, 2020 at 2:16pm by Alexey V. Popov »  

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


Posts: 25
Joined: Jan 6th, 2016
Re: Library debugging
Reply #4 - May 24th, 2020 at 2:23pm
Print Post  
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.
« Last Edit: May 24th, 2020 at 2:24pm by Alexey V. Popov »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library debugging
Reply #5 - May 24th, 2020 at 2:52pm
Print Post  
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.

« Last Edit: May 25th, 2020 at 7:24pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Alexey V. Popov
Junior Member
**
Offline


Posts: 25
Joined: Jan 6th, 2016
Re: Library debugging
Reply #6 - May 24th, 2020 at 3:03pm
Print Post  
Tim@Visual Micro wrote on May 24th, 2020 at 2: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? 

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library debugging
Reply #7 - May 24th, 2020 at 7:29pm
Print Post  
EDIT: The avr gdb stub doc is here https://www.visualmicro.com/page/AVR-Debugging.aspx
« Last Edit: May 25th, 2020 at 7:25pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2127
Joined: Feb 13th, 2019
Re: Library debugging
Reply #8 - May 26th, 2020 at 2:39pm
Print Post  
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 TopicPrint