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 Unable to set breakpoints on Teensy 4.1 once app is running (Read 2247 times)
Steve Scholl
Junior Member
**
Offline


Posts: 16
Joined: Jan 29th, 2020
Unable to set breakpoints on Teensy 4.1 once app is running
Dec 20th, 2021 at 9:10pm
Print Post  
Hi, I've gone thru the setup for using gdb with a Teensy 4.1. I am able to set breakpoints before Start Debugging or when at a breakpoint that I set initially.
 
However, once the app is running my attempts to set a breakpoint fail. I get a red outline circle containing a yellow warning exclamation point in the left hand column, with the following mouse-over message

"The breakpoint will not be hit. Attempting to bind the breakpoint ..." followed by file and line number

I tried Break All in the hopes that would allow me to set additional breakpoints. Unfortunately that hard locks Visual Studio 2022 and have to kill it with Task Manager.

Any suggestions would be appreciated.

thanks,
steve
  

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


Posts: 2175
Joined: Feb 13th, 2019
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #1 - Dec 21st, 2021 at 11:02am
Print Post  
Thanks for the report.

Can you confirm you have the Board option for Optimize set to Debug?

Is this improved by changing the vMicro > Debug > Optimization set to "No Project + Libraries Optimization"?
  
Back to top
 
IP Logged
 
Steve Scholl
Junior Member
**
Offline


Posts: 16
Joined: Jan 29th, 2020
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #2 - Dec 21st, 2021 at 8:15pm
Print Post  
Confirmed Optimize:Debug. I attached a screen shot of those settings.

I get the same results with No Project + Libraries Optimization.
  

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


Posts: 2175
Joined: Feb 13th, 2019
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #3 - Dec 22nd, 2021 at 9:44am
Print Post  
Thanks for the update, and I may have misunderstood the initial report.

If you never land on any breakpoints set (before upload or after), this could be the Teensyduino version installed (1.55).

To our knowledge the debugging is only stable in v1.53 at present (which requires Arduino 1.8.13) (see this post).  This can be installed side by side with your current setup, and just the IDE Location changed, or a separate one setup (e.g. Arduino 1.6/1.8 alt).

This is easiest to spot with the simple Blink sketch, as the board never starts blinking when the code is uploaded with no breakpoints set.

Let me know if I have missed the point completely of course.......


  
Back to top
 
IP Logged
 
Steve Scholl
Junior Member
**
Offline


Posts: 16
Joined: Jan 29th, 2020
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #4 - Dec 23rd, 2021 at 6:01pm
Print Post  
I see that I failed to provide the key detail about landing on breakpoints in my initial post. I am able to land on breakpoints that I set before upload. I can also land on new breakpoints that I set while execution is stopped at an existing breakpoint. I am able to do the usual debugging suspects (e.g. single step, watch variables) when at a breakpoint. 

My problems occur only when the program is executing. I cannot set new breakpoints or use Break All to stop execution.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #5 - Jan 5th, 2022 at 3:31pm
Print Post  
Thanks for the clarification.

It seems you must be stopped on a breakpoint to add/remove any further breaks, or run any commands via GDB.  The only workaround would be to add a break e.g. at the top of loop, so you get a regular opportunity to change the breakpoints as needed.

Running in the Command window in VS, it replies stating the program must be stopped.
Code
Select All
>Debug.MIDebugExec b loop
Error: Commands are only accepted when the process is stopped. 



When running via the command line you always have to stop the program with CTRL+C before changing any breakpoint settings.

We will update if we have a solution to the "break all" issue in the future.
  
Back to top
 
IP Logged
 
Steve Scholl
Junior Member
**
Offline


Posts: 16
Joined: Jan 29th, 2020
Re: Unable to set breakpoints on Teensy 4.1 once app is running
Reply #6 - Jan 8th, 2022 at 5:55pm
Print Post  
Thanks for that key piece of information. I want more control than breaking at the top of the loop every time. I connected a button to the Teensy that triggers an otherwise unused code path with a breakpoint in it. This allows me to break into the debugger on demand.

I'm still running newer versions of Arduino and Teensyduino than the know stable you mentioned previously.  With the newer versions I'm noticing a couple of things.

The sample code includes this line:
 
Code (C++)
Select All
while (!SerialUSB1) {}    // Wait for Debugger connect  



Most of the time SerialUSB1 never becomes true. If I comment out the while loop and use the local board.txt from your setup instructions that delays the debugger attach, gdb connects reliably.

The other thing I'm noticing is that single stepping is flaky. Sometimes it works. Sometimes execution continues without stopping on the next line. Sometimes gdb exits. 

I've added experimenting with the know stable versions to my todo list.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint