summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:31 +0000
commit61b440f5005f0bf4e5864ba9cff4107ac56be404 (patch)
tree7d21c36d6cfd2c3053c6673f6303dceb45bc07c6 /scripts
parentfb19dde5bfd42a03786ee50e6b300e47c45ace47 (diff)
Notes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/interface/SBStructuredData.i25
-rw-r--r--scripts/lldb.swig18
2 files changed, 38 insertions, 5 deletions
diff --git a/scripts/interface/SBStructuredData.i b/scripts/interface/SBStructuredData.i
index 1c55bacd31be..4e54cdd7b405 100644
--- a/scripts/interface/SBStructuredData.i
+++ b/scripts/interface/SBStructuredData.i
@@ -18,21 +18,38 @@ namespace lldb {
class SBStructuredData
{
public:
-
SBStructuredData();
-
+
SBStructuredData(const lldb::SBStructuredData &rhs);
SBStructuredData(const lldb::EventSP &event_sp);
~SBStructuredData();
-
+
bool
IsValid() const;
-
+
void
Clear();
+ lldb::SBStructuredData &operator=(const lldb::SBStructuredData &rhs);
+
+ lldb::StructuredDataType GetType() const;
+
+ size_t GetSize() const;
+
+ lldb::SBStructuredData GetValueForKey(const char *key) const;
+
+ lldb::SBStructuredData GetItemAtIndex(size_t idx) const;
+
+ uint64_t GetIntegerValue(uint64_t fail_value = 0) const;
+
+ double GetFloatValue(double fail_value = 0.0) const;
+
+ bool GetBooleanValue(bool fail_value = false) const;
+
+ size_t GetStringValue(char *dst, size_t dst_len) const;
+
lldb::SBError
GetAsJSON(lldb::SBStream &stream) const;
diff --git a/scripts/lldb.swig b/scripts/lldb.swig
index b0325e611d70..8f1b59c32d4d 100644
--- a/scripts/lldb.swig
+++ b/scripts/lldb.swig
@@ -31,8 +31,24 @@ o SBLineEntry: Specifies an association with a contiguous range of instructions
and a source file location. SBCompileUnit contains SBLineEntry(s)."
%enddef
+/*
+Since version 3.0.9, swig's logic for importing the native module has changed in
+a way that is incompatible with our usage of the python module as __init__.py
+(See swig bug #769). Fortunately, since version 3.0.11, swig provides a way for
+us to override the module import logic to suit our needs. This does that.
+
+Older swig versions will simply ignore this setting.
+*/
+%define MODULEIMPORT
+"from . import $module"
+%enddef
+// These versions will not generate working python modules, so error out early.
+#if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011
+#error Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
+#endif
+
// The name of the module to be created.
-%module(docstring=DOCSTRING) lldb
+%module(docstring=DOCSTRING, moduleimport=MODULEIMPORT) lldb
// Parameter types will be used in the autodoc string.
%feature("autodoc", "1");