summaryrefslogtreecommitdiffstats
path: root/lldb/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts')
-rw-r--r--lldb/scripts/Python/python-typemaps.swig11
-rw-r--r--lldb/scripts/interface/SBProcess.i2
2 files changed, 9 insertions, 4 deletions
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig
index 659199f1fd0..82e33e1bc60 100644
--- a/lldb/scripts/Python/python-typemaps.swig
+++ b/lldb/scripts/Python/python-typemaps.swig
@@ -93,6 +93,9 @@
}
$1 = (char *) malloc($2);
}
+// SBProcess::ReadCStringFromMemory() uses a void*, but needs to be treated
+// as char data instead of byte data.
+%typemap(in) (void *char_buf, size_t size) = (char *dst, size_t dst_len);
// Return the char buffer. Discarding any previous return result
// See also SBThread::GetStopDescription.
@@ -108,6 +111,9 @@
}
free($1);
}
+// SBProcess::ReadCStringFromMemory() uses a void*, but needs to be treated
+// as char data instead of byte data.
+%typemap(argout) (void *char_buf, size_t size) = (char *dst, size_t dst_len);
// typemap for an outgoing buffer
@@ -231,9 +237,8 @@
$result = Py_None;
Py_INCREF($result);
} else {
- llvm::StringRef ref(static_cast<const char*>($1), result);
- lldb_private::PythonString string(ref);
- $result = string.release();
+ lldb_private::PythonBytes bytes(static_cast<const uint8_t*>($1), result);
+ $result = bytes.release();
}
free($1);
}
diff --git a/lldb/scripts/interface/SBProcess.i b/lldb/scripts/interface/SBProcess.i
index 1571ebc4cb6..0ce45f7d7be 100644
--- a/lldb/scripts/interface/SBProcess.i
+++ b/lldb/scripts/interface/SBProcess.i
@@ -296,7 +296,7 @@ public:
") ReadCStringFromMemory;
size_t
- ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);
+ ReadCStringFromMemory (addr_t addr, void *char_buf, size_t size, lldb::SBError &error);
%feature("autodoc", "
Reads an unsigned integer from memory given a byte size and an address.
OpenPOWER on IntegriCloud