summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
Commit message (Collapse)AuthorAgeFilesLines
* Handle PyLong return values in LLDBSwigPython_CalculateNumChildren.Siva Chandra2015-03-161-4/+24
| | | | | | | | | | | | | | | | | | | | | | Summary: Also, change its return type to size_t to match the return types of its callers. With this change, std::vector and std::list data formatter tests pass on Linux (when using libstdc++) with clang as well as with gcc. These tests have also been enabled in this patch. Test Plan: dotest.py -p <TestDataFormatterStdVector|TestDataFormatterStdList> Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D8337 llvm-svn: 232399
* Strip trailing whitespace from python-wrapper.swigEd Maste2015-03-141-158/+158
| | | | | | (To test the dependency added in r232256.) llvm-svn: 232257
* Bulk of the infrastructure work to allow script commands to be backed by ↵Enrico Granata2015-03-131-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | object instances in addition to free functions This works by creating a command backed by a class whose interface should - at least - include def __init__(self, debugger, session_dict) def __call__(self, args, return_obj, exe_ctx) What works: - adding a command via command script add --class - calling a thusly created command What is missing: - support for custom help - test cases The missing parts will follow over the next couple of days This is an improvement over the existing system as: a) it provides an obvious location for commands to provide help strings (i.e. methods) b) it allows commands to store state in an obvious fashion c) it allows us to easily add features to script commands over time (option parsing and subcommands registration, I am looking at you :-) llvm-svn: 232136
* [swig] Fix some typos in the build scripts.Bruce Mitchener2015-02-262-3/+3
| | | | | | | | | | | | Reviewers: zturner, ki.stfu Reviewed By: zturner, ki.stfu Subscribers: ki.stfu, lldb-commits Differential Revision: http://reviews.llvm.org/D7912 llvm-svn: 230706
* [swig] Generate bindings for SBDebugger::*UseColor().Bruce Mitchener2015-02-261-0/+6
| | | | | | | | | | | | | | | | Summary: These functions were added in 2013, but not added to the SWIG bindings. Reviewers: ki.stfu, clayborg Reviewed By: ki.stfu, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7909 llvm-svn: 230646
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-2/+2
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
* 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-172-127/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Revert "I had recently added a new SBFrame::GetVariables() overload ↵Zachary Turner2015-02-173-6/+64
| | | | | | | | | | | with yet another bool argument"" Reverting this commit led to other failures which I did not see at first. This turned out to be an easy problem to fix, so I added SBVariablesOptions.cpp to the CMakeLists.txt. In the future please try to make sure new files are added to CMake. llvm-svn: 229516
* Revert "I had recently added a new SBFrame::GetVariables() overload with yet ↵Zachary Turner2015-02-173-64/+6
| | | | | | | | | | | | | | another bool argument" This reverts commit r228975. It was causing link errors on the Windows bots, since last Thursday. http://lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/725 Conflicts: lldb.xcodeproj/project.pbxproj llvm-svn: 229514
* Extract SBAttachInfo into own set of files - SBAttachInfo.h, ↵Oleksiy Vyalov2015-02-164-99/+115
| | | | | | SBAttachInfo.cpp and SBAttachInfo.i. llvm-svn: 229346
* os.remove shouldn't fail, if file doesn't existIsmail Pazarbasi2015-02-151-2/+14
| | | | | | | | | | | | | | | Summary: os.remove might throw an exception (of type OSError), if given file doesn't exist. Catch the exception, and ignore it //iff// errno is ENOENT. Rethrow the exception, if errno is not ENOENT. Reviewers: emaste Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6362 llvm-svn: 229334
* Fix build: revert r229148 "Fix argdumper build in cmake (OS X) after ↵Ilia K2015-02-132-194/+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-132-123/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Disable a warning for the python modules as the python C API headersChandler Carruth2015-02-131-0/+7
| | | | | | | trigger this warning. With this, 'ninja' succeeds without warnings for me on Linux. llvm-svn: 229096
* I had recently added a new SBFrame::GetVariables() overload with yet another ↵Enrico Granata2015-02-123-6/+64
| | | | | | | | | | bool argument We talked about it internally - and came to the conclusion that it's time to have an options class This commit adds an SBVariablesOptions class and goes through all the required dance llvm-svn: 228975
* Add an -A option to "break set -p" to search all files for matches. Also ↵Jim Ingham2015-02-121-0/+3
| | | | | | | | | | | add the version of SBTarget::BreakpointCreateBySourceRegex that takes file spec lists to the Python interface, and add a test for this. <rdar://problem/19805037> llvm-svn: 228938
* Introduce the notion of "runtime support values"Enrico Granata2015-02-112-0/+11
| | | | | | | | | | | | A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value rdar://problem/15539930 llvm-svn: 228791
* Fix the LLDB build under Debian KfreebsdSylvestre Ledru2015-02-101-2/+2
| | | | | | | | | | | | | | Summary: I don't know if there is a better way for the change in source/Host/freebsd/ThisThread.cpp Reviewers: emaste Subscribers: hansw, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D7441 llvm-svn: 228710
* And make the globbing behavior available via the SB APIEnrico Granata2015-02-101-0/+6
| | | | llvm-svn: 228660
* Extend SBPlatform with capability to launch/terminate a process remotely. ↵Oleksiy Vyalov2015-02-045-111/+136
| | | | | | | | Integrate this change into test framework in order to spawn processes on a remote target. http://reviews.llvm.org/D7263 llvm-svn: 228230
* Added remote-build.py and wired it into Xcode for Linux and MacOSX+Linux builds.Chaoren Lin2015-02-031-0/+300
| | | | llvm-svn: 227908
* Add logic to ClangASTType and SBType to discover information about vector typesEnrico Granata2015-01-281-0/+6
| | | | llvm-svn: 227383
* Fix darwin-debug build in cmake (OS X)Zachary Turner2015-01-262-2/+77
| | | | | | | | | | | | | 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
* Fix CMake build - add readline dependency on ${PYTHON_LIBRARY}.Oleksiy Vyalov2015-01-231-0/+2
| | | | llvm-svn: 226933
* [cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIXChandler Carruth2014-12-291-2/+2
| | | | | | | | | | | | | | | | | | | | | variable (now provided both by the normal parent LLVM CMake files and by the LLVMConfig.cmake file used by the standalone build). This allows LLDB to build into and install into correctly suffixed libdirs. This is especially significant for LLDB because the python extension building done by CMake directly uses multilib suffixes when the host OS does, and the host OS will not always look back and forth between them. As a consequence, before LLVM, Clang, and LLDB (and every other subproject) had support for using LLVM_LIBDIR_SUFFIX, you couldn't build or install LLDB on a multilib system with its python extensions enabled. With this patch (on top of all the others I have submitted throughout the project), I'm finally able to build and install LLDB on my system with Python support enabled. I'm also able to actually run the LLDB test suite, etc. Now, a *huge* number of the tests still fail on my Linux system, but hey, actually running them and them testing the debugger is a huge step forward. =D llvm-svn: 224930
* Provide CreateValueFromData,Expression at the SBTarget level as well as the ↵Enrico Granata2014-12-171-0/+6
| | | | | | SBValue level; and also make all the implenentations agree on using the matching ValueObject::Create instead of doing code copypastas llvm-svn: 224460
* Add the ability to tag one or more breakpoints with a name. TheseJim Ingham2014-12-161-0/+12
| | | | | | | | | names can then be used in place of breakpoint id's or breakpoint id ranges in all the commands that operate on breakpoints. <rdar://problem/10103959> llvm-svn: 224392
* Provide a SBFrame.register/.reg helper on the Python side of SBFrame to vend ↵Enrico Granata2014-12-151-0/+24
| | | | | | | | | | | | | a flattened view of registers Our actual view of registers is a set of register sets, each one of which contains a subset of the actual registers This makes trivial scripting operations tedious ("I just want to read r7!") This helper allows things like: print lldb.frame.reg["r7"] Fixes rdar://19185662 llvm-svn: 224275
* Add the ability for an SBValue to create a persisted version of itself.Enrico Granata2014-12-081-0/+3
| | | | | | | | | | | | Such a persisted version is equivalent to evaluating the value via the expression evaluator, and holding on to the $n result of the expression, except this API can be used on SBValues that do not obviously come from an expression (e.g. are the result of a memory lookup) Expose this via SBValue::Persist() in our public API layer, and ValueObject::Persist() in the lldb_private layer Includes testcase Fixes rdar://19136664 llvm-svn: 223711
* Enable Python summaries to use custom SBTypeSummaryOptions if the user is so ↵Enrico Granata2014-11-222-1/+17
| | | | | | inclined. Updates to the webdoc will follow llvm-svn: 222593
* Fix mispelled 'ling' Python property to be 'line' inJason Molenda2014-11-222-2/+2
| | | | | | | SBLineEntry and SBDeclaration. Patch from Chris Willmore. <rdar://problem/19054323> llvm-svn: 222592
* Per off-list feedback, this API returns the *first* value with a given name, ↵Enrico Granata2014-11-211-1/+1
| | | | | | not the *only* one. Rename it to reflect that llvm-svn: 222582
* Add an API on SBValueList to find the first value with a given name stored ↵Enrico Granata2014-11-211-0/+4
| | | | | | in the list llvm-svn: 222576
* Shuffle APIs around a little bit, so that if you pass custom summary ↵Enrico Granata2014-11-181-1/+2
| | | | | | options, we don't end up caching the summary hence obtained. You may want to obtain an uncapped summary, but this should not be reflected in the summary we cache. The drawback is that we don't cache as aggressively as we could, but at least you get to have different summaries with different options without having to reset formatters or the SBValue at each step llvm-svn: 222280
* Add documentation for the SBTarget::ReadInstructions andJason Molenda2014-11-181-2/+27
| | | | | | | | | SBTarget::GetInstructions APIs so it's a little clearer to understand which should be used. <rdar://problem/18787018> llvm-svn: 222225
* Add APIs on SBFunction and SBCompileUnit to inquire about the language type ↵Enrico Granata2014-11-172-0/+6
| | | | | | that the function/compile unit is defined in llvm-svn: 222189
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-171-0/+12
| | | | | | | | | | | | | | | | Fixed include: - Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch). - Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. - Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now - Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules: size_t Target::UnloadModuleSections (const ModuleList &module_list); size_t Target::UnloadModuleSections (const lldb::ModuleSP &module_sp); llvm-svn: 222167
* Do not override the existing definition of addr_size when adding new ↵Enrico Granata2014-11-131-2/+2
| | | | | | properties to SBTarget. Fixes rdar://18963842 llvm-svn: 221850
* LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best2014-11-081-1/+1
| | | | llvm-svn: 221570
* Introduce the notion of "type summary options" as flags that can be passed ↵Enrico Granata2014-11-062-1/+28
| | | | | | | | | | | | | down to individual summary formatters to alter their behavior in a formatter-dependent way Two flags are introduced: - preferred display language (as in, ObjC vs. C++) - summary capping (as in, should a limit be put to the amount of data retrieved) The meaning - if any - of these options is for individual formatters to establish The topic of a subsequent commit will be to actually wire these through to individual data formatters llvm-svn: 221482
* Add a few functions to SBType to handle arrays and typedefs. Fixes ↵Enrico Granata2014-10-281-0/+9
| | | | | | rdar://12675166 llvm-svn: 220824
* Add a feature where a string data formatter can now be partially composed of ↵Enrico Granata2014-10-281-0/+38
| | | | | | | | | | | | | | Python summary functions This works similarly to the {thread/frame/process/target.script:...} feature - you write a summary string, part of which is ${var.script:someFuncName} someFuncName is expected to be declared as def someFuncName(SBValue,otherArgument) - essentially the same as a summary function Since . -> [] are the only allowed separators, and % is used for custom formatting, .script: would not be a legitimate symbol anyway, which makes this non-ambiguous llvm-svn: 220821
* Added functions to the C++ API, for the benefit of non-8-bit byte architectures.Matthew Gardiner2014-10-222-0/+105
| | | | | | | | | | | | New functions to give client applications to tools to discover target byte sizes for addresses prior to ReadMemory. Also added GetPlatform and ReadMemory to the SBTarget class, since they seemed to be useful utilities to have. Each new API has had a test case added. http://reviews.llvm.org/D5867 llvm-svn: 220372
* Expose the type-info flags at the public API layer. These flags provide much ↵Enrico Granata2014-10-211-0/+3
| | | | | | more informational content to consumers of the LLDB API than the existing TypeClass. Part of the fix for rdar://18517593 llvm-svn: 220322
* Add typemaps to handle the transformation of Python list of strings into a ↵Enrico Granata2014-10-211-0/+74
| | | | | | 'char const **'. This fixes zephyr's issue with SBTarget::Launch without splitting the API into multiple names llvm-svn: 220306
* Remove unnecessary update of 'name' local.Jason Molenda2014-10-161-1/+0
| | | | | | clang static analyzer fixit. llvm-svn: 219892
* This adds a "batch mode" to lldb kinda like the gdb batch mode. It will ↵Jim Ingham2014-10-142-1/+11
| | | | | | | | | | | | | | | | quit the debugger after all the commands have been executed except if one of the commands was an execution control command that stopped because of a signal or exception. Also adds a variant of SBCommandInterpreter::HandleCommand that takes an SBExecutionContext. That way you can run an lldb command targeted at a particular target, thread or process w/o having to select same before running the command. Also exposes CommandInterpreter::HandleCommandsFromFile to the SBCommandInterpreter API, since that seemed generally useful. llvm-svn: 219654
OpenPOWER on IntegriCloud