Skip to content

Commit edeb2cf

Browse files
RIC-825: Art debugger documentation
1 parent 91cd7fe commit edeb2cf

15 files changed

Lines changed: 179 additions & 12 deletions

docs-sources/building/launch-configurations.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A more flexible way to launch an executable is to use a **launch configuration**
1010
* You can easily manage multiple ways of launching the same application. Just create a launch configuration for each way of launching it.
1111
* The output from the launched application is printed in the Debug Console rather than the Terminal view. The Debug Console colorizes printed output from the application (<span style="color: red;">red</span> for text printed to stderr and <span style="color: orange;">orange</span> for text printed to stdout).
1212
* You can terminate and relaunch the application using a toolbar instead of using the Terminal view.
13+
* With few or no changes a launch configuration can also be used for [debugging the application with the Art Debugger](../debugging/index.md).
1314

1415
## Creating a Launch Configuration
1516
To create a launch configuration open the "Run and Debug" view from the activity bar and then click the **create a launch.json file** hyperlink.
@@ -28,7 +29,7 @@ The created launch configuration looks like this:
2829
{
2930
"type": "art",
3031
"request": "launch",
31-
"name": "runTC",
32+
"name": "launchTC",
3233
"tc": "${workspaceFolder}/${command:AskForTC}"
3334
}
3435
```
@@ -39,14 +40,14 @@ You can have multiple launch configurations in the same `launch.json` file. Crea
3940

4041
![](images/create-launch-config.png)
4142

43+
You can also create launch configurations by pressing (++ctrl+space++) in the `launch.json` file.
44+
4245
## Launching a Launch Configuration
4346
The name of a launch configuration appears in the launch configuration drop down menu:
4447

4548
![](images/launch-config-dropdown.png)
4649

47-
Launch the launch configuration by pressing the green arrow button that appears to the left of this drop down menu.
48-
49-
You can also perform the launch from the `Run` menu, using the command **Run without Debugging** (++ctrl+"F5"++). In that case the launch configuration that is selected in the "Run and Debug" view drop down menu will be used.
50+
If you want to launch the launch configuration, and attach the Art Debugger to the launched application in order to [debug](../debugging/index.md) it, press the green arrow button that appears to the left of this drop down menu. This invokes the command **Start Debugging** (++"F5"++). If you just want to launch the application without debugging, perform instead the command **Run without Debugging** (++ctrl+"F5"++). Both these commands can be found in the `Run` menu.
5051

5152
## Launch Configuration Attributes
5253
Below is a table that lists all attributes that can be used in a launch configuration. Each attribute is described in a section of its own below the table.
@@ -56,21 +57,24 @@ Below is a table that lists all attributes that can be used in a launch configur
5657
| Attribute | Description | Mandatory |
5758
|----------|:-------------|:-------------|
5859
| [type](#type) | The type of launch configuration. Always "art". | Yes
59-
| [request](#request) | What the launch configuration will do. Always "launch". | Yes
60+
| [request](#request) | What the launch configuration will do. Either "launch" or "attach". | Yes
6061
| [name](#name) | The name of the launch configuration | Yes
61-
| [tc](#tc) | The TC file to use for building and launching the application. | Yes
62+
| [tc](#tc) | The TC file to use for building and launching the application. | Yes (unless request is "attach")
6263
| [args](#args) | Command line arguments to pass to the launched application. | No
6364
| [environment](#environment) | Environment variables to set for the launched application. | No
6465
| [cwd](#cwd) | Current working directory for the launched application | No
66+
| [port](#port) | Which debug port to use when debugging the application | No
67+
| [hostname](#hostname) | The machine where the application runs to which the debugger should be attached | No
68+
| [stopAtEntry](#stopatentry) | Should the debugger pause execution of the launched application? | No
6569

6670
### type
6771
This attribute specifies the type of launch configuration. It is mandatory and is always the string "art".
6872

6973
### request
70-
This attribute specifies what the launch configuration will do. It is mandatory and is always the string "launch".
74+
This attribute specifies what the launch configuration will do. It is mandatory and should be set to "launch" if you want the launch configuration to start your application. For a launch configuration that is used for [debugging](../debugging/index.md) you can also set this attribute to "attach" to specify that the Art Debugger should attach to an application that is already running.
7175

7276
### name
73-
Specifies the name of the launch configuration. You should give a meaningful and unique name to each launch configuration that describes what it does. The chosen name appears in the drop down menu in the "Run and Debug" view. When you first create a launch configuration it gets the name "runTC". Make sure to change this default name.
77+
Specifies the name of the launch configuration. You should give a meaningful and unique name to each launch configuration that describes what it does. The chosen name appears in the drop down menu in the "Run and Debug" view. When you first create a launch configuration it gets the name "launchTC". Make sure to change this default name.
7478

7579
### tc
7680
This attribute specifies which TC file to use for building and launching. The specified TC must build an executable. You must use an absolute path to the TC file, but it can contain the `${workspaceFolder}` variable which expands to the location of the workspace folder. By default the `tc` attribute is set to `${workspaceFolder}/${command:AskForTC}` which means you will be prompted for choosing which TC to use when the launch configuration is launched.
@@ -79,19 +83,23 @@ This attribute specifies which TC file to use for building and launching. The sp
7983

8084
For a list of other variables that can be used in this attribute see [this page](https://code.visualstudio.com/docs/editor/variables-reference#_settings-command-variables-and-input-variables).
8185

86+
If the [request](#request) attribute is set to "attach" then you should not set the [tc](#tc) attribute, because in that case the launch configuration will not start your application, and just attach the Art Debugger to an application that is already running.
87+
8288
### args
83-
Specifies the command-line arguments for the launched executable. This is a list of strings, and by default it is set to `["-URTS_DEBUG=quit"]` which means that the executable will run in non-debug mode. You may add custom command-line arguments for your application as necessary. For example:
89+
Specifies the command-line arguments for the launched executable. This is a list of strings, and by default it is empty which means that no additional command-line arguments will be passed to the executable. You may add custom command-line arguments for your application as necessary. For example:
8490

8591
``` json
8692
{
8793
"type": "art",
8894
"request": "launch",
8995
"name": "Let my exe listen to a port",
9096
"tc": "${workspaceFolder}/app.tcjs",
91-
"args": ["-URTS_DEBUG=quit", "--port=12345"]
97+
"args": ["-port=12345"]
9298
}
9399
```
94100

101+
Note that the special command-line argument `-URTS_DEBUG`, which tells if the application should run in debug mode or not, is set automatically depending on how you launch the launch configuration (see [Launching a Launch Configuration](#launching-a-launch-configuration)) so you should not include that in the [args](#args) attribute.
102+
95103
### environment
96104
Specifies environment variables to be set for the launched executable. This is a list of objects where each object has a property that specifies the name of an environment variable. The environment variable will be set to the value of that property. In the example below the environment variable `LD_LIBRARY_PATH` will be set to `/libs/mylibs` to tell a Linux system where to load shared libraries needed by the application.
97105

@@ -108,3 +116,11 @@ Specifies environment variables to be set for the launched executable. This is a
108116
### cwd
109117
By default the launched application runs in the same folder as where the executable is located. By setting this attribute you can change the current working directory to something else. The value of this attribute must be an absolute path, but certain variables can be used. See [this page](https://code.visualstudio.com/docs/editor/variables-reference#_settings-command-variables-and-input-variables) for more information.
110118

119+
### port
120+
This attribute applies only for launch configurations that are used for [debugging](../debugging/index.md). You can use it for specifying which TCP port to use as the debug port. By default the debug port is 3650. You need to change this to another value if that port for some reason is not available (for example because another debug session is already using that port).
121+
122+
### hostname
123+
This attribute applies only for launch configurations that are used for [debugging](../debugging/index.md) and only when the [request](#request) attribute is set to "attach". In that case it specifies the IP address where the application is running, to which the Art Debugger should attach. It defaults to "localhost", i.e. by default the Art Debugger assumes that the application to debug runs on the same machine as where {$product.name$} runs.
124+
125+
### stopAtEntry
126+
By default the application is paused as soon as it has been launched for debugging, and you have to manually perform the **Continue** command to resume its execution. You can set this attribute to `false` to prevent this from happening, and let the launched application start running immediately. This attribute is ignored when the [request](#request) attribute is set to "attach".
22.6 KB
Loading
9.99 KB
Loading
1.39 KB
Loading
2.64 KB
Loading
4.43 KB
Loading
4.06 KB
Loading
1.88 KB
Loading
2.2 KB
Loading
3.39 KB
Loading

0 commit comments

Comments
 (0)