aboutsummaryrefslogtreecommitdiff
path: root/lldb/bindings
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
commit145449b1e420787bb99721a429341fa6be3adfb6 (patch)
tree1d56ae694a6de602e348dd80165cf881a36600ed /lldb/bindings
parentecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff)
downloadsrc-145449b1e420787bb99721a429341fa6be3adfb6.tar.gz
src-145449b1e420787bb99721a429341fa6be3adfb6.zip
Vendor import of llvm-project main llvmorg-15-init-15358-g53dc0f107877.vendor/llvm-project/llvmorg-15-init-15358-g53dc0f107877
Diffstat (limited to 'lldb/bindings')
-rw-r--r--lldb/bindings/interface/SBCommandInterpreter.i3
-rw-r--r--lldb/bindings/interface/SBCompileUnit.i16
-rw-r--r--lldb/bindings/interface/SBDebugger.i21
-rw-r--r--lldb/bindings/interface/SBProcess.i3
-rw-r--r--lldb/bindings/interface/SBTarget.i3
-rw-r--r--lldb/bindings/interface/SBType.i12
-rw-r--r--lldb/bindings/macros.swig4
-rw-r--r--lldb/bindings/python/createPythonInit.py8
-rw-r--r--lldb/bindings/python/python-extensions.swig1
9 files changed, 69 insertions, 2 deletions
diff --git a/lldb/bindings/interface/SBCommandInterpreter.i b/lldb/bindings/interface/SBCommandInterpreter.i
index b9a32716cfd6..cad79248d0a2 100644
--- a/lldb/bindings/interface/SBCommandInterpreter.i
+++ b/lldb/bindings/interface/SBCommandInterpreter.i
@@ -125,6 +125,9 @@ public:
bool
HasAliasOptions ();
+ bool
+ IsInteractive ();
+
lldb::SBProcess
GetProcess ();
diff --git a/lldb/bindings/interface/SBCompileUnit.i b/lldb/bindings/interface/SBCompileUnit.i
index 4c8efaedb7dc..5a03069b4e04 100644
--- a/lldb/bindings/interface/SBCompileUnit.i
+++ b/lldb/bindings/interface/SBCompileUnit.i
@@ -67,6 +67,22 @@ public:
lldb::SBLineEntry
GetLineEntryAtIndex (uint32_t idx) const;
+ %feature("docstring", "
+ Get the index for a provided line entry in this compile unit.
+
+ @param[in] line_entry
+ The SBLineEntry object for which we are looking for the index.
+
+ @param[in] exact
+ An optional boolean defaulting to false that ensures that the provided
+ line entry has a perfect match in the compile unit.
+
+ @return
+ The index of the user-provided line entry. UINT32_MAX if the line entry
+ was not found in the compile unit.") FindLineEntryIndex;
+ uint32_t
+ FindLineEntryIndex (lldb::SBLineEntry &line_entry, bool exact = false) const;
+
uint32_t
FindLineEntryIndex (uint32_t start_idx,
uint32_t line,
diff --git a/lldb/bindings/interface/SBDebugger.i b/lldb/bindings/interface/SBDebugger.i
index f21e60d62873..5d51a6ac20d2 100644
--- a/lldb/bindings/interface/SBDebugger.i
+++ b/lldb/bindings/interface/SBDebugger.i
@@ -117,6 +117,23 @@ or the equivalent arguments for :py:class:`SBTarget.AttachToProcessWithID` .") S
class SBDebugger
{
public:
+ enum
+ {
+ eBroadcastBitProgress = (1 << 0),
+ eBroadcastBitWarning = (1 << 1),
+ eBroadcastBitError = (1 << 2),
+ };
+
+
+ static const char *GetProgressFromEvent(const lldb::SBEvent &event,
+ uint64_t &OUTPUT,
+ uint64_t &OUTPUT,
+ uint64_t &OUTPUT,
+ bool &OUTPUT);
+
+ static lldb::SBStructuredData GetDiagnosticFromEvent(const lldb::SBEvent &event);
+
+ SBBroadcaster GetBroadcaster();
static void
Initialize();
@@ -124,6 +141,8 @@ public:
static SBError
InitializeWithErrorHandling();
+ static void PrintStackTraceOnError();
+
static void
Terminate();
@@ -523,6 +542,8 @@ Example: ::
lldb::SBError
RunREPL (lldb::LanguageType language, const char *repl_options);
+ SBTrace LoadTraceFromFile(SBError &error, const SBFileSpec &trace_description_file);
+
#ifdef SWIGPYTHON
%pythoncode%{
def __iter__(self):
diff --git a/lldb/bindings/interface/SBProcess.i b/lldb/bindings/interface/SBProcess.i
index 14566a2942d0..7a9f8fc5757c 100644
--- a/lldb/bindings/interface/SBProcess.i
+++ b/lldb/bindings/interface/SBProcess.i
@@ -398,6 +398,9 @@ public:
IsInstrumentationRuntimePresent(lldb::InstrumentationRuntimeType type);
lldb::SBError
+ SaveCore(const char *file_name, const char *flavor, lldb::SaveCoreStyle core_style);
+
+ lldb::SBError
SaveCore(const char *file_name);
lldb::SBError
diff --git a/lldb/bindings/interface/SBTarget.i b/lldb/bindings/interface/SBTarget.i
index b98aa70849be..a6a764944d02 100644
--- a/lldb/bindings/interface/SBTarget.i
+++ b/lldb/bindings/interface/SBTarget.i
@@ -394,6 +394,9 @@ public:
const char *
GetTriple ();
+ const char *
+ GetABIName();
+
%feature("docstring", "
Architecture data byte width accessor
diff --git a/lldb/bindings/interface/SBType.i b/lldb/bindings/interface/SBType.i
index d6e8db3ab428..8db2fa749634 100644
--- a/lldb/bindings/interface/SBType.i
+++ b/lldb/bindings/interface/SBType.i
@@ -355,6 +355,18 @@ public:
IsScopedEnumerationType ();
%feature("docstring",
+ "Returns true if this type is an aggregate type.
+
+ Language-specific behaviour:
+
+ * C: Returns true for struct values, arrays, and vectors.
+ * C++: Same a C. Also includes class instances.
+ * Objective-C: Same as C. Also includes class instances.
+ ") IsAggregateType;
+ bool
+ IsAggregateType ();
+
+ %feature("docstring",
"Returns a type that represents a pointer to this type.
If the type system of the current language can't represent a pointer to this
diff --git a/lldb/bindings/macros.swig b/lldb/bindings/macros.swig
index 6793a11c5bd9..84f244245738 100644
--- a/lldb/bindings/macros.swig
+++ b/lldb/bindings/macros.swig
@@ -1,6 +1,6 @@
%define STRING_EXTENSION_LEVEL(Class, Level)
%extend {
- std::string lldb:: ## Class ## ::__str__(){
+ std::string lldb:: ## Class ## ::__repr__(){
lldb::SBStream stream;
$self->GetDescription (stream, Level);
const char *desc = stream.GetData();
@@ -15,7 +15,7 @@
%define STRING_EXTENSION(Class)
%extend {
- std::string lldb:: ## Class ## ::__str__(){
+ std::string lldb:: ## Class ## ::__repr__(){
lldb::SBStream stream;
$self->GetDescription (stream);
const char *desc = stream.GetData();
diff --git a/lldb/bindings/python/createPythonInit.py b/lldb/bindings/python/createPythonInit.py
index 3deb9159b702..4ad7320675f4 100644
--- a/lldb/bindings/python/createPythonInit.py
+++ b/lldb/bindings/python/createPythonInit.py
@@ -10,6 +10,14 @@ importNames = ', '.join('"{}"'.format(getFileName(f)) for f in pkgFiles)
script = """__all__ = [{import_names}]
for x in __all__:
__import__('lldb.{pkg_name}.' + x)
+
+def __lldb_init_module(debugger, internal_dict):
+ import lldb
+ for x in __all__:
+ submodule = getattr(lldb.{pkg_name}, x)
+ lldb_init = getattr(submodule, '__lldb_init_module', None)
+ if lldb_init:
+ lldb_init(debugger, internal_dict)
""".format(import_names=importNames, pkg_name=pkgRelDir.replace("/", "."))
pkgIniFile = os.path.normpath(os.path.join(pkgRelDir, "__init__.py"))
diff --git a/lldb/bindings/python/python-extensions.swig b/lldb/bindings/python/python-extensions.swig
index b98b0d458f0c..cb841af070ad 100644
--- a/lldb/bindings/python/python-extensions.swig
+++ b/lldb/bindings/python/python-extensions.swig
@@ -565,6 +565,7 @@ def is_numeric_type(basic_type):
if basic_type == eBasicTypeUnsignedWChar: return (True,False)
if basic_type == eBasicTypeChar16: return (True,False)
if basic_type == eBasicTypeChar32: return (True,False)
+ if basic_type == eBasicTypeChar8: return (True,False)
if basic_type == eBasicTypeShort: return (True,True)
if basic_type == eBasicTypeUnsignedShort: return (True,False)
if basic_type == eBasicTypeInt: return (True,True)