aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-02 00:57:52 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-02 00:57:52 +0000
commit73a44f6b994835d17bfa180459c9bf5bf95f9bb2 (patch)
tree318c0ec8953fbf409e88bc151de66c173cee9b4d
parent1310c68bb08b43778528d45789a0358158980b5d (diff)
downloadllvm-73a44f6b994835d17bfa180459c9bf5bf95f9bb2.zip
llvm-73a44f6b994835d17bfa180459c9bf5bf95f9bb2.tar.gz
llvm-73a44f6b994835d17bfa180459c9bf5bf95f9bb2.tar.bz2
Furnish some docstrings to be swigified into the generated lldb.py module.
Especially SBProcess.ReadMemory() and SBProcess.WriteMemory() because the generated autodoc strings make no sense for Python programmers due to typemap (see lldb.swig). llvm-svn: 134301
-rw-r--r--lldb/include/lldb/API/SBProcess.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/lldb/include/lldb/API/SBProcess.h b/lldb/include/lldb/API/SBProcess.h
index 9c6e871..ed8e671 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -89,7 +89,11 @@ public:
RemoteAttachToProcessWithID (lldb::pid_t pid,
lldb::SBError& error);
- // See SBTarget.Launch for argument description and usage.
+#ifdef SWIG
+ %feature("docstring",
+ "See SBTarget.Launch for argument description and usage."
+ ) RemoteLaunch;
+#endif
bool
RemoteLaunch (char const **argv,
char const **envp,
@@ -141,6 +145,12 @@ public:
uint32_t
GetAddressByteSize() const;
+#ifdef SWIG
+ %feature("docstring",
+ "Kills the process and shuts down all threads that were spawned to"
+ " track and monitor process."
+ ) Destroy;
+#endif
lldb::SBError
Destroy ();
@@ -150,18 +160,48 @@ public:
lldb::SBError
Stop ();
+#ifdef SWIG
+ %feature("docstring", "Same as Destroy(self).") Destroy;
+#endif
lldb::SBError
Kill ();
lldb::SBError
Detach ();
+#ifdef SWIG
+ %feature("docstring", "Sends the process a unix signal.") Signal;
+#endif
lldb::SBError
Signal (int signal);
+#ifdef SWIG
+ %feature("autodoc",
+"Reads memory from the current process's address space and removes any
+traps that may have been inserted into the memory. It returns the byte
+buffer in a Python string. Example:
+
+# Read 4 bytes from address 'addr' and assume error.Success() is True.
+content = process.ReadMemory(addr, 4, error)
+# Use 'ascii' encoding as each byte of 'content' is within [0..255].
+new_bytes = bytearray(content, 'ascii')"
+ ) ReadMemory;
+#endif
size_t
ReadMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);
+#ifdef SWIG
+ %feature("autodoc",
+"Writes memory to the current process's address space and maintains any
+traps that might be present due to software breakpoints. Example:
+
+# Create a Python string from the byte array.
+new_value = str(bytes)
+result = process.WriteMemory(addr, new_value, error)
+if not error.Success() or result != len(bytes):
+ print 'SBProcess.WriteMemory() failed!'"
+ ) WriteMemory;
+#endif
size_t
WriteMemory (addr_t addr, const void *buf, size_t size, lldb::SBError &error);