summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* <rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it ↵Enrico Granata2012-10-291-9/+21
| | | | | | | | | does not automatically initialize the script interpreter in order to transfer its output file handle to it This should delay initialization of Python until strictly necessary and speed-up debugger startup Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes llvm-svn: 166967
* Clean up help/usage messages for kdp-remote / gdb-remote a little bit.Jason Molenda2012-10-231-4/+4
| | | | llvm-svn: 166464
* Change the "rb" alias to "rbreak" since some people are used to typing more ↵Jim Ingham2012-10-181-2/+2
| | | | | | | | than "rb" and so weren't finding the alias. llvm-svn: 166249
* Add the ability to set timeout & "run all threads" options both from the ↵Jim Ingham2012-10-161-2/+3
| | | | | | | | | | "expr" command and from the SB API's that evaluate expressions. <rdar://problem/12457211> llvm-svn: 166062
* <rdar://problem/12491387>Greg Clayton2012-10-131-35/+7
| | | | | | | | | | | I added the ability for a process plug-in to implement custom commands. All the lldb_private::Process plug-in has to do is override: virtual CommandObject * GetPluginCommandObject(); This object returned should be a multi-word command that vends LLDB commands. There is a sample implementation in ProcessGDBRemote that is hollowed out. It is intended to be used for sending a custom packet, though the body of the command execute function has yet to be implemented! llvm-svn: 165861
* Don't make regexp commands as regular commands - they are "short cuts" and ↵Jim Ingham2012-10-101-1/+5
| | | | | | users should be able to override them with "unalias" but you can't unalias normal commands. llvm-svn: 165630
* Remove "k" as an alias for "kill". It doesn't ask for confirmation andJason Molenda2012-10-051-1/+0
| | | | | | it's too easy to type by mistake when typing "l" (read: I did this once). llvm-svn: 165340
* Remove the bt alias I inadvertently added back in in my last checkin.Jim Ingham2012-10-051-4/+0
| | | | llvm-svn: 165330
* Add one-shot breakpoints (-o option to "break set") and a tbreak alias for ↵Jim Ingham2012-10-051-8/+63
| | | | | | our gdb friends. llvm-svn: 165328
* Change the "bt" command alias defined in ↵Jason Molenda2012-10-051-4/+20
| | | | | | | | | | | | CommandInterpreter::LoadCommandDictionary. It is now a regex command alias that more faithfully emulates gdb's behavior, most importantly, "bt 5" will backtrace 5 frames of the currently selected thread. "bt all" still backtraces all threads (unlike gdb) and for users who have learned to use "bt -c 5", that form is still accepted. llvm-svn: 165300
* <rdar://problem/12406088> Fixing a crasher with adding a regex command, due ↵Enrico Granata2012-10-011-6/+4
| | | | | | to accessing a shared pointer without first checking for NULL llvm-svn: 164950
* Implementing plugins that provide commands.Enrico Granata2012-09-281-4/+18
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
OpenPOWER on IntegriCloud