summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Clear alias argument vector for 'p' alias.Chaoren Lin2016-02-261-0/+2
| | | | | | | | | | | | Summary: This fixes the 'p' command which should be aliased to 'expresion --'. Reviewers: jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17634 llvm-svn: 261969
* Add the "block" keyword to "thread step-in -e", and an alias that uses it: ↵Jim Ingham2016-02-261-2/+8
| | | | | | | | | "sif <target function>" - i.e. step-into-function to allow you to step through a complex calling sequence into a particular function that may span multiple lines. Also some test cases for this and the --step-target feature. llvm-svn: 261953
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-0/+1
| | | | | | the right thing and break. llvm-svn: 261950
* This patch stops lldb from loading a .lldbinit file from the currentJason Molenda2016-02-191-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | working directory by default -- a typical security problem that we need to be more conservative about. It adds a new target setting, target.load-cwd-lldbinit which may be true (always read $cwd/.lldbinit), false (never read $cwd/.lldbinit) or warn (warn if there is a $cwd/.lldbinit and don't read it). The default is set to warn. If this is met with unhappiness, we can look at changing the default to true (to match current behavior) on a different platform. This does not affect reading of ~/.lldbinit - that will still be read, as before. If you run lldb in your home directory, it will not warn about the presence of a .lldbinit file there. I had to add two SB API - SBHostOS::GetUserHomeDirectory and SBFileSpec::AppendPathComponent - for the lldb driver code to be able to get the home directory path in an OS neutral manner. The warning text is There is a .lldbinit file in the current directory which is not being read. To silence this warning without sourcing in the local .lldbinit, add the following to the lldbinit file in your home directory: settings set target.load-cwd-lldbinit false To allow lldb to source .lldbinit files in the current working directory, set the value of this variable to true. Only do so if you understand and accept the security risk. <rdar://problem/24199163> llvm-svn: 261280
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-163-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Per Jim's suggestion, move checks that we're not mixing and matching ↵Enrico Granata2016-02-061-1/+9
| | | | | | | | Debuggers and Commands deeper in the bowels of LLDB NFC llvm-svn: 259972
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-51/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Fix a glitch in the Driver's batch mode when used with "attach". Jim Ingham2016-01-082-2/+6
| | | | | | | | | | | | | | Batch mode is supposed to stop execution and return control to the user when an exceptional stop occurs (crash, signal or instrumentation). But attach always stops with a SIGSTOP on OSX (maybe on Linux too?) which would short circuit the rest of the commands given. This change allows a command result object to indicate that it expected to leave the process stopped with an exceptional stop reason, and it is okay for batch mode to keep going. <rdar://problem/22243143> llvm-svn: 257120
* Addresses an unsigned underflow situation that can occur when dumping an ↵Kate Stone2016-01-061-2/+2
| | | | | | | | empty command history. One example where this occurs in practice is starting the Swift REPL and typing ":command history" since REPL commands aren't stored in the LLDB command prompt history. llvm-svn: 256888
* remove defunct scripts/build-swig-wrapper-classes.sh; switch autoconf build ↵Todd Fiala2015-11-181-2/+2
| | | | | | | | to prepare_bindings.py. Xcode moved off of build-swig-wrapper-classes.sh earlier this week. llvm-svn: 253490
* LLDB needs a mutex around getopt_long_only() function calls to avoid ↵Jim Ingham2015-11-051-3/+6
| | | | | | | | multi-threading option parsing issues. <rdar://problem/17052381> llvm-svn: 252111
* Fix Clang-tidy modernize-use-override warnings in some files in source; ↵Eugene Zelenko2015-10-261-8/+6
| | | | | | other minor fixes. llvm-svn: 251309
* Added the concept of a Read-Eval-Print-Loop to LLDB.Sean Callanan2015-10-191-1/+10
| | | | | | | | | | | | | | | | A REPL takes over the command line and typically treats input as source code. REPLs can also do code completion. The REPL class allows its subclasses to implement the language-specific functionality without having to know about the IOHandler-specific internals. Also added a PluginManager-based way of getting to a REPL given a language and a target. Also brought in some utility code and expression options that are useful for REPLs, such as line offsets for expressions, ANSI terminal coloring of errors, and a few IOHandler convenience functions. llvm-svn: 250753
* Silence -Wqual-cast warnings from GCC 5.2Saleem Abdulrasool2015-10-181-3/+3
| | | | | | | | There were a number of const qualifiers being cast away which caused warnings. This cluttered the output hiding real errors. Silence them by explicit casting. NFC. llvm-svn: 250662
* Make some more of the LLDB/SWIG/Python glue Python 3 aware.Zachary Turner2015-10-161-6/+9
| | | | | | | Mostly this is just converting some print statements to print functions. llvm-svn: 250533
* Added support for enumerating the languages that actually support TypeSystemsSean Callanan2015-10-081-2/+9
| | | | | | | and expressions. Also wired that into the OptionValue infrastructure, although it isn't used for tab-completion yet. llvm-svn: 249769
* Move the "run" alias from process launch --shell to process launch ↵Enrico Granata2015-09-221-0/+8
| | | | | | | | | | --shell-expand-args when building on OS X The argdumper-based launching is more friendly to System Integrity Protection, and will work on older releases of OS X as well Leave non-Apple builds alone llvm-svn: 248338
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Fix tab completion for command arguments containing spacesTamas Berghammer2015-09-022-3/+33
| | | | | | | | | | | If a command argument contains a space then it have to be escaped with backslash signs so the argument parsing logic can parse it properly. This CL fixes the tab completion code for the arguments to create complitions with correctly escaped strings. Differential revision: http://reviews.llvm.org/D12531 llvm-svn: 246639
* Move things from the LanguageRuntime that obviously belong in the new ↵Jim Ingham2015-09-023-7/+9
| | | | | | Language plugin instead. llvm-svn: 246611
* Convert the ScriptInterpreter system to a plugin-based one.Zachary Turner2015-07-305-3836/+28
| | | | | | | | | | | | | | | | | | | | | | | Previously embedded interpreters were handled as ad-hoc source files compiled into source/Interpreter. This made it hard to disable a specific interpreter, or to add support for other interpreters and allow the developer to choose which interpreter(s) were enabled for a particular build. This patch converts script interpreters over to a plugin-based system. Script interpreters now live in source/Plugins/ScriptInterpreter, and the canonical LLDB interpreter, ScriptInterpreterPython, is moved there as well. Any new code interfacing with the Python C API must live in this location from here on out. Additionally, generic code should never need to reference or make assumptions about the presence of a specific interpreter going forward. Differential Revision: http://reviews.llvm.org/D11431 Reviewed By: Greg Clayton llvm-svn: 243681
* Add a more tweakable way for ValueObjectPrinter to control pointer ↵Enrico Granata2015-07-271-1/+1
| | | | | | expansion. NFC. llvm-svn: 243301
* Add UNUSED_IF_ASSERT_DISABLED and apply it.Bruce Mitchener2015-07-241-2/+1
| | | | | | | | | | | | | | | Summary: This replaces (void)x; usages where they x was subsequently involved in an assertion with this macro to make the intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11451 llvm-svn: 243074
* Fix typos.Bruce Mitchener2015-07-222-2/+2
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* Add support for specifying a language to use when parsing breakpoints.Dawn Perchik2015-07-212-3/+24
| | | | | | | | | | | | | | | | | | | | Target and breakpoints options were added: breakpoint set --language lang --name func settings set target.language pascal These specify the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints on identifiers). If the breakpoint language is not set, the target.language setting is used. This support is required by Pascal, for example, to set breakpoint at 'ns.foo' for function 'foo' in namespace 'ns'. Tests on the language were also added to Module::PrepareForFunctionNameLookup for efficiency. Reviewed by: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D11119 llvm-svn: 242844
* The session dictionary attached to a Python interpeter holds variables the ↵Enrico Granata2015-07-211-0/+8
| | | | | | | | | | | | user creates in the script interpreter This can include objects that have complex state and need to be torn down intelligently (e.g. our SB* objects) This will fail if the Python interpreter does not hold a valid thread state. So, acquire one, delete the session dictionary, and then let go of it on destruction This fixes rdar://20960843 llvm-svn: 242745
* Fixed line wrapping for the "long help" content in LLDB commands. Content ↵Kate Stone2015-07-141-2/+24
| | | | | | | | | | is now dynamically wrapped for the column width of the current terminal. Lines that begin with whitespace will be indented identically on subsequent lines to maintain formatting. Existing commands supplying this type of help content have been reworked to take advantage of the changes. In addition to formatting changes, content was changes for accuracy and clarity purposes. <rdar://problem/21269977> llvm-svn: 242122
* Add new bugreport command to lldbTamas Berghammer2015-07-021-0/+2
| | | | | | | | | | | The new command add functionality to print out domain specific information for reporting a bug. Currently the only supported domain is stack unwinding (with "bugreport unwind") but adding new domains is fairly easy. Differential revision: http://reviews.llvm.org/D10868 llvm-svn: 241252
* Fix a variety of typos.Bruce Mitchener2015-06-183-6/+6
| | | | | | No functional change. llvm-svn: 239995
* If a candidate keyword contains quotes, it's clearly not a keyword, so bail ↵Enrico Granata2015-06-151-0/+12
| | | | | | | | | | out early There are other characters we could optimize for (any non-letter pretty much), but keyword.iskeyword() will handle them, whereas quotes do have the potential to confuse us, so they actually need custom handling Fixes rdar://problem/21022787 llvm-svn: 239779
* Fix a bug where passing a value of the type "A B" to settings set ↵Enrico Granata2015-06-151-0/+6
| | | | | | | | target.env-vars would cause LLDB to crash Fixes rdar://problem/21241817 llvm-svn: 239766
* Fixed "format-string" based settings so they can have quotes on them without ↵Greg Clayton2015-06-031-1/+20
| | | | | | | | | | | | | | leaving the quotes in the format string: (lldb) settings set thread-format "abc" (lldb) settings set thread-format 'abc' (lldb) settings set thread-format abc We strip the quotes before processing the format string and return an "error: mismatched quotes" if mismatched quotes are given. <rdar://problem/21210789> llvm-svn: 238896
* Unbreak mac build.Greg Clayton2015-05-291-0/+2
| | | | llvm-svn: 238590
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-2920-40/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Remove unused #includes of ScriptInterpreterPython.hZachary Turner2015-05-282-3/+0
| | | | llvm-svn: 238470
* Improve LLDB prompt handlingPavel Labath2015-05-271-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix we have in for this is not working all the time and is introducing unnecessary delays. This change does: - Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to lldb-dev. - coordinates printing of asynchronous text with the iohandlers. This is also based on a (different) Greg's patch, but I have added stronger synchronization to it to avoid races. Together, these changes solve the prompt problem for me on linux (both with and without libedit). I think they should behave similarly on Mac and FreeBSD and I think they will not make matters worse for windows. Test Plan: Prompt comes out alright. All tests still pass on linux. Reviewers: clayborg, emaste, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9823 llvm-svn: 238313
* Add support for custom commands to set flags on themselvesEnrico Granata2015-05-272-15/+87
| | | | | | | | | This works for Python commands defined via a class (implement get_flags on your class) and C++ plugin commands (which can call SBCommand::GetFlags()/SetFlags()) Flags allow features such as not letting the command run if there's no target, or if the process is not stopped, ... Commands could always check for these things themselves, but having these accessible via flags makes custom commands more consistent with built-in ones llvm-svn: 238286
* Fix use-after-free in OptionValueString.Zachary Turner2015-05-221-1/+1
| | | | | | | We were assigning a temporary std::string to a StringRef. Somehow this worked on every platform but Windows. llvm-svn: 238041
* Fixed a ton of gcc compile warningsVince Harron2015-05-135-12/+19
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Add language command and LanguageRuntime plugin changes to allow vending of ↵Colin Riley2015-05-041-0/+2
| | | | | | | | command objects. Differential Revision: http://reviews.llvm.org/D9402 llvm-svn: 236443
* Don't return nullptr when you mean to return an empty llvm::StringRef...Jim Ingham2015-04-301-1/+1
| | | | | | <rdar://problem/20747164> llvm-svn: 236287
* Start to share SWIG interface files between languages.Bruce Mitchener2015-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Factor resolution of abbreviations and aliases so that they can be tested ↵Adrian McCarthy2015-04-231-201/+221
| | | | | | directly. http://reviews.llvm.org/D9033 llvm-svn: 235633
* This is some groundwork for filtering the language ExceptionJim Ingham2015-04-221-0/+1
| | | | | | | | | | | | | | breakpoints, for instance on the class of the thrown object. This change doesn't actually make that work, the part where we extract the thrown object type from the throw site isn't done yet. This provides a general programmatic "precondition" that you can add to breakpoints to give them the ability to do filtering on the LLDB side before we pass the stop on to the user-provided conditions & callbacks. llvm-svn: 235538
* Fix "help language", the languages printer was assuming the Jim Ingham2015-04-171-6/+3
| | | | | | | eLanguageType numbers would be sequential, but vendor types are not and the printer went crazy. llvm-svn: 235153
* Making linking against Python simpler on Windows.Zachary Turner2015-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patch deprecates the three Python CMake variables in favor of a single variable PYTHON_HOME which points to the root of a python installation. Since building Python doesn't output the files in a structure that is compatible with the PYTHONHOME environment variable, we also provide a script install_custom_python.py which will copy the output of a custom python build to the correct directory structure. The supported workflow after this patch will be to build python once for each configuration and architecture {Debug,Release} x {x86,x64} and then run the script. Then run CMake specifying -DPYTHON_HOME=<path> The first time you do this will probably require you to delete your CMake cache. The old workflow is still supported during a transitionary period, but a warning is printed at CMake time, and this will eventually be removed. Differential Revision: http://reviews.llvm.org/D8979 llvm-svn: 234660
* Fix a problem where 'process launch' was not correctly re-quoting arguments ↵Enrico Granata2015-04-101-1/+2
| | | | | | | | for the inferior process when handing them down for the actual launch This covers most of rdar://20490076, but leaves one corner case still open - namely the case where we try to have arguments of the form foo\ bar (unquoted, but slashed) go through argdumper llvm-svn: 234554
* [Python] Fix issue configuring sys.path during startup.Zachary Turner2015-04-091-27/+30
| | | | | | | | | | Previously, users on Windows had to manually specify PYTHONPATH to point to the site-packages directory before running LLDB. The reason for this was because sys.path was being initialized with a path containing unescaped backslashes, causing escape sequences to end up in the paths. llvm-svn: 234516
* Fix check for options in "command alias"Ted Woodward2015-04-061-3/+3
| | | | | | | | | | | | | | | | | Summary: "command alias" can add invalid options to the command. "command alias start process launch -s" will add an extra argument, "<no-argument>" to the alias, so it runs "process launch -s <no-argument>", which launches the process with args that include "<no-argument>". This patch changes the text compare of the variable value with "<OptionParser::eNoArgument>" to a compare of variable value_type with OptionParser::eNoArgument. It also moves the previous test inside the if, so it won't add a trailing space if there is no argument. Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8844 llvm-svn: 234244
* Fix warnings generated by clang-cl.Zachary Turner2015-04-021-7/+4
| | | | | | | | | | | | | | There were a couple of real bugs here regarding error checking and signed/unsigned comparisons, but mostly these were just noise. There was one class of bugs fixed here which is particularly annoying, dealing with MSVC's non-standard behavior regarding the underlying type of enums. See the comment in lldb-enumerations.h for details. In short, from now on please use FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which contain values larger than can fit into a signed integer. llvm-svn: 233943
OpenPOWER on IntegriCloud