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 How can I debug arduino libraries (Read 1434 times)
M@rcel
Junior Member
**
Offline


Posts: 12
Joined: Oct 31st, 2020
How can I debug arduino libraries
Nov 8th, 2020 at 9:28pm
Print Post  
Hello,

I am using GDB on ESP32 and I would like to set a breakpoint in an arduino library to be able to use the stack trace to find the location in my application where the library-function is called. 
How can I do this? 
The library sourcefile is WiFiClient.cpp in the arduino/esp32 directory structure ( ies\WiFi\src\" ).
« Last Edit: Nov 8th, 2020 at 9:29pm by M@rcel »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Online


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I debug arduino libraries
Reply #1 - Nov 8th, 2020 at 9:41pm
Print Post  
I think the question is "how to see the library sources in the solution explorer so that you can set break points"?

When a project is open and active, there are three ways:-

1) Click "vMicro>Show Hidden Files". That "toggles" the core and library sources in/out of the project. 

or

2) Switch on "vMicro>Add Library>Create Shared Project When Including Libraries", then re-add the libraries to the project. If the library headers are already #included in the .ino code then only the shared project will be created, it doesn't cause a library to be added twice. The "Add Library" menu also has options to clone/copy the library to the local project/solution. That can work better if your libraries are in a location where you do not have permissions to create files. The permissions issue normally only applies to VS when not in Admin mode and when a library is located under "program files/arduino ide"


2) is recommended unless you often switch board architecture for the same project, then 1) is recommended.

Does this help?


  
Back to top
IP Logged
 
M@rcel
Junior Member
**
Offline


Posts: 12
Joined: Oct 31st, 2020
Re: How can I debug arduino libraries
Reply #2 - Nov 8th, 2020 at 10:15pm
Print Post  
I have chosen to copy the libraries to the project directory because this makes the project (more) self-contained and no longer dependant on (bugs in) library-updates in the standard locations.

After that "vmicro/show hidden files" did the trick. I did totally overlook this option.

Thanks!
« Last Edit: Nov 8th, 2020 at 10:21pm by M@rcel »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Online


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I debug arduino libraries
Reply #3 - Nov 8th, 2020 at 10:16pm
Print Post  
Great thanks for the update
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint