I activated the "Debug support" window at the visual teensy and generated a new project,
But when activating "Start Debugging" using F5, it advised that is needed the Cortex-Debug
I found it here: https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug and installed it
Then made again Start Debug but appeared a new error: "Failed to launch undefined GDB server and advised to add it to the launch.json
You would need a debug probe like a JLink and the corresponding GDB server to make this work. Plus you need to modify the hardware of your Teensy to be able to connect this probe. You find some information and a link describing the required hardware changes here: https://github.com/luni64/VisualTeensy/releases/tag/v0.9.7.0.
It worked with both, PIO and VisualTeensy. I.e., you can step through code, look at the processor/peripheral registers, set breakpoints etc. However, I had the impression that I spent more time fighting against glitches in the debugger than doing actual debugging. At the end, I decided that, for me, it is not worth the hassle. Here a quick video showing how it behaves.
There is also a forum post showing how to use a flex PCB to offload the T4 bootloader chip on a flex PCB to be able to connect a debug probe. Looked professional but I don't know if it worked at the end of the day.