VS Arduino
Visual Micro >> Usb/Serial/WiFi Debugging >> Library debugging
https://www.visualmicro.com/forums/YaBB.pl?num=1590158035

Message started by Alexey V. Popov on May 22nd, 2020 at 2:33pm

Title: Library debugging
Post by Alexey V. Popov on May 22nd, 2020 at 2: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?

Title: Re: Library debugging
Post by Alexey V. Popov on May 24th, 2020 at 11:55am
Arduino Mega, USB UART connected to pins 14 and 15.

Visual Studio 2019

Title: Re: Library debugging
Post by Visual Micro on May 24th, 2020 at 1: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

Title: Re: Library debugging
Post by Alexey V. Popov on May 24th, 2020 at 2: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.

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=visual_micro_build_003.zip ( 5 KB | 2 Downloads )

Title: Re: Library debugging
Post by Alexey V. Popov on May 24th, 2020 at 2: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.

Title: Re: Library debugging
Post by Visual Micro on May 24th, 2020 at 2: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.


Title: Re: Library debugging
Post by Alexey V. Popov on May 24th, 2020 at 3:03pm

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?


Title: Re: Library debugging
Post by Visual Micro on May 24th, 2020 at 7:29pm
EDIT: The avr gdb stub doc is here https://www.visualmicro.com/page/AVR-Debugging.aspx

Title: Re: Library debugging
Post by Simon Hopkinson on May 26th, 2020 at 2: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.


VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.