summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fixed the Xcode project building of LLVM to be a bit more user friendly:Greg Clayton2011-11-041-3/+7
| | | | | | | | | | | | | | | | | | | - If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it. Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice. llvm-svn: 143678
* Revert 143359 and modify the test case to not include non-valid c identifier ↵Johnny Chen2011-10-311-0/+7
| | | | | | character. llvm-svn: 143372
* Fix the r143266 check-in which broke TestCommandRegex.py.Johnny Chen2011-10-311-7/+0
| | | | llvm-svn: 143359
* Fixed the "expression" command when it comes to using it with the new GDB formatGreg Clayton2011-10-291-1/+23
| | | | | | | | | | | | | | | | | | command suffix: (lldb) expression/x 3+3 Since "expression" is a raw command that has options, we need to make sure the command gets its options properly terminated with a "--". Also fixed an issue where if you try to use the GDB command suffix on a command that doesn't support the "--gdb-format" command, it will report an appropriate error. For the fix above, you can query an lldb_private::Options object to see if it supports a long option by name. llvm-svn: 143266
* Get a dummy target to allow for calculator mode while processing backticks.Johnny Chen2011-10-291-0/+4
| | | | | | | | | | | | | | This also helps break the infinite loop caused when target is null. So that we can have: $ /Volumes/data/lldb/svn/trunk/build/Debug/lldb (lldb) itob `0x123 - 0x321` 32 v 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0] (lldb) llvm-svn: 143260
* Added the ability to have GDB formats appended to any command so you can doGreg Clayton2011-10-281-60/+111
| | | | | | | | | | | | | | | | | things like: (lldb) x/32xb 0x1000 "x" is an alias to "memory read", so this will actually turn into: (lldb) memory read --gdb-format=32xb 0x1000 This applies to all commands, so the GDB formats will work with "register read", "frame variable", "target variable" and others. All commands that can accept formats, counts and sizes have been modified to support the "--gdb-format" option. llvm-svn: 143230
* Prefix display/undisplay regexp command alises with "_regexp" as per theJason Molenda2011-10-251-6/+6
| | | | | | style of the other regexp command aliases. llvm-svn: 142902
* Simplified the CommandInterpreter::StripFirstWord logic by making it a staticGreg Clayton2011-10-251-55/+52
| | | | | | | | function and having it not require both a bool and a quote char to fill in. We intend to get rid of this functionality when we rewrite the command interpreter for streams eventually, but not for now. llvm-svn: 142888
* Add "di" and "dis" aliases to "disassemble" so they will win over "display".Jim Ingham2011-10-241-0/+10
| | | | llvm-svn: 142834
* Add "display" and "undisplay" aliases for target stop-hook add/delete.Jason Molenda2011-10-221-1/+37
| | | | | | | | A patina of gdb's "display" command, intended mostly for simply monitoring a variable as you step through source code. Formatters do not work, e.g. display/x $pc does not work. llvm-svn: 142710
* Add "stepi" as an alias for thread step-inst in addition to "si".Jason Molenda2011-10-221-0/+10
| | | | | | Add "nexti" an "ni" as aliases for thread step-inst-over. llvm-svn: 142707
* Added the ability to run expressions in any command. Expressions can be Greg Clayton2011-10-141-0/+121
| | | | | | | | | | | | | | | | | inserted in commands by using backticks: (lldb) memory read `$rsp-16` `$rsp+16` (lldb) memory read -c `(int)strlen(argv[0])` `argv[0]` The result of the expression will be inserted into the command as a sort of preprocess stage where this gets done first. We might need to tweak where this preprocess stage goes, but it is very functional already. Added ansi color support to the Debugger::FormatPrompt() so you can use things like "${ansi.fg.blue}" and "${ansi.bold}" many more. This helps in adding colors to your prompts without needing to know the ANSI color code strings. llvm-svn: 141948
* Fix a problem where the stop-hook command 'frame variable g_val' produces ↵Johnny Chen2011-10-051-3/+10
| | | | | | | | | | | | | | nothing when newly created threads were subsequently stopped due to breakpoint hit. The stop-hook mechanism delegates to CommandInterpreter::HandleCommands() to execuet the commands. Make sure the execution context is switched only once at the beginning of HandleCommands() only and don't update the context while looping on each individual command to be executed. rdar://problem/10228156 llvm-svn: 141144
* Add initial implementation of watchpoint commands for list, enable, disable, ↵Johnny Chen2011-09-221-0/+2
| | | | | | | | and delete. Test cases to be added later. llvm-svn: 140322
OpenPOWER on IntegriCloud