[Lldb-commits] [lldb] r132383 - in /lldb/trunk: scripts/Python/edit-swig-python-wrapper-file.py source/Interpreter/Makefile

Charles Davis cdavis at mines.edu
Tue May 31 19:33:12 PDT 2011


Author: cdavis
Date: Tue May 31 21:33:12 2011
New Revision: 132383

URL: http://llvm.org/viewvc/llvm-project?rev=132383&view=rev
Log:
Fix remaining Python issues leftover from my previous patch.

- The Swig post-processing scripts are now run.
- edit-swig-python-wrapper-file.py has been modified so it can be run
from the Makefile.
- The issue that prompted me to pass -classic to swig is fixed by this,
so -classic isn't passed anymore.

Python shouldn't complain anymore about a missing method 'FindDebuggerByID'
on the SBDebugger object whenever lldb is run.

Modified:
    lldb/trunk/scripts/Python/edit-swig-python-wrapper-file.py
    lldb/trunk/source/Interpreter/Makefile

Modified: lldb/trunk/scripts/Python/edit-swig-python-wrapper-file.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/edit-swig-python-wrapper-file.py?rev=132383&r1=132382&r2=132383&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/edit-swig-python-wrapper-file.py (original)
+++ lldb/trunk/scripts/Python/edit-swig-python-wrapper-file.py Tue May 31 21:33:12 2011
@@ -20,7 +20,7 @@
 # That's what this python script does.
 #
 
-import os
+import os, sys
 
 include_python = '#include <Python.h>'
 include_python_ifdef = '''#if defined (__APPLE__)
@@ -30,8 +30,12 @@
 #endif
 '''
 
-input_dir_name = os.environ["SRCROOT"]
-full_input_name = input_dir_name + "/source/LLDBWrapPython.cpp"
+if len (sys.argv) > 1:
+    input_dir_name = sys.argv[1]
+    full_input_name = input_dir_name + "/LLDBWrapPython.cpp"
+else:
+    input_dir_name = os.environ["SRCROOT"]
+    full_input_name = input_dir_name + "/source/LLDBWrapPython.cpp"
 full_output_name = full_input_name + ".edited"
 
 with open(full_input_name, 'r') as f_in:

Modified: lldb/trunk/source/Interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Makefile?rev=132383&r1=132382&r2=132383&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Makefile (original)
+++ lldb/trunk/source/Interpreter/Makefile Tue May 31 21:33:12 2011
@@ -34,9 +34,16 @@
 
 LLDBWrapPython.cpp:
 	$(Echo) Generating LLDBWrapPython.cpp
-	$(Verb) swig -c++ -classic -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
+	$(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
           -D__STDC_LIMIT_MACROS -outdir "$(LLDB_BIN_DIR)"   \
           -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig"
+	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
+		  "$(LLDB_BIN_DIR)"
+	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
+		  "$(PROJ_OBJ_DIR)"
+	$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
+		  mv "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
+			 "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
 	$(Verb) cp "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
 
 install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(LIBLLDB)





More information about the lldb-commits mailing list