diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-07-08 23:02:33 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-07-08 23:02:33 +0000 |
commit | 33b4be1d7ca14b25d0d57b5a2032971294980996 (patch) | |
tree | 996bcf8a002163ceac42076741445bb693363f6e /scripts/lldb.swig | |
parent | 5d81f49f0b45f8810cfaf1fa3437aa72bed0c3af (diff) | |
download | lldb-33b4be1d7ca14b25d0d57b5a2032971294980996.tar.gz |
o TestEvents.py:
Add a usage example of SBEvent APIs.
o SBEvent.h and SBListener.h:
Add method docstrings for SBEvent.h and SBListener.h, and example usage of SBEvent into
the class docstring of SBEvent.
o lldb.swig:
Add typemap for SBEvent::SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len)
so that we can use, in Python, obj2 = lldb.SBEvent(0, "abc") to create an SBEvent.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'scripts/lldb.swig')
-rw-r--r-- | scripts/lldb.swig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/lldb.swig b/scripts/lldb.swig index 206dd3480..9683971bc 100644 --- a/scripts/lldb.swig +++ b/scripts/lldb.swig @@ -102,7 +102,16 @@ o SBLineEntry: Specifies an association with a contiguous range of instructions // typemap for an outgoing buffer -// See also SBProcess::WriteMemory. +// See also SBEvent::SBEvent(uint32_t event, const char *cstr, uint32_t cstr_len). +%typemap(in) (const char *cstr, uint32_t cstr_len) { + if (!PyString_Check($input)) { + PyErr_SetString(PyExc_ValueError, "Expecting a string"); + return NULL; + } + $1 = (char *) PyString_AsString($input); + $2 = PyString_Size($input); +} +// And SBProcess::WriteMemory. %typemap(in) (const void *buf, size_t size) { if (!PyString_Check($input)) { PyErr_SetString(PyExc_ValueError, "Expecting a string"); |