Skip to content

Commit 041db8e

Browse files
authored
Added rust specific example setting (#417)
I have added an update for rust. Rust strings is not built up around end escaping strings with \0. There for a native debugger like GDB will not show strings correctly in the Locals area when stepping through a debugging session. Rust has a tool for this which is basically some python formatters wrapped around gdb. All this is shipped with the rust toolchain when installing rust, so rust-gdb is on the PATH and ready to be called. This brings me to my update of the configuration: add a gdbpath that tells the debugger to use rust-gdb instead of the plain version of gdb. I have added this configuration so others can enjoy using dap mode while coding rust.
1 parent e582ff9 commit 041db8e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/page/configuration.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ Using <https://github.com/WebFreak001/code-debug>
240240
241241
Then do `dap-debug` or `dap-debug-edit-template` and selet GBD or
242242
LLDB configuration.
243+
244+
### Rust
245+
To fully support rust and pretty printing of strings when debugging, remember to add set `gdbpath` to `rust-gdb` in your debug template. An example template would be
246+
247+
```elisp
248+
(dap-register-debug-template "Rust::GDB Run Configuration"
249+
(list :type "gdb"
250+
:request "launch"
251+
:name "GDB::Run"
252+
:gdbpath "rust-gdb"
253+
:target nil
254+
:cwd nil))
255+
```
243256

244257
## Go
245258

0 commit comments

Comments
 (0)