aboutsummaryrefslogtreecommitdiff
path: root/lldb/scripts/Python/modify-python-lldb.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-01 22:14:07 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-01 22:14:07 +0000
commitb9a2c32219daa00755a61859c0db1854c08875a1 (patch)
treeac4de17dd9fa1cbbbcb4eb233737155d0daa668b /lldb/scripts/Python/modify-python-lldb.py
parenta293f24a0d5b45086d176aa1cbb537f0d39a0b17 (diff)
downloadllvm-b9a2c32219daa00755a61859c0db1854c08875a1.zip
llvm-b9a2c32219daa00755a61859c0db1854c08875a1.tar.gz
llvm-b9a2c32219daa00755a61859c0db1854c08875a1.tar.bz2
Add some documentation blocks to SBTarget.h and use swig docstring feature to
take advantage of them. Update modify-python-lldb.py to remove some 'residues' resulting from swigification. llvm-svn: 134269
Diffstat (limited to 'lldb/scripts/Python/modify-python-lldb.py')
-rw-r--r--lldb/scripts/Python/modify-python-lldb.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/scripts/Python/modify-python-lldb.py b/lldb/scripts/Python/modify-python-lldb.py
index 4d3b861..93d0bd4 100644
--- a/lldb/scripts/Python/modify-python-lldb.py
+++ b/lldb/scripts/Python/modify-python-lldb.py
@@ -6,6 +6,12 @@
# objects, implements truth value testing for certain lldb objects, and adds a
# global variable 'debugger_unique_id' which is initialized to 0.
#
+# As a cleanup step, it also removes the 'residues' from the autodoc features of
+# swig. For an example, take a look at SBTarget.h header file, where we take
+# advantage of the already existing C++-style headerdoc and make it the Python
+# docstring for the same method. The 'residues' in this context include the
+# '#endif' and the '#ifdef SWIG' lines.
+#
# It also calls SBDebugger.Initialize() to initialize the lldb debugger
# subsystem.
#
@@ -19,6 +25,10 @@ else:
# print "output_name is '" + output_name + "'"
+# Residues to be removed.
+c_endif_swig = "#endif"
+c_ifdef_swig = "#ifdef SWIG"
+
#
# lldb_iter() should appear before our first SB* class definition.
#
@@ -148,6 +158,12 @@ lldb_iter_defined = False;
# value testing and the built-in operation bool().
state = NORMAL
for line in content.splitlines():
+ # Cleanse the lldb.py of the autodoc'ed residues.
+ if c_ifdef_swig in line or c_endif_swig in line:
+ continue
+ # Also remove the '\a ' substrings.
+ line = line.replace('\a ', '')
+
if state == NORMAL:
match = class_pattern.search(line)
# Inserts the lldb_iter() definition before the first class definition.