summaryrefslogtreecommitdiffstats
path: root/lldb/scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve SBThread's stepping API using SBError parameter.Alexander Polyakov2018-06-201-2/+32
| | | | | | | | | | | | | | Summary: The new methods will allow to get error messages from stepping API. Reviewers: aprantl, clayborg, labath, jingham Reviewed By: aprantl, clayborg, jingham Subscribers: apolyakov, labath, jingham, clayborg, lemo, lldb-commits Differential Revision: https://reviews.llvm.org/D47991 llvm-svn: 335180
* Add a script to setup codesigning on macOS.Frederic Riss2018-06-141-0/+57
| | | | | | | | I've been using this script on a couple machines and it seems to work so I'm putting it out there, maybe other people will find it useful. It is strongly inspired from a similar script in the delve project. llvm-svn: 334743
* Add a new SBTarget::LoadCore() overload which surfaces errors if the load failsLeonard Mosescu2018-06-111-63/+69
| | | | | | | | | | | | | There was no way to find out what's wrong if SBProcess SBTarget::LoadCore(const char *core_file) failed. Additionally, the implementation was unconditionally setting sb_process, so it wasn't even possible to check if the return SBProcess is valid. This change adds a new overload which surfaces the errors and also returns a valid SBProcess only if the core load succeeds: SBProcess SBTarget::LoadCore(const char *core_file, SBError &error); Differential Revision: https://reviews.llvm.org/D48049 llvm-svn: 334439
* Change SWIG output directory when building LLDB.framework with CMakeAlex Langford2018-06-041-1/+1
| | | | | | | | | | | Instead of assuming that SWIG generated files (e.g. lldb.py) will live in scripts, we should set it to $LLDB_PYTHON_TARGET_DIR. This variable is set to scripts, except when building LLDB.framework when it is set to LLDB_FRAMEWORK_DIR. Differential Revision: https://reviews.llvm.org/D47742 llvm-svn: 333968
* Python: adjust the include directoriesSaleem Abdulrasool2018-06-041-6/+5
| | | | | | | Restructure the include search order to adjust for libedit. This ensures that the variables are not unused if they are not defined. llvm-svn: 333863
* build: use cmake to find the libedit contentSaleem Abdulrasool2018-05-221-1/+4
| | | | | | | | Use proper cmake techniques to detect where the libedit package resides. This allows for the use of libedit from an alternative location which is needed for supporting cross-compilation. llvm-svn: 333041
* Enable Python API for OpenBSD.Zachary Turner2018-05-211-0/+3
| | | | | | Patch by David Carlier llvm-svn: 332877
* Add children and child[N] properties to SBValue.i.Jim Ingham2018-05-041-16/+50
| | | | | | Also fixed some bad formatting in SBValue.i. llvm-svn: 331501
* [Commands] Expose statistics through the SBAPI.Davide Italiano2018-04-161-0/+2
| | | | | | | | | The API is `SBStructuredData GetStatistics()`. This allows the command to be used in scripts. <rdar://problem/36555975> llvm-svn: 330165
* Fix the install location of LLDBWrapPython.cpp when buildingAdrian Prantl2018-03-051-1/+3
| | | | | | | | | | | LLDB.framework to point to the build directory where it is expected by the top-level CMakeLists.txt. This should be a no-op in any other configurations. rdar://problem/38005302 llvm-svn: 326743
* Add SBDebugger::GetBuildConfiguration and use it to skip an XML testPavel Labath2018-02-191-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This adds a SBDebugger::GetBuildConfiguration static function, which returns a SBStructuredData describing the the build parameters of liblldb. Right now, it just contains one entry: whether we were built with XML support. I use the new functionality to skip a test which requires XML support, but concievably the new function could be useful to other liblldb clients as well (making sure the library supports the feature they are about to use). Reviewers: zturner, jingham, clayborg, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43333 llvm-svn: 325504
* Remove an errant ^S Jim Ingham2018-02-071-1/+1
| | | | | | (still can't get over those Emacs habits...) llvm-svn: 324509
* Change SBProcess::ReadCStringFromMemory() back to returningJason Molenda2017-12-221-1/+2
| | | | | | | | | an empty Python string object when it reads a 0-length string out of memory (and a successful SBError object). <rdar://problem/26186692> llvm-svn: 321338
* Revert r317182 for https://reviews.llvm.org/D39128Jason Molenda2017-11-021-8/+0
| | | | | | | we're still failing on android. I'll ask Larry to ask Pavel for any tips he might be able to give. llvm-svn: 317183
* Commit Lawrence D'Anna's patch to changeJason Molenda2017-11-021-0/+8
| | | | | | | | | | | | | | | SetOututFileHandle to work with IOBase. I did make one change after checking with Larry -- I renamed SBDebugger::Flush to FlushDebuggerOutputHandles and added a short docstring to the .i file to make it a little clearer under which context programs may need to use this API. Differential Revision: https://reviews.llvm.org/D39128 <rdar://problem/34870417> llvm-svn: 317182
* Ahhhh roll back that commit, I didn't see that Lawrence had filedJason Molenda2017-11-021-8/+0
| | | | | | | a separate phabracator with the revised change. This was his first atttempt which broke on the bots the second time too. llvm-svn: 317181
* Commit Lawrence D'Anna's patch to changeJason Molenda2017-11-021-0/+8
| | | | | | | | | | | | | | SetOututFileHandle to work with IOBase. I did make one change after checking with Larry -- I renamed SBDebugger::Flush to FlushDebuggerOutputHandles and added a short docstring to the .i file to make it a little clearer under which context programs may need to use this API. Differential Revision: https://reviews.llvm.org/D38829 llvm-svn: 317180
* Fix LLVM_LINK_LLVM_DYLIB build (pr35053)Pavel Labath2017-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r316368 broke this build when it introduced a reference to a pthread function to the Utility module. This caused cmake to generate an incorrect link line (wrong order of libs) because it did not see the dependency from Utility to the system libraries. Instead these libraries were being manually added to each final target. This changes moves the dependency management from the individual targets to the lldbUtility module, which is consistent with how llvm does it. The final targets will pick up these libraries as they will be a part of the link interface of the module. Technically, some of these dependencies could go into the host module, as that's where most of the os-specific code is, but I did not try to investigate which ones. Reviewers: zturner, sylvestre.ledru Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D39246 llvm-svn: 316997
* Reverting r315966 - it caused a build failure on an ubuntu x android bot.Jason Molenda2017-10-171-3/+0
| | | | llvm-svn: 315967
* Committing this for Larry D'Anna:Jason Molenda2017-10-171-0/+3
| | | | | | | | | | | This patch adds support for passing an arbitrary python stream (anything inheriting from IOBase) to SetOutputFileHandle or SetErrorFileHandle. Differential revision: https://reviews.llvm.org/D38829 <rdar://problem/34870417> llvm-svn: 315966
* Implement interactive command interruptionLeonard Mosescu2017-10-051-6/+8
| | | | | | | | | | | | | | | | | | | The core of this change is the new CommandInterpreter::m_command_state, which models the state transitions for interactive commands, including an "interrupted" state transition. In general, command interruption requires cooperation from the code executing the command, which needs to poll for interruption requests through CommandInterpreter::WasInterrupted(). CommandInterpreter::PrintCommandOutput() implements an optionally interruptible printing of the command output, which for large outputs was likely the longest blocking part. (ex. target modules dump symtab on a complex binary could take 10+ minutes) Differential Revision: https://reviews.llvm.org/D37923 llvm-svn: 315037
* Revert patch r313904, as it breaks "command source" and in Jim Ingham2017-09-281-8/+6
| | | | | | | | | | | | particular causes lldb to die on startup if you have a ~/.lldbinit file. I filed: https://bugs.llvm.org/show_bug.cgi?id=34758 to cover fixing the bug. llvm-svn: 314371
* Change build-llvm.py and build-lldb-llvm-clang's patching mechanisms toJason Molenda2017-09-272-3/+3
| | | | | | | | assume git-style diffs. Committing for Francis Ricci. Differential Revision: https://reviews.llvm.org/D38328 llvm-svn: 314366
* [LLDB] Implement interactive command interruptionAdrian McCarthy2017-09-211-6/+8
| | | | | | | | | | | | | | | | | | | | | The core of this change is the new CommandInterpreter::m_command_state, which models the state transitions for interactive commands, including an "interrupted" state transition. In general, command interruption requires cooperation from the code executing the command, which needs to poll for interruption requests through CommandInterpreter::WasInterrupted(). CommandInterpreter::PrintCommandOutput() implements an optionally interruptible printing of the command output, which for large outputs was likely the longest blocking part. (ex. target modules dump symtab on a complex binary could take 10+ minutes) patch by lemo Differential Revision: https://reviews.llvm.org/D37923 llvm-svn: 313904
* Wire up the breakpoint name help string.Jim Ingham2017-09-151-0/+3
| | | | llvm-svn: 313327
* Make breakpoint names real entities.Jim Ingham2017-09-147-6/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When introduced, breakpoint names were just tags that you could apply to breakpoints that would allow you to refer to a breakpoint when you couldn't capture the ID, or to refer to a collection of breakpoints. This change makes the names independent holders of breakpoint options that you can then apply to breakpoints when you add the name to the breakpoint. It adds the "breakpoint name configure" command to set up or reconfigure breakpoint names. There is also full support for then in the SB API, including a new SBBreakpointName class. The connection between the name and the breakpoints sharing the name remains live, so if you reconfigure the name, all the breakpoint options all change as well. This allows a quick way to share complex breakpoint behavior among a bunch of breakpoints, and a convenient way to iterate on the set. You can also create a name from a breakpoint, allowing a quick way to copy options from one breakpoint to another. I also added the ability to make hidden and delete/disable protected names. When applied to a breakpoint, you will only be able to list, delete or disable that breakpoint if you refer to it explicitly by ID. This feature will allow GUI's that need to use breakpoints for their own purposes to keep their breakpoints from getting accidentally disabled or deleted. <rdar://problem/22094452> llvm-svn: 313292
* Fixed a typo in the example (getName -> GetName)Jim Ingham2017-08-241-4/+4
| | | | | | | but while I was at it I converted the example to use properties, since that's much nicer looking. llvm-svn: 311679
* Expose active and available platform lists via SBDebugger APIVadim Macagon2017-08-091-0/+28
| | | | | | | | | | | | Summary: The available platform list was previously only accessible via the `platform list` command, this patch makes it possible to access that list via the SBDebugger API. The active platform list has likewise been exposed via the SBDebugger API. Differential Revision: https://reviews.llvm.org/D35760 llvm-svn: 310452
* Add an auto-continue flag to breakpoints & locations.Jim Ingham2017-08-032-0/+8
| | | | | | | | | | | | | | You can get a breakpoint to auto-continue by adding "continue" as a command, but that has the disadvantage that if you hit two breakpoints simultaneously, the continue will force the process to continue, and maybe even forstalling the commands on the other. The auto-continue flag means the breakpoints can negotiate about whether to stop. Writing tests, I wanted to supply some commands when I made the breakpoints, so I also added that ability. llvm-svn: 309969
* Fix a mis-feature with propagation of breakpoint options -> location options.Jim Ingham2017-08-022-0/+37
| | | | | | | | | | | | | | When an option was set at on a location, I was just copying the whole option set to the location, and letting it shadow the breakpoint options. That was wrong since it meant changes to unrelated options on the breakpoint would no longer take on this location. I added a mask of set options and use that for option propagation. I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands since I wanted to use them to write some more test cases. <rdar://problem/24397798> llvm-svn: 309772
* Expose process instance info via SB APIVadim Macagon2017-08-013-0/+80
| | | | | | | | | | | Summary: Implement SBProcessInfo to wrap lldb_private::ProcessInstanceInfo, and add SBProcess::GetProcessInfo() to retrieve info like parent ID, group ID, user ID etc. from a live process. Differential Revision: https://reviews.llvm.org/D35881 llvm-svn: 309664
* [build-script] Bring in modernizations from downstream:Sean Callanan2017-07-312-8/+32
| | | | | | | | | | | - Don't do any checks of the current SCM repository if the llvm repositories are already there. Useful for bots. - When symlinking, remove old symlinks. - Support loading build-script as a library, not necessarily under Xcode. - Stringify args before passing them to subprocess. llvm-svn: 309631
* [CMake] Rework construction of framework bundleChris Bieneman2017-07-251-0/+13
| | | | | | This adds an explicit step for processing the headers and restructures how the framework bundles are constructed. This should make the frameworks more reliably constructed. llvm-svn: 309024
* Expose hit count via SBBreakpointLocation.Bruce Mitchener2017-07-191-0/+3
| | | | | | | | | | | | | | | Summary: SBBreakpointLocation exposed the ignore count, but didn't expose the hit count. Both values were exposed by SBBreakpoint and SBWatchpoint, so this makes things a bit more consistent. Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31283 llvm-svn: 308480
* Fix typos in documentation.Bruce Mitchener2017-07-193-3/+3
| | | | | | | | | | Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31282 llvm-svn: 308426
* Make scripts/analyze-project-deps.py executablePavel Labath2017-06-291-1/+3
| | | | llvm-svn: 306669
* [build system] If there's an OVERRIDE, don't guess the current SCM.Sean Callanan2017-06-272-0/+14
| | | | | | | | This makes automatic checkout work even in situations where the current repository can't be determined, such as in the case of a Git tag. llvm-svn: 306460
* Fix a python object leak in SWIG glue.Zachary Turner2017-06-211-1/+2
| | | | | | | | | | PyObject_CallFunction returns a PyObject which needs to be decref'ed when it is no longer needed. Patch by David Luyer Differential Revision: https://reviews.llvm.org/D33740 llvm-svn: 305873
* [swig] Improve the native module import logicPavel Labath2017-06-151-1/+7
| | | | | | | | | | | | | | | The simple module import logic was not sufficient for our distribution model of lldb, which is without the _lldb.pyd file (normally that would be a symlink to the shared library, but symlinks are not really a thing on windows). With the older swigs it worked (loading of the python scripting machinery from within lldb) because the normal swig import logic contained a last-ditch import of a global module _lldb (which is defined when you run python from lldb). Add back the last-ditch import to our custom import logic as well. llvm-svn: 305461
* Added new API to SBStructuredData classAbhishek Aggarwal2017-05-291-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Added API to access data types -- integer, double, array, string, boolean and dictionary data types -- Earlier user had to parse through the string output to get these values - Added Test cases for API testing - Added new StructuredDataType enum in public include file -- Replaced locally-defined enum in StructuredData.h with this new one -- Modified other internal files using this locally-defined enum Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: clayborg, lldb-commits Reviewed By: clayborg Subscribers: labath Differential Revision: https://reviews.llvm.org/D33434 llvm-svn: 304138
* Add support for new (3.0.11+) swigsPavel Labath2017-05-231-1/+17
| | | | | | | | | | | | | | | | Summary: A change in swig 3.0.9 has caused it to generate modules incompatible with us using them as __init__.py (bug #769). Swig 3.0.11 adds a setting to help fix this problem, so use that. Support for older versions of swig remains unaffected. Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D33409 llvm-svn: 303627
* Import sys in repo.py.Lang Hames2017-05-091-0/+1
| | | | | | | The find function in repo.py calls sys.exit on error. Without this import that call to exit will fail, masking the actual error message. This patch fixes that. llvm-svn: 302584
* [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.Nitesh Jain2017-05-042-0/+6
| | | | | | | | | | Reviewers: jingham, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32168 llvm-svn: 302139
* Initial implementation of SB APIs for Tracing support.Ravitheja Addepally2017-04-265-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces new SB APIs for tracing support inside LLDB. The idea is to gather trace data from LLDB and provide it through this APIs to external tools integrating with LLDB. These tools will be responsible for interpreting and presenting the trace data to their users. The patch implements the following new SB APIs -> -> StartTrace - starts tracing with given parameters -> StopTrace - stops tracing. -> GetTraceData - read the trace data . -> GetMetaData - read the meta data assosciated with the trace. -> GetTraceConfig - read the trace configuration Tracing is associated with a user_id that is returned by the StartTrace API and this id needs to be used for accessing the trace data and also Stopping the trace. The user_id itself may map to tracing the complete process or just an individual thread. The APIs require an additional thread parameter when the user of these APIs wishes to perform thread specific manipulations on the tracing instances. The patch also includes the corresponding python wrappers for the C++ based APIs. Reviewers: k8stone, lldb-commits, clayborg Reviewed By: clayborg Subscribers: jingham, mgorny Differential Revision: https://reviews.llvm.org/D29581 llvm-svn: 301389
* Teach SBFrame how to guess its language.Jim Ingham2017-04-121-0/+8
| | | | | | <rdar://problem/31411646> llvm-svn: 300012
* [analyze deps] Show incoming and outgoing counts on island members.Zachary Turner2017-03-221-2/+13
| | | | llvm-svn: 298535
* [analyze deps] Also show cycle islands.Zachary Turner2017-03-221-0/+14
| | | | | | | | | | | | | | | | | | | We currently display a list of all minimal cycles, but it's useful to be able to see the big picture impact of these cycles by merging them all together into groups of interconnected components. Because the cycle discovery algorithm only considers "minimal" cycles, it discards all information for dependencies which are not considered part of the minimal cycle. So all we know is that the components of each island definitely all depend on each other but it's still possible that there are hidden dependencies due to transitive includes. The cycle list should still be the authoritative reference for deciding where the easiest places to break cycles are, though. llvm-svn: 298530
* [deps script] Sort cycles by the difficulty of breaking.Zachary Turner2017-03-211-7/+30
| | | | | | | | | When passing --discover-cycles and --show-counts, it displays the number of dependencies between each hop of the cycle, and sorts by the sum. Dependencies at the top of the list should be the easiest to break. llvm-svn: 298455
* [analyze-project-deps.py] Add the ability to list all cycles.Zachary Turner2017-03-201-1/+77
| | | | | | | | | | | | | | This analyzes the dependency graph and computes all minimal cycles. Equivalent cycles that differ only by rotation are excluded, as are cycles that are "super-cycles" of other smaller cycles. For example, if we discover the cycle A -> C -> A, and then later A -> B -> C -> D -> A, this latter cycle is not considered. Thus, it is possible that after eliminating some cycles, new ones will appear. However, this is the only way to make the algorithm terminate in a reasonable amount of time. llvm-svn: 298324
* A few improvements to deps analysis scripts.Zachary Turner2017-03-061-26/+42
| | | | | | | | 1) Looks in Plugins and clang 2) Adds a mode to display the deps sorted by the number of times the deps occurs in a particular project llvm-svn: 297036
OpenPOWER on IntegriCloud