summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Added an "attach" alias as promised on the web page.Sean Callanan2012-05-041-0/+6
| | | | llvm-svn: 156223
* Report the command error when we are in "stop on error mode."Jim Ingham2012-04-241-4/+7
| | | | llvm-svn: 155422
* Added a "add-dsym" alias to "target symbols add" to keep gdb converts happy.Greg Clayton2012-03-291-0/+6
| | | | llvm-svn: 153695
* <rdar://problem/10605072>Greg Clayton2012-02-291-2/+23
| | | | | | | | | | | | | Added the ability to override command line commands. In some cases GUI interfaces might want to intercept commands like "quit" or "process launch" (which might cause the process to re-run). They can now do so by overriding/intercepting commands by using functions added to SBCommandInterpreter using a callback function. If the callback function returns true, the command is assumed to be handled. If false is returned the command should be evaluated normally. Adopted this up in the Driver.cpp for intercepting the "quit" command. llvm-svn: 151708
* Add a general mechanism to wait on the debugger for Broadcasters of a given ↵Jim Ingham2012-02-161-1/+10
| | | | | | | | | class/event bit set. Use this to allow the lldb Driver to emit notifications for breakpoint modifications. <rdar://problem/10619974> llvm-svn: 150665
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* The "desired result type" code in the expressionSean Callanan2011-12-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | parser has hitherto been an implementation waiting for a use. I have now tied the '-o' option for the expression command -- which indicates that the result is an Objective-C object and needs to be printed -- to the ExpressionParser, which communicates the desired type to Clang. Now, if the result of an expression is determined by an Objective-C method call for which there is no type information, that result is implicitly cast to id if and only if the -o option is passed to the expression command. (Otherwise if there is no explicit cast Clang will issue an error. This behavior is identical to what happened before r146756.) Also added a testcase for -o enabled and disabled. llvm-svn: 147099
* "f" should be an alias for "frame select" not "finish" to match the gdb usage.Jim Ingham2011-12-021-1/+6
| | | | llvm-svn: 145660
* (no commit message)Jim Ingham2011-11-171-1/+1
| | | | llvm-svn: 144874
* Confirm should accept both "Y" and "y" in case somebody confuses the ↵Jim Ingham2011-11-141-3/+3
| | | | | | | | "default answer" indicator for a directive to enter a capital letter. llvm-svn: 144562
* Removed debug printf statements.Greg Clayton2011-11-101-3/+0
| | | | llvm-svn: 144257
* <rdar://problem/10374840>Greg Clayton2011-11-091-3/+49
| | | | | | | Fixed an issue with the gdb format stuff for any aliases that expand to contain a "--". llvm-svn: 144240
* this patch addresses several issues with "command script" subcommands:Enrico Granata2011-11-071-9/+13
| | | | | | | | | | | | a) adds a new --synchronicity (-s) setting for "command script add" that allows the user to decide if scripted commands should run synchronously or asynchronously (which can make a difference in how events are handled) b) clears up several error messages c) adds a new --allow-reload (-r) setting for "command script import" that allows the user to reload a module even if it has already been imported before d) allows filename completion for "command script import" (much like what happens for "target create") e) prevents "command script add" from replacing built-in commands with scripted commands f) changes AddUserCommand() to take an std::string instead of a const char* (for performance reasons) plus, it fixes an issue in "type summary add" command handling which caused several test suite errors llvm-svn: 144035
OpenPOWER on IntegriCloud