summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free ↵Enrico Granata2016-03-081-16/+0
| | | | | | template function in lldb_private llvm-svn: 262905
* Unbreak linux build broken by r262901Jason Molenda2016-03-081-1/+1
| | | | llvm-svn: 262904
* Move ProcessAliasOptionsArgs to be a static on CommandAlias; it wasn't using ↵Enrico Granata2016-03-081-58/+58
| | | | | | | | any instance data on the CommandInterpreter anyway This small step removes one piece of alias machinery from the CommandInterpreter into the CommandAlias llvm-svn: 262901
* Change the way command aliases are stored. Go from a model where a map holds ↵Enrico Granata2016-03-082-142/+80
| | | | | | | | | | | the alias -> underlying command binding and another map holds the alias -> options, to a model where one single map holds the alias -> (all useful data) combination Right now, obviously, this is just the pair of (CommandObjectSP,OptionArgVectorSP), so NFC This is step one of a larger - and tricky - refactoring which will turn command aliases into interesting objects instead of passive storage that the command interpreter does smart things to This refactoring, in turn, will allow us to do interesting things with aliases, such as intelligent and customizable help llvm-svn: 262900
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-071-1/+1
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Change the user-visible name for the argument type language to source-languageEnrico Granata2016-02-291-1/+1
| | | | | | | | This makes it so that help language provides help on the language command and help source-language provides the list of source languages one can pass as an option Fixes rdar://24869942 llvm-svn: 262259
* 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
OpenPOWER on IntegriCloud