summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a typo Debugger::ExecuteIOHanders to Debugger::ExecuteIOHandlers.Siva Chandra2015-02-261-1/+1
| | | | | | | | | | | | | | Test Plan: Build LLDB. Reviewers: zturner, vharron, clayborg Reviewed By: vharron, clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D7894 llvm-svn: 230663
* Allow python command interpreter commands to be interruptable via CTRL+C.Greg Clayton2015-01-271-0/+7
| | | | | | <rdar://problem/17935601> llvm-svn: 227163
* Three related changes to help:Kate Stone2015-01-151-76/+83
| | | | | | | | | | | | | | | | The default help display now shows the alias collection by default, and hides commands whose named begin with an underscore. Help is primarily useful to those unfamiliar with LLDB and should aim to answer typical questions while still being able to provide more esoteric answers when required. To that latter end an argument to include the hidden commands in help has been added, and instead of having a help flag to show aliases there is now one to hide them. This final change might be controversial as it repurposes the -a shorthand as the opposite of its original meaning. The previous implementation of OutputFormattedHelpText was easily confused by embedded newlines. The new algorithm correctly breaks on the FIRST newline or LAST space/tab before the target column count rather than treating all whitespace interchangeably. Command interpreters now have the ability to specify help prologue text and a command prefix string. Neither are used in the current LLDB sources but are required to support REPL-like extensions where LLDB commands must be prefixed and additional help text is required to explain how to access traditional debugging commands. <rdar://problem/17751929> <rdar://problem/16953815> <rdar://problem/16953841> <rdar://problem/16930173> <rdar://problem/16879028> llvm-svn: 226068
* Fixed an issue where you couldn't delete a user defined regex, python, or ↵Greg Clayton2015-01-091-15/+63
| | | | | | | | | | | multi-word command by adding a new "command delete" command. This new command will delete user defined regular commands, but not aliases. We still have "command unalias" to remove aliases as they are currently in different buckets. Appropriate error messages are displayed to inform the user when "command unalias" is used on removable user defined commands that points users to the "command delete" command. Added a test to verify we can remove user defined commands and also verify that "command unalias" fails when used on a user defined command. <rdar://problem/18248300> llvm-svn: 225535
* Audit uses of ConstString::AsCString() to make sure they weren't assumingJim Ingham2014-12-191-1/+1
| | | | | | | | they would always get a non-NULL string back. <rdar://problem/19298575> llvm-svn: 224602
* Added a new regular expression to the "_regexp-break" command ("b" by default):Greg Clayton2014-12-011-0/+1
| | | | | | | | | | (lldb) b /break here/ This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be: (lldb) breakpoint set --source-pattern-regexp 'break here' llvm-svn: 223082
* This is the first step of making lldb able to create target-specific thingsJim Ingham2014-11-221-1/+1
| | | | | | | | | | | | | (e.g. breakpoints, stop-hooks) before we have any targets - for instance in your ~/.lldbinit file. These will then get copied over to any new targets that get created. So far, you can only make stop-hooks. Breakpoints will have to learn to move themselves from target to target for us to get them from no-target to new-target. We should also make a command & SB API way to prime this ur-target. llvm-svn: 222600
* Complete rewrite of interactive editing support for single- and multi-line ↵Kate Stone2014-11-171-36/+63
| | | | | | | | | | | | | | | | | | | input. Improvements include: * Use of libedit's wide character support, which is imperfect but a distinct improvement over ASCII-only * Fallback for ASCII editing path * Support for a "faint" prompt clearly distinguished from input * Breaking lines and insert new lines in the middle of a batch by simply pressing return * Joining lines with forward and backward character deletion * Detection of paste to suppress automatic formatting and statement completion tests * Correctly reformatting when lines grow or shrink to occupy different numbers of rows * Saving multi-line history, and correctly preserving the "tip" of history during editing * Displaying visible ^C and ^D indications when interrupting input or sending EOF * Fledgling VI support for multi-line editing * General correctness and reliability improvements llvm-svn: 222163
* Make the "synchronous" mode actually work without race conditions.Greg Clayton2014-10-211-14/+0
| | | | | | There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be. llvm-svn: 220254
* Remove LLDB_DEFAULT_SHELL #define, and determine this at runtime.Zachary Turner2014-10-201-1/+5
| | | | | | | Differential Revision: http://reviews.llvm.org/D5805 Reviewed by: Greg Clayton llvm-svn: 220217
* This adds a "batch mode" to lldb kinda like the gdb batch mode. It will ↵Jim Ingham2014-10-141-2/+97
| | | | | | | | | | | | | | | | 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
* Rework the way we pass "run multiple command" options to the various API's thatJim Ingham2014-10-111-37/+53
| | | | | | | | | | | | | | | do that (RunCommandInterpreter, HandleCommands, HandleCommandsFromFile) to gather the options into an options class. Also expose that to the SB API's. Change the way the "-o" options to the lldb driver are processed so: 1) They are run synchronously - didn't really make any sense to run the asynchronously. 2) The stop on error 3) "quit" in one of the -o commands will not quit lldb - not the command interpreter that was running the -o commands. I added an entry to the run options to stop-on-crash, but I haven't implemented that yet. llvm-svn: 219553
* In cases where you'd use an expression to get a value to insert in a ↵Enrico Granata2014-10-091-3/+5
| | | | | | command, be ready to use synthetic children if they are there. Those are now a source of values, so worth checking for llvm-svn: 219452
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-271-0/+2
| | | | | | | | | | | | lldb/llvm/clang/compiler-rt repos. See http://reviews.llvm.org/D5495 for more details. These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}. llvm-svn: 218568
* Add a comment explaining why we're casting the localEric Christopher2014-09-091-0/+1
| | | | | | variable. llvm-svn: 217456
* Quiet unused variable warning that only occursEric Christopher2014-09-091-0/+1
| | | | | | when compiling optimized. llvm-svn: 217429
* Move the rest of the HostInfo functions over.Zachary Turner2014-08-211-2/+7
| | | | | | | | | This should bring HostInfo up to 99% completion. The remainder of code in Host will be split into instantiatable classes representing host processes, threads, dynamic libraries, and process launching strategies. llvm-svn: 216230
* fix the _regexp-break command to allow quotes around the name:Greg Clayton2014-08-141-1/+1
| | | | | | | | (lldb) b "Foo::Bar::Baz" <rdar://problem/11782098> llvm-svn: 215668
* Fixed an issue where the LLDB command prompt isn't interactive if you use -o ↵Greg Clayton2014-07-311-22/+16
| | | | | | | | | | -O -S -s or specify a file on the command line. This means TAB completion wasn't working and editline wasn't being used. <rdar://problem/17872824> llvm-svn: 214428
* (no commit message)Greg Clayton2014-07-301-1/+12
| | | | llvm-svn: 214319
* Use llvm Support functions to get the user's home directory.Zachary Turner2014-07-281-3/+5
| | | | | | | | | | | Assuming that the user's home directory is at ~ is incorrect on Windows. This patch delegates the request to LLVM's support library, which already provides a cross-platform implementation of this function. Differential Revision: http://reviews.llvm.org/D4674 llvm-svn: 214093
* __arm64__ and __aarch64__ #ifdef adjustmentsTodd Fiala2014-07-091-1/+1
| | | | | | | | Change by Paul Osmialowski See http://reviews.llvm.org/D4379 for details. llvm-svn: 212583
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-271-1/+3
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Rename eExecution*** to eExpression*** to be consistent with the result type.Jim Ingham2014-05-051-10/+10
| | | | llvm-svn: 207945
* Make the Expression Execution result enum available to the SB API layer.Jim Ingham2014-05-051-1/+6
| | | | | | | | | Add a callback that will allow an expression to be cancelled between the expression evaluation stages (for the ClangUserExpressions.) <rdar://problem/16790467>, <rdar://problem/16573440> llvm-svn: 207944
* Fixed CTRL+C related issues:Greg Clayton2014-05-021-0/+19
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Free the strong reference to a lldb::SBDebugger that the script interpreter ↵Greg Clayton2014-04-251-0/+3
| | | | | | was holding onto in the "lldb.debugger" global variable. llvm-svn: 207292
* Make sure that the CommandInterpreter::m_command_io_handler_sp gets reset ↵Greg Clayton2014-04-251-0/+6
| | | | | | | | | | when we quit. Currently if you run _any_ python, python has the "lldb.debugger" global variable and it has a strong reference to a lldb_private::Debugger since it is a lldb::SBDebugger object with a shared pointer. This makes sure that your LLDB command interpreter history is saved each time you quit command line LLDB. llvm-svn: 207164
* Switch NULL to C++11 nullptr in source/InterpreterEd Maste2014-04-201-36/+36
| | | | | | Patch by Robert Matusewicz llvm-svn: 206711
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-2/+2
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* lldb arm64 import.Jason Molenda2014-03-291-1/+1
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Allow line numbers to be shown in multi-line expressions.Greg Clayton2014-03-071-0/+4
| | | | llvm-svn: 203185
* Fix Windows build using portable types for formatting the log outputsDeepak Panickal2014-03-031-7/+7
| | | | llvm-svn: 202723
* Don't print out "script" results twice.Greg Clayton2014-02-051-9/+25
| | | | | | | | We now properly detect when a result object has an immediate output stream and don't echo the results a second time. <rdar://problem/15954906> llvm-svn: 200882
* Fixed output to display correctly for "command source" by fixing the correct ↵Greg Clayton2014-02-051-8/+14
| | | | | | | | | | flags being set. Also emit the "Executing commands" message so it properly only comes out when desired and so it comes out in the right place. <rdar://problem/15992208> llvm-svn: 200875
* Fixed an issue where "command source" would not do the right thing:Greg Clayton2014-02-051-37/+138
| | | | | | | - empty lines in init files would repeat previous command and cause errors to be displayed - all options to control showing the command, its output, if it should stop on error or continue, weren't being obeyed. llvm-svn: 200860
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-115/+207
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* Fix autocompletion for multi-word commands.Greg Clayton2013-12-101-7/+14
| | | | | | <rdar://problem/14183288> llvm-svn: 196949
* Fixed a build warning for a missing switch case.Greg Clayton2013-11-081-0/+3
| | | | llvm-svn: 194295
* This patch does a couple of things. Jim Ingham2013-11-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | It completes the job of using EvaluateExpressionOptions consistently throughout the inferior function calling mechanism in lldb begun in Greg's patch r194009. It removes a handful of alternate calls into the ClangUserExpression/ClangFunction/ThreadPlanCallFunction which were there for convenience. Using the EvaluateExpressionOptions removes the need for them. Using that it gets the --debug option from Greg's patch to work cleanly. It also adds another EvaluateExpressionOption to not trap exceptions when running expressions. You shouldn't use this option unless you KNOW your expression can't throw beyond itself. This is: <rdar://problem/15374885> At present this is only available through the SB API's or python. It fixes a bug where function calls would unset the ObjC & C++ exception breakpoints without checking whether they were set by somebody else already. llvm-svn: 194182
* Fix the command name in the syntax text for _regexp-listBen Langmuir2013-09-261-1/+1
| | | | llvm-svn: 191454
* Added a 'jump' command, similar to GDBs.Richard Mitton2013-09-121-0/+27
| | | | | | | | | This allows the PC to be directly changed to a different line. It's similar to the example python script in examples/python/jump.py, except implemented as a builtin. Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function) llvm-svn: 190572
* Restore -- "end of args" marker for shellEd Maste2013-09-051-1/+1
| | | | | | | I accidentally dropped this in r189879 in the change from /bin/bash to /bin/sh. llvm-svn: 190103
* Add OptionParser.hVirgile Bello2013-09-051-7/+5
| | | | llvm-svn: 190063
* Switch '/bin/bash' to '/bin/sh'Ed Maste2013-09-031-1/+1
| | | | | | | | /bin/sh is more portable, and all systems with /bin/bash are expected to have /bin/sh as well, even if only a link to bash. Review: http://llvm-reviews.chandlerc.com/D1576 llvm-svn: 189879
* Sort out a number of mismatched integer types in order to cut down the ↵Andy Gibbs2013-06-191-9/+9
| | | | | | number of compiler warnings. llvm-svn: 184333
* This patch fixes the issue where our command-line tab completer would ↵Enrico Granata2013-06-181-13/+18
| | | | | | | | | | | | | | | | | sometimes replicate commands e.g. (lldb) pl<TAB> Available completions: platform plugin platform plugin Thanks to Matthew Sorrels for doing work and testing on this issue llvm-svn: 184212
* <rdar://problem/14134716>Enrico Granata2013-06-171-65/+6
| | | | | | | | | | | | This is a rewrite of the command history facility of LLDB It takes the history management out of the CommandInterpreter into its own CommandHistory class It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5) It adds a new --wipe (-w) option to command history to allow clearing the history on demand It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be It adds a test case for the reimplemented facility llvm-svn: 184140
* <rdar://problem/13299214>Enrico Granata2013-06-121-2/+4
| | | | | | Make the error message here more interesting for the user llvm-svn: 183818
* <rdar://problem/12876503>Enrico Granata2013-06-111-1/+10
| | | | | | | Adding a new setting interpreter.stop-command-source-on-error that dictates a default behavior for whether command source should stop upon hitting an error You can still override the setting for each individual invocation with the usual -e setting llvm-svn: 183719
OpenPOWER on IntegriCloud