Skip to content

Commit da79b8d

Browse files
falcon4everCopilot
andauthored
Updated instructions for building on macOS and debugging via intellij (#843)
* Updated instructions for building on macOS and debugging via intellij * Update docs/src/doc/user-guide/debugging.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feedback * Revert theme change --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5e6be50 commit da79b8d

8 files changed

+56
-5
lines changed
451 KB
Loading
218 KB
Loading
200 KB
Loading
34.5 KB
Loading
219 KB
Loading
39.5 KB
Loading

docs/src/doc/getting-started/compiling-your-project.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ Using the Godot editor:
44

55
![Build button](../assets/img/editor-plugin/build_button.png)
66

7+
!!! warning
8+
On Linux or macOS you may receive an error when trying to build the project from the Godot editor (This can happen if you created your project via the IntelliJ template).
9+
```shell
10+
ERROR: Godot-JVM: Could not create child process: /Users/username/projectname/gradlew
11+
ERROR: at: execute_with_pipe (drivers/unix/os_unix.cpp:659)
12+
```
13+
14+
In such case, open up the terminal and change the permissions of the `gradlew` file to be executable.
15+
```shell
16+
chmod +x gradlew
17+
```
18+
719
Using your IDE:
820

921
![Gradle task](../assets/img/build_ide.png)
@@ -44,4 +56,4 @@ gradlew build -Prelease
4456

4557
Using debug builds is recommended when developing. It adds some sanity checks that are cut off in `release`.
4658

47-
Release builds are recommended when distributing to retail.
59+
Release builds are recommended when distributing to retail.

docs/src/doc/user-guide/debugging.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,53 @@ If you're still using the JDK installed on your system though, you don't need to
1212

1313
## Run and attach a Remote Debugger
1414

15-
Run your game with the command-line option `--jvm-debug-port=<port (normally 5005)>` and attach a remote debugger.
15+
Breakpoint based debugging is available via the remote debugger.
16+
17+
#### 1. Customize Run Instances in Godot
18+
19+
Open up the **Customize Run Instances** dialog from the **Debug** menu in Godot
20+
21+
![remote debug configuration_step_1](../assets/img/remote_debug_configuration_godot_menu.png)
22+
23+
#### 2. Specify the arguments
24+
25+
In the **Main Run Args**, you should specify your commandline options. In the example below we use port `5005` by specifying: `--jvm-debug-port=5005`
1626

1727
!!! info
1828
If you specify either `--jvm-debug-port` or `--jvm-debug-address` the execution of the game will suspend until you attach a remote debugger. You can configure this behaviour by specifying `--wait-for-debugger=true` or `--wait-for-debugger=false`
1929

20-
Example:
21-
![remote debug configuration](../assets/img/remote_debug_configuration.png)
30+
![remote debug configuration_step_2](../assets/img/remote_debug_configuration_godot_dialog.png)
31+
32+
#### 3. Create a new configuration in IntelliJ
33+
34+
Create a new **Configuration** using **Remote JVM Debug**
35+
36+
![remote debug configuration_step_3](../assets/img/remote_debug_configuration_intellij.png)
37+
38+
#### 4. Setup the new configuration in IntelliJ
39+
40+
Use the same port as you used in step 2, in our case `5005`
41+
![remote debug configuration_step_4](../assets/img/remote_debug_configuration.png)
42+
43+
#### 5. Set a breakpoint in IntelliJ
44+
45+
![remote debug configuration_step_5](../assets/img/remote_debug_configuration_intellij_breakpoint.png)
46+
47+
#### 6. Launch the game in Godot
48+
49+
Depending on your flags (`--wait-for-debugger`), the game will suspend until you attached the remote debugger from IntelliJ
50+
51+
#### 7. Run the Debug Game configuration
52+
53+
Run the **Debug Game** configuration you made earlier in IntelliJ
54+
55+
![remote debug configuration_step_6](../assets/img/remote_debug_configuration_intellij_configuration.png)
56+
57+
#### 8. Breakpoint
58+
59+
IntelliJ will now automatically pause when the breakpoint is hit
2260

61+
![remote debug configuration_step_7](../assets/img/remote_debug_configuration_intellij_breakpoint_hit.png)
2362

2463
## Write debug code
2564

@@ -32,4 +71,4 @@ Example:
3271
if (GodotJvmDefinitions.DEBUG) {
3372
// ...
3473
}
35-
```
74+
```

0 commit comments

Comments
 (0)