Skip to content

Commit 19bf0ad

Browse files
committed
[lldb][docs] Add troubleshooting section to scripting introduction
Logs just helped someone on Discord debug an issue in a way that would not have been possible just by stepping the Python script. It was that LLDB could not find the lldb-server binary. We do talk about logs elsewhere but I think it's fine to repeat here since it's a lot of people's first experience with scripting.
1 parent 1fe3b2d commit 19bf0ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lldb/docs/use/tutorials/implementing-standalone-scripts.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,20 @@ SBFunction: id = 0x0000002e, name = main, type = main
147147
a.out[0x714]: mov w0, #0x0 ; =0
148148
a.out[0x718]: ret
149149
```
150+
151+
### Troubleshooting
152+
153+
You can use all the usual Python tools to debug scripts, and on top of that
154+
you can enable LLDB's log channels. To do this in the script shown above, add
155+
this line right after `debugger` has been assigned:
156+
157+
```python
158+
debugger.EnableLog("lldb", ["all"])
159+
```
160+
161+
`lldb` `all` enables a lot of different channels, so you will probably want
162+
to enable only a few channels once you know what you are interested in.
163+
164+
This API call is the equivalent of `log enable lldb all` when using LLDB
165+
interactively. All channels available to `log enable` can be enabled using
166+
`EnableLog` too.

0 commit comments

Comments
 (0)