You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-sources/building/launch-configurations.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ A more flexible way to launch an executable is to use a **launch configuration**
10
10
* You can easily manage multiple ways of launching the same application. Just create a launch configuration for each way of launching it.
11
11
* 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 (<spanstyle="color: red;">red</span> for text printed to stderr and <spanstyle="color: orange;">orange</span> for text printed to stdout).
12
12
* 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).
13
14
14
15
## Creating a Launch Configuration
15
16
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:
28
29
{
29
30
"type": "art",
30
31
"request": "launch",
31
-
"name": "runTC",
32
+
"name": "launchTC",
32
33
"tc": "${workspaceFolder}/${command:AskForTC}"
33
34
}
34
35
```
@@ -39,14 +40,14 @@ You can have multiple launch configurations in the same `launch.json` file. Crea
39
40
40
41

41
42
43
+
You can also create launch configurations by pressing (++ctrl+space++) in the `launch.json` file.
44
+
42
45
## Launching a Launch Configuration
43
46
The name of a launch configuration appears in the launch configuration drop down menu:
44
47
45
48

46
49
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.
50
51
51
52
## Launch Configuration Attributes
52
53
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
56
57
| Attribute | Description | Mandatory |
57
58
|----------|:-------------|:-------------|
58
59
| [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
60
61
| [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")
62
63
| [args](#args) | Command line arguments to pass to the launched application. | No
63
64
| [environment](#environment) | Environment variables to set for the launched application. | No
64
65
| [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
65
69
66
70
### type
67
71
This attribute specifies the type of launch configuration. It is mandatory and is always the string "art".
68
72
69
73
### 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.
71
75
72
76
### 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.
74
78
75
79
### tc
76
80
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
79
83
80
84
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).
81
85
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
+
82
88
### 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:
84
90
85
91
```json
86
92
{
87
93
"type": "art",
88
94
"request": "launch",
89
95
"name": "Let my exe listen to a port",
90
96
"tc": "${workspaceFolder}/app.tcjs",
91
-
"args": ["-URTS_DEBUG=quit", "--port=12345"]
97
+
"args": ["-port=12345"]
92
98
}
93
99
```
94
100
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
+
95
103
### environment
96
104
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.
97
105
@@ -108,3 +116,11 @@ Specifies environment variables to be set for the launched executable. This is a
108
116
### cwd
109
117
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.
110
118
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".
0 commit comments