summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/finishSwigPythonLLDB.py
Commit message (Collapse)AuthorAgeFilesLines
* Install six.py conditionallyKamil Rytarowski2017-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: The current version of LLDB installs six.py into global python library directory. This approach produces conflicts downstream with distribution's py-six copy. Introduce new configure option LLDB_USE_SYSTEM_SIX (disabled by default). Once specified as TRUE, six.py won't be installed to Python's directory. Add new option in finishSwigWrapperClasses.py, namely --useSystemSix. Sponsored by <The NetBSD Foundation> Reviewers: mgorny, emaste, clayborg, joerg, labath Reviewed By: labath Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29405 llvm-svn: 294071
* [CMake] Rename lldb-launcher to darwin-debugChris Bieneman2016-10-271-40/+0
| | | | | | | | | | | | Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to. Reviewers: zturner, tfiala, labath Subscribers: labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25745 llvm-svn: 285356
* [CMake] Initial support for LLDB.frameworkChris Bieneman2016-09-211-4/+4
| | | | | | | | | | | | | | | | | | | Summary: This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library. With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow. The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step. With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up. Reviewers: zturner, tfiala Subscribers: beanz, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D24749 llvm-svn: 282110
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-58/+204
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Fixup TestPyObjSynthProvider.py and enable it againPavel Labath2016-08-311-0/+1
| | | | | | | | | | | | | | | Summary: - copies the new file in the cmake build - adds an additional import statement - marks the test as no-debug-info specific, as it seems to be testing a python feature Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24074 llvm-svn: 280261
* Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is usedFrancis Ricci2016-04-251-6/+36
| | | | | | | | | | | | | | | | Summary: Do not assume that liblldb.so is located in $(lldb -P)/../../../lib when creating the _lldb python symlink. Instead, use the path passed to LLVM_LIBDIR_SUFFIX, defaulting to $(lldb -P)/../../../lib when this variable is not set. Reviewers: vharron, emaste, zturner Subscribers: zturner, labath, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19067 llvm-svn: 267462
* Fix a build issue where the python module could become stale.Zachary Turner2016-03-181-4/+17
| | | | | | | | | | | | | | | | | We are using hardlinks instead of symlinks, and we attempted to have some logic where we don't re-create the link if the target file already exists. This logic is faulty, however, when you manually delete the source file (e.g. liblldb.dll) and then rebuild lldb so that a brand new liblldb.dll gets written. Now the two files have different inodes, but the target exists, so we would not remake the link and the target would become stale. We fix this by only doing the optimization if they are really the exact same file (by comparing inode numbers), and if they are not the same file but the target exists, we delete it and re-create the link. llvm-svn: 263844
* Change finishSwigPythonLLDB.py to copy six.py instead of simlink itTed Woodward2015-12-111-11/+26
| | | | | | | | | | | | Summary: If six.py is simlink'd, an installation won't be able to find it unless it has access to the source tree that lldb was built from. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15422 llvm-svn: 255340
* Symlink the `six` module during swig generation.Zachary Turner2015-11-111-22/+43
| | | | llvm-svn: 252764
* [swig] Start of pylint on python build scripts.Bruce Mitchener2015-11-051-330/+328
| | | | | | | | | | | | | | | | | | | | | | | Summary: This does a broad first pass on cleaning up a lot of the noise when using pylint on these scripts. It mostly addresses issues of: * Mixed tabs and spaces. * Trailing whitespace. * Semicolons where they aren't needed. * Incorrect whitespace around () and []. * Superfluous parentheses. There will be subsequent patches with further changes that build upon these. Reviewers: zturner, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14375 llvm-svn: 252244
* Revert "Python 3 - Don't add the _d suffix to the symlink on Windows."Zachary Turner2015-11-041-4/+2
| | | | | | | | | | | | This reverts commit e59c95ca936f5a0a8abb987b8605fd8bf82b03b6. This was a mistake on my part. The real problem was with my environment. I was using a release interpreter to try to load my debug extension module. I noticed this after I finally managed to get into my extension module's init method, and then it segfaulted with heap errors due to mismatched CRT (debug vs. release) llvm-svn: 252030
* Python 3 - Don't add the _d suffix to the symlink on Windows.Zachary Turner2015-11-041-2/+4
| | | | | | | | | | | In Python 2, a debug extension module required an _d suffix, so for example the extension module `_lldb` would be backed by the file `_lldb_d.pyd` if built in debug mode, and `_lldb.pyd` if built in release mode. In Python 2, although undocumented, this seems to no longer be the case, and even for a debug extension module, the interpreter will only look for the `_lldb.pyd` name. llvm-svn: 252026
* Revert part of r239007 related to creating the Python symlink.Zachary Turner2015-11-021-9/+0
| | | | | | | | | | | | | | | This has apparently been broken since June, but only on non-Windows. Perhaps nobody noticed it because if the symlink is already there it won't try to re-create it, and nobody ever tried doing a clean build. In any case, I will let the original author attempt to fix this if he is still interested. the problem is that in the normal case of not setting BUILD_SHARED_LIBS and simply running ninja, it would link _lldb.so to a non-existent location, creating a dangling symlink. llvm-svn: 251840
* Rename argdumper to lldb-argdumperTodd Fiala2015-10-291-8/+8
| | | | | | http://reviews.llvm.org/D14169 llvm-svn: 251616
* Run py2to3 on lldb/scripts folder.Zachary Turner2015-10-191-16/+16
| | | | | | | This mostly fixes some print statements, but there were also some instances of dict.iteritems() lingering that this found. llvm-svn: 250762
* Make swig generation python scripts python 3 compatible.Zachary Turner2015-10-161-26/+26
| | | | llvm-svn: 250532
* [lldb] Enable building with Cmake/BUILD_SHARED_LIBSAndrew Wilkins2015-06-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Several changes to fix CMake builds of LLDB with the BUILD_SHARED_LIBS setting on. - Force all internal libraries to be built STATIC. - Add additional library dependencies (pthread, dl, runtimedyld). - modify finalisation of SWIG wrapper to symlink the "lib" dir into python/site-packages, so _lldb.so's RPATH resolves. Test Plan: Verified one test case with "dotest.py". Reviewers: sylvestre.ledru, zturner Reviewed By: zturner Subscribers: zturner, ted, tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D10157 llvm-svn: 239007
* Use the debugginess of the python interpreter when symlinking _lldb.pyd.Zachary Turner2015-04-221-2/+4
| | | | | | | | | | | | | | Previously we would pass an argument to finishSwigWrapperClasses.py which specified whether this was a debug or a release build. But sometimes CMAKE_BUILD_TYPE would not be set to anything, causing this argument to be empty when passed in. The only purpose of this argument was to determine whether or not to append _d to the extension module when creating the symlink. This is only necessary when doing a debug build of LLDB on Windows, which implies a debug interpreter, so we replace this with a check to see if the running interpreter is a debug one, and append _d if so. llvm-svn: 235559
* Don't use literal slashes when concatenating paths in Python.Zachary Turner2015-04-031-38/+34
| | | | | | | | This patch fixes the swig generation scripts to use os.path.join instead, which produces correctly normalized paths for platforms that don't use the standard forward slash separator. llvm-svn: 234030
* Remove non-standard Environment header sectionEd Maste2015-03-231-5/+0
| | | | llvm-svn: 232973
* Use .so library extension by default if platform is not Windows or DarwinEd Maste2015-03-231-3/+3
| | | | llvm-svn: 232970
* Fix whitespace in finishSwigWrapperClasses.pyEd Maste2015-03-231-659/+659
| | | | | | | - replace hard tabs with 4-space indents - delete EOL whitespace llvm-svn: 232969
* [swig] Fix some typos in the build scripts.Bruce Mitchener2015-02-261-1/+1
| | | | | | | | | | | | Reviewers: zturner, ki.stfu Reviewed By: zturner, ki.stfu Subscribers: ki.stfu, lldb-commits Differential Revision: http://reviews.llvm.org/D7912 llvm-svn: 230706
* Fix make_symlink in case when symlink already exists (after r229517)Ilia K2015-02-181-0/+2
| | | | llvm-svn: 229682
* Fix typo in make_symlink after r229517. It fixes symlinks on a UNIX style ↵Ilia K2015-02-181-1/+0
| | | | | | platform. llvm-svn: 229674
* Fix argdumper build in cmake (OS X) after r228636Ilia K2015-02-171-127/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previos version of this patch (see r229148) contained two errors: * make_symlink_darwin_debug passes 2 arguments into make_symlink, but it required 4 arguments (was fixed by r229159) * make_symlink doesn't work on OS X As a quick fix, the r229148 and the r229159 were reverted. Now these errors are fixed. Summary: This patch fixes the following tests on OS X: ``` FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym self.do_test () File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd())) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd msg if msg else CMD_MSG(cmd)) AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully Config=x86_64-clang ====================================================================== FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf self.do_test () File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd())) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd msg if msg else CMD_MSG(cmd)) AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully ``` Reviewers: epertoso, emaste, abidh, clayborg, zturner Reviewed By: clayborg Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg Differential Revision: http://reviews.llvm.org/D7550 llvm-svn: 229517
* Fix build: revert r229148 "Fix argdumper build in cmake (OS X) after ↵Ilia K2015-02-131-172/+123
| | | | | | r228636" and r229159 "Fix build: make_symlink_darwin_debug passes 2 arguments into make_symlink, but it requires 4 arguments" llvm-svn: 229166
* Fix build: make_symlink_darwin_debug passes 2 arguments into make_symlink, ↵Ilia K2015-02-131-1/+1
| | | | | | but it requires 4 arguments llvm-svn: 229159
* Fix argdumper build in cmake (OS X) after r228636Ilia K2015-02-131-123/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes the following tests on OS X: ``` FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym self.do_test () File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd())) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd msg if msg else CMD_MSG(cmd)) AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully Config=x86_64-clang ====================================================================== FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf self.do_test () File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd())) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd msg if msg else CMD_MSG(cmd)) AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully ``` Reviewers: epertoso, emaste, abidh, clayborg, zturner Reviewed By: clayborg Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg Differential Revision: http://reviews.llvm.org/D7550 llvm-svn: 229148
* Fix darwin-debug build in cmake (OS X)Zachary Turner2015-01-261-2/+58
| | | | | | | | | | | | | This patch fixes test_launch_in_terminal test which doesn't work in OS X since the moment as it was added in r225284. The test fails because Target::Launch returns the following error: "the darwin-debug executable doesn't exist at <output_dir>/lib/python2.7/site-packages/lldb/darwin-debug'". Patch by Ilia K Differential Revision: http://reviews.llvm.org/D7102 llvm-svn: 227096
* Create an _d suffixed symlink when doing a debug Windows build.Zachary Turner2014-07-171-1/+8
| | | | | | | | | | | _lldb is built as an extension module on Windows. Normally to load an extension module named 'foo', Python would look for the file 'foo.pyd'. However, when a debug interpreter is used, Python will look for the file 'foo_d.pyd'. This change checks the build configuration and creates the correct symlink name based on the build configuration. llvm-svn: 213306
* Get the python scripting interface working on Windows.Zachary Turner2014-07-101-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a number of issues with embedded Python on Windows. In particular: 1) The script that builds the python modules was normalizing the case of python filenames during copies. The module name is the filename, and is case-sensitive, so this was breaking code. 2) Changes the build to not attempt to link against python27.lib (e.g. the release library) when linking against msvcrt debug library. Doing a debug build of LLDB with embedded python support now requires you to provide your own self-compiled debug version of python. 3) Don't import termios when initializing the interpreter. This is part of a larger effort to remove the dependency on termios since it is not available on Windows. This particular instance was unnecessary and unused. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4441 llvm-svn: 212785
* Add better logging to the new Python-based SWIG generation scripts.Zachary Turner2014-07-101-10/+30
| | | | llvm-svn: 212759
* This creates a valid Python API for Windows, pending some issues. The ↵Deepak Panickal2014-07-011-0/+624
changes included are - - Ported the SWIG wrapper shell scripts to Python so that they would work on Windows too along with other platforms - Updated CMake handling to fix SWIG errors and manage sym-linking on Windows to liblldb.dll - More build fixes for Windows The pending issues are that two Python modules, termios and pexpect are not available on Windows. These are currently required for the Python command interpreter to be used from within LLDB. llvm-svn: 212111
OpenPOWER on IntegriCloud