summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-181-3/+3
| | | | | | No functional change. llvm-svn: 239995
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+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
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-3/+3
| | | | | | | | | | 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
* 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
* 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
* Turn off 'quit' confirmation in lldb-miIlia K2015-03-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: # Turn off interpreter.prompt-on-quit on startup (MI) # Add CommandInterpreter::SetPromptOnQuit # Add SBCommandInterpreter::GetPromptOnQuit/SetPromptOnQuit All tests pass on OS X. Test Plan: ``` -file-exec-and-symbols ~/p/hello -break-insert -f main -exec-run -interpreter-exec console quit ``` Reviewers: abidh, clayborg Reviewed By: abidh, clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8444 llvm-svn: 233034
* Fix broadcasters for interpreter and process:Ilia K2015-03-171-1/+1
| | | | | | | | # Fix CommandInterpreter.Broadcaster name (it should be the same as CommandInterpreter::GetStaticBroadcasterClass()) # Prevent the same error in Process.Broadcaster # Fix SBCommandInterpreter::GetBroadcasterClass (it should call CommandInterpreter::GetStaticBroadcasterClass(), was Communication::GetStaticBroadcasterClass()) llvm-svn: 232500
* Help for _regexp-break wasn't very clear. Added more detailed explanations ↵Greg Clayton2015-03-071-2/+8
| | | | | | | | of all things that can be typed by the _regexp-break command. <rdar://problem/12281058> llvm-svn: 231537
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-041-0/+2
| | | | llvm-svn: 231202
* Fix handling of backslashes in Args parsingPavel Labath2015-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the backslash itself is not removed from the argument, nor there is a way to escape the backslash itself. This leads to surprising results: "a b" c" -> 'a b', 'c' # Here we actually have an unterminated quote, but that is ignored "a b\" c" -> 'a b\" c' # We try to escape the quote. That works but the backslash is not removed. "a b\\" c" -> 'a b\\" c' # Escaping the backslash has no effect. This change changes quote handling to be more shell-like: - single quotes and backquotes are literal and there is no way to escape the closing quote or anything else inside; - inside double quotes you can use backslash to escape the closing quote and another backslash - outside any quotes, you can use backslash to escape quotes, spaces and itself. This makes the parsing more consistent with what the user is familiar and increases the probability that pasting the command line from shell to the "process launch" command "just work". Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7855 llvm-svn: 230955
* 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
OpenPOWER on IntegriCloud