File tree Expand file tree Collapse file tree 5 files changed +66
-41
lines changed Expand file tree Collapse file tree 5 files changed +66
-41
lines changed Original file line number Diff line number Diff line change 33 "version" : " 0.2.0" ,
44 "configurations" : [
55 {
6- "name" : " (gdb) Build & debug" ,
76 "preLaunchTask" : " build" ,
8- "type" : " gdb" ,
7+ "name" : " Ada - Build & Debug (unix)" ,
8+ "type" : " cppdbg" ,
99 "request" : " launch" ,
10- "cwd" : " ${workspaceFolder}" ,
11- "valuesFormatting" : " parseText" ,
12- "windows" : {
13- "target" : " ${workspaceRoot}/obj/hello.exe" ,
14- "MIMode" : " gdb" ,
15- "miDebuggerPath" : " C:/GNAT/bin/gdb.exe" // Path to gdb on windows
16- },
17- "linux" : {
18- "target" : " ${workspaceRoot}/obj/hello" ,
19- "MIMode" : " gdb"
20- },
21- "osx" : {
22- "target" : " ${workspaceRoot}/obj/hello" ,
23- "MIMode" : " lldb"
24- }
10+ "program" : " ${workspaceFolder}/obj/hello" ,
11+ "cwd" : " ${workspaceFolder}"
2512 },
13+ {
14+ "preLaunchTask" : " build" ,
15+ "name" : " Ada - Build & Debug (Windows)" ,
16+ "type" : " cppvsdbg" ,
17+ "request" : " launch" ,
18+ "program" : " ${workspaceFolder}/obj/hello.exe" ,
19+ "externalConsole" : true ,
20+ "cwd" : " ${workspaceFolder}"
21+ }
2622 ]
27- }
23+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33 "version" : " 0.2.0" ,
44 "configurations" : [
55 {
6- "name" : " (gdb) Build & debug" ,
76 "preLaunchTask" : " build" ,
8- "type" : " gdb" ,
7+ "name" : " Ada - Build & Debug (unix)" ,
8+ "type" : " cppdbg" ,
99 "request" : " launch" ,
10- "cwd" : " ${workspaceFolder}" ,
11- "valuesFormatting" : " parseText" ,
12- "windows" : {
13- "target" : " ${workspaceRoot}/obj/hello.exe" ,
14- "MIMode" : " gdb" ,
15- "miDebuggerPath" : " C:/GNAT/bin/gdb.exe" // Path to gdb on windows
16- },
17- "linux" : {
18- "target" : " ${workspaceRoot}/obj/hello" ,
19- "MIMode" : " gdb"
20- },
21- "osx" : {
22- "target" : " ${workspaceRoot}/obj/hello" ,
23- "MIMode" : " lldb"
24- }
10+ "program" : " ${workspaceFolder}/obj/hello" ,
11+ "cwd" : " ${workspaceFolder}"
2512 },
13+ {
14+ "preLaunchTask" : " build" ,
15+ "name" : " Ada - Build & Debug (Windows)" ,
16+ "type" : " cppvsdbg" ,
17+ "request" : " launch" ,
18+ "program" : " ${workspaceFolder}/obj/hello.exe" ,
19+ "externalConsole" : true ,
20+ "cwd" : " ${workspaceFolder}"
21+ }
2622 ]
2723}
Original file line number Diff line number Diff line change @@ -11,4 +11,40 @@ Use embedded terminal to launch your executable.
1111
1212## 🐞 Debug
1313
14- Install Native Debug and configure ` launch.json ` to run the debugger.
14+ The [ ms-vscode.cpptools] ( https://github.com/microsoft/vscode-cpptools ) extension
15+ is automatically installed along with this extension, allowing to use its
16+ integration for GDB to debug Ada code.
17+
18+ You will just need to add a proper debug configuration in your ` launch.json `
19+ file. Let's consider a basic ` .gpr ` project, which produces a
20+ ` main ` executable in an ` obj ` directory:
21+
22+ ```
23+ project Default is
24+
25+ for Main use ("main.adb");
26+ for Object_Dir use "obj";
27+
28+ end Default;
29+
30+ ```
31+
32+ A basic ` launch.json ` file which allows to debug the produced ` main `
33+ executable would be:
34+
35+ ```
36+ {
37+ "name": "Ada Debugging",
38+ "type": "cppdbg",
39+ "request": "launch",
40+ "program": "${workspaceFolder}/obj/main",
41+ "cwd": "${workspaceFolder}"
42+ }
43+
44+ ```
45+
46+ You will then be able to go to the ` Run and Debug ` VS Code panel
47+ in order to run the newly added debugger.
48+
49+ You can find more information about how to configure the debugger
50+ [ here] ( https://code.visualstudio.com/docs/cpp/launch-json-reference ) .
Original file line number Diff line number Diff line change 66 "publisher" : " AdaCore" ,
77 "license" : " GPL-3.0" ,
88 "engines" : {
9- "vscode" : " ^1.64.2 "
9+ "vscode" : " ^1.67.0 "
1010 },
1111 "categories" : [
1212 " Programming Languages" ,
1313 " Extension Packs"
1414 ],
1515 "extensionPack" : [
16- " webfreak.debug "
16+ " ms-vscode.cpptools "
1717 ],
1818 "activationEvents" : [
1919 " onLanguage:ada" ,
You can’t perform that action at this time.
0 commit comments