Author: David Spickett Date: 2025-10-31T14:02:30Z New Revision: 19bf0adfd0efa7c8e9bbc48d119b47f9349dcf69
URL: https://github.com/llvm/llvm-project/commit/19bf0adfd0efa7c8e9bbc48d119b47f9349dcf69 DIFF: https://github.com/llvm/llvm-project/commit/19bf0adfd0efa7c8e9bbc48d119b47f9349dcf69.diff LOG: [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. Added: Modified: lldb/docs/use/tutorials/implementing-standalone-scripts.md Removed: ################################################################################ diff --git a/lldb/docs/use/tutorials/implementing-standalone-scripts.md b/lldb/docs/use/tutorials/implementing-standalone-scripts.md index 285d2d3dea9ea..b1a3441ffe2ee 100644 --- a/lldb/docs/use/tutorials/implementing-standalone-scripts.md +++ b/lldb/docs/use/tutorials/implementing-standalone-scripts.md @@ -147,3 +147,20 @@ SBFunction: id = 0x0000002e, name = main, type = main a.out[0x714]: mov w0, #0x0 ; =0 a.out[0x718]: ret ``` + +### Troubleshooting + +You can use all the usual Python tools to debug scripts, and on top of that +you can enable LLDB's log channels. To do this in the script shown above, add +this line right after `debugger` has been assigned: + +```python +debugger.EnableLog("lldb", ["all"]) +``` + +`lldb` `all` enables a lot of diff erent channels, so you will probably want +to enable only a few channels once you know what you are interested in. + +This API call is the equivalent of `log enable lldb all` when using LLDB +interactively. All channels available to `log enable` can be enabled using +`EnableLog` too. \ No newline at end of file _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
