forked from OSchip/llvm-project
[lldb/Python] Add lldbconfig module to make the lldb module configurable
Using the approach suggested by Pavel in D77588, this patch introduces a new lldbconfig module that lives next to the lldb module. It makes it possible to make the lldb module configurable before importing it. More specifically it makes it possible to delay initializing the debugger, which is needed for testing the reproducer. Differential revision: https://reviews.llvm.org/D77661
This commit is contained in:
parent
223154d267
commit
b0bdaf9ba2
|
@ -128,8 +128,15 @@ using namespace lldb;
|
|||
%include "./python/python-wrapper.swig"
|
||||
|
||||
%pythoncode%{
|
||||
_initialize = True
|
||||
try:
|
||||
import lldbconfig
|
||||
_initialize = lldbconfig.INITIALIZE
|
||||
except ImportError:
|
||||
pass
|
||||
debugger_unique_id = 0
|
||||
SBDebugger.Initialize()
|
||||
if _initialize:
|
||||
SBDebugger.Initialize()
|
||||
debugger = None
|
||||
target = None
|
||||
process = None
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
INITIALIZE = True
|
|
@ -954,7 +954,9 @@ def run_suite():
|
|||
|
||||
setupSysPath()
|
||||
|
||||
import lldbconfig
|
||||
import lldb
|
||||
|
||||
# Use host platform by default.
|
||||
lldb.selected_platform = lldb.SBPlatform.GetHostPlatform()
|
||||
|
||||
|
|
Loading…
Reference in New Issue