Skip to content

Instantly share code, notes, and snippets.

@1ma
Last active October 16, 2023 07:09
Show Gist options
  • Save 1ma/8453a224ab3ba427ae746fd56a4893c4 to your computer and use it in GitHub Desktop.
Save 1ma/8453a224ab3ba427ae746fd56a4893c4 to your computer and use it in GitHub Desktop.
VSCode Ada Debugging
  1. Enable Allow breakpoints everywhere setting

  2. Install both the C/C++ and Language Support for Ada extensions from VSCode Marketplace.

  3. Add a .vscode/launch.json file to your project, adapting the "program" line as necessary:

{
   "version": "0.2.0",
   "configurations": [
      {
         "name": "(gdb) Launch",
         "type": "cppdbg",
         "request": "launch",
         "program": "${workspaceFolder}/bin/binary_name",
         "args": [],
         "stopAtEntry": false,
         "cwd": "${workspaceFolder}",
         "environment": [],
         "MIMode": "gdb",
         "setupCommands": [
            {
               "description": "Enable pretty-printing for gdb",
               "text": "-enable-pretty-printing",
               "ignoreFailures": true
            }
         ]
      }
   ]
}
  1. Build your binary with the -g -O0 flags using Alire, GPRBuild or whatever.

  2. Put a breakpoint anywhere on your entrypoint and press the green "Play" symbol from the Debugging tab.

  3. Profit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment