[all-commits] [llvm/llvm-project] c29c24: [crashlog] Pass the debugger around instead of rel...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Nov 4 12:51:44 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c29c24be638957d471e7991b55f54bff69044239
      https://github.com/llvm/llvm-project/commit/c29c24be638957d471e7991b55f54bff69044239
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-11-04 (Wed, 04 Nov 2020)

  Changed paths:
    M lldb/examples/python/crashlog.py
    M lldb/examples/python/symbolication.py

  Log Message:
  -----------
  [crashlog] Pass the debugger around instead of relying on lldb.debugger

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.

rdar://64775776

Differential revision: https://reviews.llvm.org/D90706




More information about the All-commits mailing list