summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/interface/SBModule.i
Commit message (Collapse)AuthorAgeFilesLines
* [lldb/Bindings] Move bindings into their own subdirectoryJonas Devlieghere2020-01-091-554/+0
| | | | | | | | | | | | All the code required to generate the language bindings for Python and Lua lives under scripts, even though the majority of this code aren't scripts at all, and surrounded by scripts that are totally unrelated. I've reorganized these files and moved everything related to the language bindings into a new top-level directory named bindings. This makes the corresponding files self contained and much more discoverable. Differential revision: https://reviews.llvm.org/D72437
* [lldb/SWIG] Refactor extensions to be non Python-specific (2/2)Jonas Devlieghere2020-01-081-0/+2
| | | | | | | | | | | The current SWIG extensions for the string conversion operator is Python specific because it uses the PythonObjects. This means that the code cannot be reused for other SWIG supported languages such as Lua. This reimplements the extensions in a more generic way that can be reused. It uses a SWIG macro to reduce code duplication. Differential revision: https://reviews.llvm.org/D72377
* [lldb/SWIG] Guard embedded Python code in SWIG interfaces by SWIGPYTHONJonas Devlieghere2019-12-081-0/+4
| | | | | | Guard the embedded Python code in LLDB's interface files by the SWIGPYTHON define to ensures they can be reused for other languages supported by SWIG.
* Fix some swig warningsPavel Labath2019-09-271-6/+0
| | | | | | | | | Previously, these were unseen because the wrapper script would swallow them. This fixes the following types of warnings: - methods being declared more than once - swig complained about ignoring operator=, so I just removed it llvm-svn: 373069
* [swig] Don't mess with swig internals.Jonas Devlieghere2019-07-021-40/+14
| | | | | | | | | | | | | | | As of SWIG 4.0, __swig_getmethods__ and __swig_setmethods__ are no longer defined. It appears that there's no need to mess with these internals, we can simplify define the corresponding properties inline. Originally I wanted to use the swig extension %attribute and %attributeref to define properties. However, I couldn't find a way to add documentation to these attributes. Since we already had the properties defined inline, we might as well keep them. Differential revision: https://reviews.llvm.org/D63530 llvm-svn: 364974
* modify-python-lldb: Remove \a-removing codePavel Labath2019-04-231-3/+3
| | | | | | instead, remove \a directly from the interface files. llvm-svn: 358967
* Clean up docstrings in swig interface filesPavel Labath2019-04-181-141/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes the "//----" frames and "///" leading lines from docstring comments. We already have code doing transformations like this in modify-python-lldb.py, but that's a script I'd like to remove. Instead of running these transformations everytime we run swig, we can just perform equivalent on its input once. This patch can be reproduced (e.g. for downstream merges) with the following "sweet" perl command: perl -i -p -e 'BEGIN{ $/ = undef;} s:(" *\n) *//-----*\n:\1:gs; s:^( *)/// ?:\1:gsm; s:^ *//------*\n( *\n)?( *"):\2:gsm; s: *$::gsm; s:\n *"\):"):gsm' scripts/interface/*.i This command produces nearly equivalent python files to those produced by the relevant code in modify-python-lldb.py. The only difference I noticed is that here I am slightly more agressive in removing trailing newlines from docstring comments (the python script seems to leave newlines in class-level docstrings). Reviewers: amccarth, clayborg, jingham, aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D60498 llvm-svn: 358683
* modify-python-lldb.py: (Re)move __len__ and __iter__ supportPavel Labath2019-04-041-0/+23
| | | | | | | | | | | | | | | | Summary: This patch moves the modify-python-lldb code for adding new functions to the SBModule class into the SBModule interface file. As this is the last class using this functionality, I also remove all support for this kind of modifications from modify-python-lldb.py. Reviewers: amccarth, clayborg, jingham Subscribers: zturner, lldb-commits Differential Revision: https://reviews.llvm.org/D60195 llvm-svn: 357680
* Make operator==s consistent between c++ and python APIsPavel Labath2019-04-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: modify-python-lldb.py had code to insert python equality operators to some classes. Some of those classes already had c++ equality operators, and some didn't. This makes the situation more consistent, by removing all equality handilng from modify-python-lldb. Instead, I add c++ operators to classes where they were missing, and expose them in the swig interface files so that they are available to python too. The only tricky case was the SBAddress class, which had an operator== defined as a free function, which is not handled by swig. This function cannot be removed without breaking ABI, and we cannot add an extra operator== member, as that would make equality comparisons ambiguous. For this class, I define a python __eq__ function by hand and have it delegate to the operator!=, which I have defined as a member function. This isn't fully NFC, as the semantics of some equality functions in python changes slightly, but I believe it changes for the better (e.g., previously SBBreakpoint.__eq__ would consider two breakpoints with the same ID as equal, even if they belonged to different targets; now they are only equal if they belong to the same target). Reviewers: jingham, clayborg, zturner Subscribers: jdoerfert, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D59819 llvm-svn: 357463
* Add "operator bool" to SB APIsPavel Labath2019-03-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: Our python version of the SB API has (the python equivalent of) operator bool, but the C++ version doesn't. This is because our python operators are added by modify-python-lldb.py, which performs postprocessing on the swig-generated interface files. In this patch, I add the "operator bool" to all SB classes which have an IsValid method (which is the same logic used by modify-python-lldb.py). This way, we make the two interfaces more constent, and it allows us to rely on swig's automatic syntesis of python __nonzero__ methods instead of doing manual fixups. Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58792 llvm-svn: 355824
* Insert blocks of python code with swig instead of modify-python-lldb.pyPavel Labath2019-02-271-0/+23
| | | | | | | | | | | | | | | | | | | Summary: Swig is perfectly capable of inserting blocks of python code into its output (and we use those fascilities already), so there's no need for this to be done in a post-process step. lldb_iter is a general-purpose utility used from many classes, so I add it to the main swig file. The other two blocks are tied to a specific class, so I add it to the interface file of that class. Reviewers: zturner, jingham, serge-sans-paille Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58350 llvm-svn: 354975
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Target] Do not skip a stop on a breakpoint if a plan was completedAleksandr Urakov2018-11-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes the next situation. On Windows clang-cl makes no stub before the main function, so the main function is located exactly on module entry point. May be it is the same on other platforms. So consider the following sequence: - set a breakpoint on main and stop there; - try to evaluate expression, which requires a code execution on the debuggee side. Such an execution always returns to the module entry, and the plan waits for it there; - the plan understands that it is complete now and removes its breakpoint. But the breakpoint site is still there, because we also have a breakpoint on entry; - StopInfo analyzes a situation. It sees that we have stopped on the breakpoint site, and it sees that the breakpoint site has owners, and no one logical breakpoint is internal (because the plan is already completed and it have removed its breakpoint); - StopInfo thinks that it's a user breakpoint and skips it to avoid recursive computations; - the program continues. So in this situation the program continues without a stop right after the expression evaluation. To avoid this an additional check that the plan was completed was added. Reviewers: jingham, zturner, boris.ulasevich Reviewed by: jingham Tags: #lldb Differential Revision: https://reviews.llvm.org/D53761 llvm-svn: 347974
* Add new API to SBTarget and SBModule classes.Alexander Polyakov2018-07-031-0/+17
| | | | | | | | | | | | | | Summary: The new API allows to find a list of compile units related to target/module. Reviewers: aprantl, clayborg Reviewed By: aprantl Subscribers: jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D48801 llvm-svn: 336200
* Fix typos in documentation.Bruce Mitchener2017-07-191-1/+1
| | | | | | | | | | Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31282 llvm-svn: 308426
* Make some more of the LLDB/SWIG/Python glue Python 3 aware.Zachary Turner2015-10-161-9/+9
| | | | | | | Mostly this is just converting some print statements to print functions. llvm-svn: 250533
* Start to share SWIG interface files between languages.Bruce Mitchener2015-04-241-0/+530
Summary: Move scripts/Python/interface to scripts/interface so that we can start making iterative improvements towards sharing the interface files between multiple languages (each of which would have their own directory as now). Test Plan: Build and see. Reviewers: zturner, emaste, clayborg Reviewed By: clayborg Subscribers: mjsabby, lldb-commits Differential Revision: http://reviews.llvm.org/D9212 llvm-svn: 235676
OpenPOWER on IntegriCloud