Executing Custom GDB Commands in Visual Micro

Once you are up and running with Hardware Debugging / GDB Stub on your project, you may find there are commands available which aren't visible in the IDE, or you may be more used to the GDB command set.

Following the process below we will be able to execute custom GDB Commands whilst debugging in the IDE, to add extra features such as the digitalWrite() feature of the Teensy GDBStub as shown below.


  1. Simply attach your debugging session as normal in Visual Micro.
  2. Navigate to the VS Command Window, either from View > Other Windows > Command Window, or using the Shortcut [Ctrl+Alt+A].
  3. Enter your GDB Command with "Debug.MIDebugExec " prefixed (keep the space as its a command of its own, your commands are the parameters)
    e.g. to run monitor digitalWrite(13,0), you would type Debug.MIDebugExec monitor digitalWrite(13,0)
  4. Press Enter to Execute the command via GDB
Executing Custom GDB Commands while Debugging in Visual Micro