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
- <kbd>C-c r</kbd> `gdscript-hydra-show` (require hydra package to be installed
220
+
- <kbd>C-c r</kbd> `gdscript-hydra-show` (require hydra package to be installed)
221
+
- <kbd>C-c n</kbd> `gdscript-debug-hydra` (require hydra package to be installed)
221
222
222
223
## Customization
223
224
@@ -231,3 +232,112 @@ Code example:
231
232
(setq gdscript-godot-executable "/path/to/godot") ;; Use this executable instead of 'godot' to open the Godot editor.
232
233
(setq gdscript-gdformat-save-and-format t) ;; Save all buffers and format them with gdformat anytime Godot executable is run.
233
234
```
235
+
236
+
## Debugger
237
+
238
+
Use <kbd>C-c C-d b</kbd> to add breakpoint to your GDScript file. Red dot will appear in the left fringe to indicate position where breakpoint is placed.
239
+
Use <kbd>C-c C-d r</kbd> to remove breakpoint.
240
+
241
+
Once first breakpoint is added to the project, buffer named `* Breakpoints *` is created. This buffer displays all existing breakpoints in a project. Pressing <kbd>D</kbd> on breakpoint line deletes the breakpoint. Pressing <kbd>RET</kbd> on breakpoint line shows GDScript file with that breakpoint in other buffer.
242
+
243
+
When any breakpoint exists, running project will automatically start debugger server (if one isn't already running) and connect to it.
244
+
Debugger server runs on `localhost` with port specified by `gdscript-debug-port` customizable variable (`6010` by default).
245
+
246
+
Once breakpoint is hit in your code, Emacs will show two special buffers with information related to a position of the breakpoint:
247
+
248
+
-`* Stack frame vars *` - Display locals/members/globals variables for current stack point. It show variable name, its type and its value.
249
+
-`* Inspector *` - Display detailed information about selected `ObjectId`. By default it show `self` reference.
250
+
251
+
Any `ObjectId` in those two buffers can be inspected by pressing <kbd>RET</kbd> when point is on corresponding line.
252
+
253
+
### Oneline/multiline display
254
+
255
+
Variable values of types `Dictionary`, `PoolRealArray`, `PoolStringArray`, `PoolVector2Array`, `PoolVector3Array` and `PoolColorArray` could be toggled from one line display to multiline display by pressing `TAB` on corresponding line.
256
+
257
+
### Fetching `ObjectId` details
258
+
259
+
Pressing <kbd>d</kbd> in `* Stack frame vars *` or `* Inspector *` buffers (or on Debug Hydra) will fetch on the background data for all `ObjectId`s present in those two buffers and once all `ObjectId`s data are fetched, these two buffer are redisplayed. This redisplay will contain two additional informations about given `ObjectId`:
260
+
- real type (for example `KinematicBody2D` instead of `ObjectId`)
261
+
- node path
262
+
263
+
Also fetched data are cached and not fetched again when said `ObjectId` is inspected later on (until new breakpoint is hit).
264
+
265
+
On breakpoint hit Debug Hydra will be displayed below `* Stack frame vars *` and `* Inspector *` buffers.
266
+
267
+
### Debug Hydra
268
+
269
+
```
270
+
n next c continue m step b breakpoints s stack v vars i inspector t scene-tree d details
271
+
o pin u unpin q quit
272
+
```
273
+
274
+
- <kbd>n</kbd> - Jump to next line and stops there
275
+
- <kbd>c</kbd> - Continue program execution until another breakpoint is hit
276
+
- <kbd>m</kbd> - Step into
277
+
- <kbd>s</kbd> - Show `* Stack dump *` buffer
278
+
- <kbd>v</kbd> - Show `* Stack frame vars *` buffer
279
+
- <kbd>i</kbd> - Show `* Inspector *` buffer
280
+
- <kbd>t</kbd> - Show `* Scene tree *` buffer
281
+
- <kbd>d</kbd> - Fetch details for all `ObjectId`s present in `* Stack frame vars *` and `* Inspector *` buffers and redisplay them
282
+
- <kbd>o</kbd> - Pin current `self``ObjectId` in `* Inspector *` buffer. It stays displayed until it cease to exists or until it get unpinned
283
+
- <kbd>u</kbd> - Unpin currently pinned `ObjectId`
284
+
- <kbd>q</kbd> - Close Debug Hydra
285
+
286
+
### `* Stack frame vars *` buffer
287
+
288
+
Main source of information about running program. Contains information about locals/members/globals variables.
289
+
290
+
- Press <kbd>TAB</kbd> to toggling oneline/multiline display for selected types
291
+
- Press <kbd>RET</kbd> on `ObjectId` line to display its details in `* Inspector *`buffer
292
+
- Press <kbd>l</kbd> to display `* Stack dump *` buffer
293
+
- Press <kbd>d</kbd> to display additional details for `ObjectId` variables
294
+
- Press <kbd>p</kbd> to go to previous line
295
+
- Press <kbd>n</kbd> to go to next line
296
+
- Press <kbd>o</kbd> to pin current `ObjectId` in `* Inspector *` buffer
297
+
- Press <kbd>u</kbd> to unpin currently pinned `ObjectId`
298
+
- Press <kbd>q</kbd> to close the buffer
299
+
300
+
### `* Inspector *` buffer
301
+
302
+
Contains information about inspected object. By default `self` variable from `* Stack frame vars *` is displayed. Inspected object is kept to be focused until other object is inspected or until inspected object cease to exists, in which case current `self` is displayed instead.
303
+
304
+
- Press <kbd>TAB</kbd> to toggling oneline/multiline display for selected types
305
+
- Press <kbd>RET</kbd> on `ObjectId` line to display its details
306
+
- Press <kbd>RET</kbd> on `Node/path` line (second line from the top) to show given `ObjectId` in `* Scene Tree *` buffer
307
+
- Press <kbd>l</kbd> deep in nested `ObjectId` to navigate one level up in the structure (ie. back). Pressing `l` while on top level object displays `* Stack frame vars *` buffer
308
+
- Press <kbd>d</kbd> to display additional details for `ObjectId` variables
309
+
- Press <kbd>p</kbd> to go to previous line
310
+
- Press <kbd>n</kbd> to go to next line
311
+
- Press <kbd>o</kbd> to pin current `ObjectId` in `* Inspector *` buffer
312
+
- Press <kbd>u</kbd> to unpin currently pinned `ObjectId`
313
+
- Press <kbd>q</kbd> to close the buffer
314
+
315
+
### `* Stack dump *` buffer
316
+
317
+
Contains stack dump information.
318
+
319
+
- Press <kbd>SPC</kbd> to jump to gdscript file where stack frame points to
320
+
- Press <kbd>RET</kbd> to jump to gdscript file and to show `* Stack frame vars *`, `* Inspector *` buffers and a Debug Hydra
321
+
- Press <kbd>l</kbd> to display `* Stack frame vars *` buffer
322
+
- Press <kbd>p</kbd> to go to previous line
323
+
- Press <kbd>n</kbd> to go to next line
324
+
- Press <kbd>q</kbd> to close the buffer
325
+
326
+
### `* Breakpoints *` buffer
327
+
328
+
Contains list of all existing breakpoints.
329
+
330
+
- Press <kbd>SPC</kbd> to enable/disable all breakpoints
331
+
- Press <kbd>RET</kbd> to open gdscript file where on give breakpoint position
332
+
- Press <kbd>TAB</kbd> to display `* Stack dump *` buffer
333
+
- Press <kbd>D</kbd> to delete the breakpoint
334
+
- Press <kbd>q</kbd> to close the buffer
335
+
336
+
### `* Scene tree *` buffer
337
+
338
+
Contains tree visualisation of all `ObjectId`s in the running program.
339
+
340
+
- Press <kbd>RET</kbd> to open corresponding `ObjectId` in `* Inspector *` buffer
0 commit comments