[Lldb-commits] [PATCH] D90706: [crashlog] Pass the debugger around instead of relying on lldb.debugger
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 3 12:05:04 PST 2020
JDevlieghere created this revision.
JDevlieghere added a reviewer: clayborg.
JDevlieghere requested review of this revision.
The `lldb.debugger` et al convenience variables are only available from the interactive script interpreter. In all other scenarios, they are `None` (since fc1fd6bf9fcfac412b10b4193805ec5de0e8df57) before that they were default initialized.
The `crashlog` script was hacking around that by setting the `lldb.debugger` to a newly created debugger instance when running outside of the script interpreter, which works fine until lldb creates a script interpreter instance under the hood and clears the variables. This was resulting in an `AttributeError` when invoking the script directly (from outside of lldb):
AttributeError: 'NoneType' object has no attribute 'GetSourceManager'
This patch fixes that by passing around the debugger instance.
https://reviews.llvm.org/D90706
Files:
lldb/examples/python/crashlog.py
lldb/examples/python/symbolication.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90706.302653.patch
Type: text/x-patch
Size: 6097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201103/47dd5426/attachment.bin>
More information about the lldb-commits
mailing list