summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* <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
* Change the kdp-remote alias to require a hostname (instead of allowing a ↵Jason Molenda2012-09-271-1/+1
| | | | | | zero-length hostname to be specified). llvm-svn: 164752
* Added "k" as an alias to "process kill" since the new "kdb-remote" will now ↵Greg Clayton2012-09-271-0/+3
| | | | | | conflict with it. llvm-svn: 164737
* Add convenience aliases to allow easy attaching to a remote gdb server or ↵Greg Clayton2012-09-261-0/+30
| | | | | | kdp (darwin kernel) server with the new "gdb-remote" regex alias and "kdp-remote" regex alias commands. llvm-svn: 164729
* Implementing an Options class for EvaluateExpression() in order to make the ↵Enrico Granata2012-09-051-10/+10
| | | | | | signature more compact and make it easy to 'just run an expression' llvm-svn: 163239
* rdar://problem/11811338Johnny Chen2012-08-241-1/+22
| | | | | | | Add 'attach <pid>|<process-name>' command to lldb, as well as 'detach' which is an alias of 'process detach'. Add two completion test cases for "attach" and "detach". llvm-svn: 162573
* rdar://problem/12022371Johnny Chen2012-08-231-2/+3
| | | | | | | Make it so that "b 245" should set a breakpoint at line 245 of the current file. Also add a simple test file. llvm-svn: 162419
* <rdar://problem/12022079>Greg Clayton2012-08-231-0/+24
| | | | | | | | | | | | | | | | | | | | Added a new "interpreter" properties to encapsulate any properties for the command interpreter. Right now this contains only "expand-regex-aliases", so you can now enable (disabled by default) the echoing of the command that a regular expression alias expands to: (lldb) b main Breakpoint created: 1: name = 'main', locations = 1 Note that the expanded regular expression command wasn't shown by default. You can enable it if you want to: (lldb) settings set interpreter.expand-regex-aliases true (lldb) b main breakpoint set --name 'main' Breakpoint created: 1: name = 'main', locations = 1 Also enabled auto completion for enumeration option values (OptionValueEnumeration) and for boolean option values (OptionValueBoolean). Fixed auto completion for settings names when nothing has been type (it should show all settings). llvm-svn: 162418
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-9/+3
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* Added back member initialization for m_batch_command_mode, which was most ↵Johnny Chen2012-08-091-0/+1
| | | | | | | | | likely removed accidentally a while back. The consequence occurred recently probably due to our swicth to build with c++11. This fixed 3 test failures. llvm-svn: 161625
* Removed explicit NULL checks for shared pointersSean Callanan2012-08-091-4/+4
| | | | | | | | | and instead made us use implicit casts to bool. This generated a warning in C++11. <rdar://problem/11930775> llvm-svn: 161559
* Made "call" another alias for "expression --",Sean Callanan2012-08-081-0/+2
| | | | | | | | for people used to the GDB command. <rdar://problem/12052072> llvm-svn: 161466
* Ran the static analyzer on the codebase and found a few things.Greg Clayton2012-07-171-2/+0
| | | | llvm-svn: 160338
* <rdar://problem/11672978> Fixing an issue where an ObjC object might come ↵Enrico Granata2012-07-161-1/+2
| | | | | | out without a description because the expression used to obtain it would timeout before running to completion llvm-svn: 160326
* <rdar://problem/11791234>Greg Clayton2012-07-121-31/+8
| | | | | | | | | | Fixed a case where the python interpreter could end up holding onto a previous lldb::SBProcess (probably in lldb.process) when run under Xcode. Prior to this fix, the lldb::SBProcess held onto a shared pointer to a lldb_private::Process. This in turn could cause the process to still have a thread list with stack frames. The stack frames would have module shared pointers in the lldb_private::SymbolContext objects. We also had issues with things staying in the shared module list too long when we found things by UUID (we didn't remove the out of date ModuleSP from the global module cache). Now all of this is fixed and everything goes away between runs. llvm-svn: 160140
* Turning the interpreter mutex into a static global to avoid a potential ↵Enrico Granata2012-07-101-2/+2
| | | | | | leak. Might need to be turned back into a pointer if it causes issues with the destructor chain. llvm-svn: 160012
* <rdar://problem/11751427> Fixing an issue where multiple threads could ↵Enrico Granata2012-07-101-0/+10
| | | | | | concurrently try and initialize Python and cause crashes llvm-svn: 160008
* Change the "run" / "r" command alias to not use --shell for lldbJason Molenda2012-07-061-0/+4
| | | | | | | | running natively on arm - on iOS we have to do some extra work to track the inferior process if we launch with a shell intermediary. <rdar://problem/11719396> llvm-svn: 159803
* Make raw & parsed commands subclasses of CommandObject rather than having ↵Jim Ingham2012-06-081-29/+1
| | | | | | | | | | | | | | | | the raw version implement an Execute which was never going to get run and another ExecuteRawCommandString. Took the knowledge of how to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs. Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for the overall command and moved them into the .cpp file. Made the CommandObject flags work for raw as well as parsed commands. Made "expr" use the flags so that it requires you to be paused to run "expr". llvm-svn: 158235
* Added "kill" as an alias for "process kill".Sean Callanan2012-06-011-0/+4
| | | | llvm-svn: 157856
* <rdar://problem/11328896> Fixing a bug where regex commands were saved in ↵Enrico Granata2012-05-311-7/+18
| | | | | | the history even if they came from a 'command sourced' file - this fix introduces a command sourcing depth and disables history for all levels of depth > 0, which means no commands go into history when being sourced from a file. we need an integer depth because command files might themselves source other command files, ... llvm-svn: 157727
* Added an "rb" alias that sets breakpoints bySean Callanan2012-05-211-0/+9
| | | | | | regular expression. llvm-svn: 157202
* <rdar://problem/11405850> Greg Clayton2012-05-181-1/+1
| | | | | | | | | | | | | The "run" and "r" aliases were for gdb compatability, so make then do what GDB does by default: launch in a shell. For those that don't want launching with a shell by default, add the following to your ~/.lldbinit file: command unalias run command unalias r command alias r process launch -- command alias run process launch -- llvm-svn: 157028
* Warn the user when several commands match the input given.Filipe Cabecinhas2012-05-161-2/+22
| | | | | | Added a testcase. llvm-svn: 156961
OpenPOWER on IntegriCloud