summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Apropos should search user commands as well as built-in commands.Jim Ingham2013-05-171-14/+39
| | | | | | rdar://problem/13916722 llvm-svn: 182068
* <rdar://problem/13892319>Greg Clayton2013-05-151-1/+1
| | | | | | The command "po" by itself yields odd errors. I fixed the alias. llvm-svn: 181856
* If HandleCommands is called with add_to_history set to false, turn on the ↵Jim Ingham2013-05-021-1/+7
| | | | | | | | m_command_source_depth so that when we forget the value for regex & alias commands it still stays off. <rdar://problem/13795202> llvm-svn: 180971
* Look for an inexact match in just the commands before searching the alias ↵Matt Kopec2013-04-231-2/+7
| | | | | | commands as well. llvm-svn: 180117
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-12/+12
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-12/+12
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Removed the "expr" alias for "expression," whichSean Callanan2013-04-171-3/+1
| | | | | | | is entirely unnecessary and confuses the command interpreter when the user types "exp". llvm-svn: 179691
* Allow partial matching for alias commands as well as regular commands.Jim Ingham2013-04-031-6/+37
| | | | | | <rdar://problem/13552724> llvm-svn: 178597
* Added "rb" and "rbr" aliases to fix regressionsSean Callanan2013-04-021-0/+4
| | | | | | | | when we changed "rb" to "rbreak". <rdar://problem/13552724> llvm-svn: 178573
* <rdar://problem/12022060>Greg Clayton2013-03-291-17/+28
| | | | | | Enable tab completion for regular expression commands. llvm-svn: 178348
* <rdar://problem/13521159>Greg Clayton2013-03-271-2/+2
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* <rdar://problem/13404189>Greg Clayton2013-03-131-0/+1
| | | | | | | | | | | | | | Made the "--reverse" option to "source list" also be able to use the "--count". This helps us implement support for regexp source list command: (lldb) l -10 Which gets turned into: (lldb) source list --reverse --count 10 Also simplified the code that is used to track showing more source from the last file and line. llvm-svn: 176961
* Correct the logic in DumpCommandHistory when the end index is UINT32_MAX.Jim Ingham2013-02-221-1/+1
| | | | | | <rdar://problem/13270229> llvm-svn: 175927
* <rdar://problem/13265017>Enrico Granata2013-02-211-33/+0
| | | | | | | | | | | | | | | The notion of Crossref command has long been forgotten, and there is nothing using CommandObjectCrossref in the current LLDB codebase However, this was causing a conflict with process plugins and command aliases ending up in an infinite loop under situations such as: (lldb) command alias monitor process plugin packet monitor (lldb) process att -n Calendar Process 28709 stopped Executable module set to "/Applications/Calendar.app/Contents/MacOS/Calendar". Architecture set to: x86_64-apple-macosx. (lldb) command alias monitor process plugin packet monitor This fixes the loop (and consequent crash) by disposing of Crossref commands and related code llvm-svn: 175831
* <rdar://problem/13178743>Greg Clayton2013-02-121-0/+21
| | | | | | Added a new "env" regular expression alias. If "env" is typed on its own "settings show target.env-vars" will be run. Otherwise it can be used to set and environment variable: "env FOO=BAR". llvm-svn: 174991
* <rdar://problem/13184389>Greg Clayton2013-02-121-0/+1
| | | | | | _regexp-list needs to treat "list -" as "source list -r" llvm-svn: 174987
* Added the ability to specify a breakpoint using the GDB '*ADDRESS' format:Greg Clayton2013-02-081-1/+2
| | | | | | | | | | | | | | | | | | | | (lldb) b *0x1234 You can still of course just specify an address: (lldb) b 0x1234 Also now we accept the '&' before function names to indicate to not to skip the function prologue like GDB supports. To see how this works: (lldb) settings set interpreter.expand-regex-aliases 1 (lldb) b &main breakpoint set --name 'main' --skip-prologue=0 Breakpoint 1: where = a.out`main at main.c:20, address = 0x0000000100000b60 (lldb) b main breakpoint set --name 'main' Breakpoint 2: where = a.out`main + 54 at main.c:21, address = 0x0000000100000b96 llvm-svn: 174695
* <rdar://problem/13050227>Greg Clayton2013-02-011-1/+19
| | | | | | | | | | | | Added a regular expression command called "_regexp-list" which mimics the GDB "line" command in the following forms: LINENUM, to list around that line in current file, FILE:LINENUM, to list around that line in that file, FUNCTION, to list around beginning of that function, *ADDRESS, to list around the line containing that address. ADDRESS, same as above, but don't require a '*' as long as ADDRESS is hex llvm-svn: 174233
* <rdar://problem/9141269>Greg Clayton2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up the objective C name parsing code to use a class. Now breakpoints that are set by name that are objective C methods without the leading '+' or '-' will resolve. We do this by expanding all the objective C names for a given string. For example: (lldb) b [MyString cStringUsingEncoding:] Will set a breakpoint with multiple possible names: -[MyString cStringUsingEncoding:] +[MyString cStringUsingEncoding:] Also if you have a category, it will strip the category and set a breakpoint in all variants: (lldb) [MyString(my_category) cStringUsingEncoding:] Will resolve to the following names: -[MyString(my_category) cStringUsingEncoding:] +[MyString(my_category) cStringUsingEncoding:] -[MyString cStringUsingEncoding:] +[MyString cStringUsingEncoding:] Likewise when we have: (lldb) b -[MyString(my_category) cStringUsingEncoding:] It will resolve to two names: -[MyString(my_category) cStringUsingEncoding:] -[MyString cStringUsingEncoding:] llvm-svn: 173858
* <rdar://problem/13069948>Greg Clayton2013-01-251-31/+24
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/12786725>Enrico Granata2013-01-171-2/+9
| | | | | | | | If there is any alive process being debugged, the user is asked for confirmation before quitting LLDB This should prevent situations where the user mistakenly types "q" and LLDB slaughters their process without any mercy whatsoever Since it can quickly get tedious, there is a new setting on the command interpreter to disable this and replicate the previous behavior llvm-svn: 172757
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-151-0/+4
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* <rdar://problem/12582041>Greg Clayton2012-12-151-2/+4
| | | | | | _regexp_attach doesn't handle the case where no arguments are provided. It now also handles the case you were you pass options. llvm-svn: 170262
* Option changes:Enrico Granata2012-12-121-1/+1
| | | | | | | | | | | | | | | | | the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command. All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o) This is a breaking change: frame variable used --objc as the long option name expression used -o as a shortcut memory read uses --objd as the long option name Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works The test suite has been tweaked accordingly. llvm-svn: 169961
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-071-2/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
OpenPOWER on IntegriCloud