summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make processes use InputReaders for their input. Move the processCaroline Tice2010-11-161-16/+2
| | | | | | | | | ReadThread stuff into the main Process class (out of the Process Plugins). This has the (intended) side effect of disabling the command line tool from reading input/commands while the process is running (the input is directed to the running process rather than to the command interpreter). llvm-svn: 119329
* Add ThreadPlanTracer class to allow instruction step tracing of execution.Jim Ingham2010-11-111-2/+2
| | | | | | Also changed eSetVarTypeBool to eSetVarTypeBoolean to make it consistent with eArgTypeBoolean. llvm-svn: 118824
* Fixed our overly verbose stop reasons which by default included the threadGreg Clayton2010-11-021-2/+9
| | | | | | | name and thread queue. Users can modify the thread-format strings to add these back if needed. llvm-svn: 118000
* Fix the default prompt to have a space. Greg Clayton2010-10-221-1/+1
| | | | llvm-svn: 117150
* Don't cache the public stop reason, since it can change as plan completion ↵Jim Ingham2010-10-201-3/+3
| | | | | | gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do. llvm-svn: 116892
* Add an "auto-confirm" setting to the debugger so you can turn off the ↵Jim Ingham2010-10-041-5/+29
| | | | | | confirmations if you want to. llvm-svn: 115572
* Fixed and issue where we weren't seeing inlined functions anymore. We also ↵Greg Clayton2010-10-041-0/+27
| | | | | | now show the correct pc-offset within the inlined function. llvm-svn: 115522
* Added file and line back to the default thread format.Greg Clayton2010-10-041-0/+1
| | | | llvm-svn: 115519
* Fixed an issue with the default frame format settings string where if a frameGreg Clayton2010-10-041-1/+1
| | | | | | | was stopped in a module, yet had no valid function for the PC, no module would be displayed. llvm-svn: 115490
* There are now to new "settings set" variables that live in each debuggerGreg Clayton2010-10-041-68/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance: settings set frame-format <string> settings set thread-format <string> This allows users to control the information that is seen when dumping threads and frames. The default values are set such that they do what they used to do prior to changing over the the user defined formats. This allows users with terminals that can display color to make different items different colors using the escape control codes. A few alias examples that will colorize your thread and frame prompts are: settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n' settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n' A quick web search for "colorize terminal output" should allow you to see what you can do to make your output look like you want it. The "settings set" commands above can of course be added to your ~/.lldbinit file for permanent use. Changed the pure virtual void ExecutionContextScope::Calculate (ExecutionContext&); To: void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&); I did this because this is a class that anything in the execution context heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell you what it was really trying to do unless you look at the parameter. llvm-svn: 115485
* Cleaned up a unused member variable in Debugger.Greg Clayton2010-09-301-2/+1
| | | | | | | | | | | | | | Added the start of Host specific launch services, though it currently isn't hookup up to anything. We want to be able to launch a process and use the native launch services to launch an app like it would be launched by the user double clicking on the app. We also eventually want to be able to run a command line app in a newly spawned terminal to avoid terminal sharing. Fixed an issue with the new DWARF forward type declaration stuff. A crasher was found that was happening when trying to properly expand the forward declarations. llvm-svn: 115213
* Make GetInstanceSettingsValue methods take an Error * rather than an Error &,Caroline Tice2010-09-201-3/+8
| | | | | | and have them return a bool to indicate success or not. llvm-svn: 114361
* Add UserSettings to Target class, making Target settingsCaroline Tice2010-09-201-3/+31
| | | | | | | | | | | | | | | | | | the parent of Process settings; add 'default-arch' as a class-wide setting for Target. Replace lldb::GetDefaultArchitecture with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture. Add 'use-external-editor' as user setting to Debugger class & update code appropriately. Add Error parameter to methods that get user settings, for easier reporting of bad requests. Fix various other minor related bugs. Fix test cases to work with new changes. llvm-svn: 114352
* Fixed wrong logic in validating term-width value; should be && instead of ||.Johnny Chen2010-09-201-1/+1
| | | | llvm-svn: 114330
* Fixed lldb 'settings set term-widt 70' command not working.Johnny Chen2010-09-201-1/+1
| | | | | | rdar://problem/8449849 llvm-svn: 114328
* Added code that will allow completely customizable prompts for use inGreg Clayton2010-09-191-77/+704
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replacing the "(lldb)" prompt, the "frame #1..." displays when doing stack backtracing and the "thread #1....". This will allow you to see exactly the information that you want to see where you want to see it. This currently isn't hookup up to the prompts yet, but it will be soon. So what is the format of the prompts? Prompts can contain variables that have access to the current program state. Variables are text that appears in between a prefix of "${" and ends with a "}". Some of the interesting variables include: // The frame index (0, 1, 2, 3...) ${frame.index} // common frame registers with generic names ${frame.pc} ${frame.sp} ${frame.fp} ${frame.ra} ${frame.flags} // Access to any frame registers by name where REGNAME is any register name: ${frame.reg.REGNAME} // The current compile unit file where the frame is located ${file.basename} ${file.fullpath} // Function information ${function.name} ${function.pc-offset} // Process info ${process.file.basename} ${process.file.fullpath} ${process.id} ${process.name} // Thread info ${thread.id} ${thread.index} ${thread.name} ${thread.queue} ${thread.stop-reason} // Target information ${target.arch} // The current module for the current frame (the shared library or executable // that contains the current frame PC value): ${module.file.basename} ${module.file.fullpath} // Access to the line entry for where the current frame is when your thread // is stopped: ${line.file.basename} ${line.file.fullpath} ${line.number} ${line.start-addr} ${line.end-addr} Many times the information that you might have in your prompt might not be available and you won't want it to print out if it isn't valid. To take care of this you can enclose everything that must resolve into a scope. A scope is starts with '{' and ends with '}'. For example in order to only display the current file and line number when the information is available the format would be: "{ at {$line.file.basename}:${line.number}}" Broken down this is: start the scope: "{" format whose content will only be displayed if all information is available: "at {$line.file.basename}:${line.number}" end the scope: "}" We currently can represent the infomration we see when stopped at a frame: frame #0: 0x0000000100000e85 a.out`main + 4 at test.c:19 with the following format: "frame #${frame.index}: ${frame.pc} {${module.file.basename}`}{${function.name}{${function.pc-offset}}{ at ${line.file.basename}:${line.number}}\n" This breaks down to always print: "frame #${frame.index}: ${frame.pc} " only print the module followed by a tick if we have a valid module: "{${module.file.basename}`}" print the function name with optional offset: "{${function.name}{${function.pc-offset}}" print the line info if it is available: "{ at ${line.file.basename}:${line.number}}" then finish off with a newline: "\n" Notice you can also put newlines ("\n") and tabs and everything else you are used to putting in a format string when desensitized with the \ character. Cleaned up some of the user settings controller subclasses. All of them do not have any global settings variables and were all implementing stubs for the get/set global settings variable. Now there is a default version in UserSettingsController that will do nothing. llvm-svn: 114306
* Fixed the way set/show variables were being accessed to being natively Greg Clayton2010-09-181-28/+22
| | | | | | | | | | | | | | | | | | accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code just to access variables that were already owned by the objects. While I fixed those things, I saw that CommandObject objects should really have a reference to their command interpreter so they can access the terminal with if they want to output usaage. Fixed up all CommandObjects to take an interpreter and cleaned up the API to not need the interpreter to be passed in. Fixed the disassemble command to output the usage if no options are passed down and arguments are passed (all disassebmle variants take options, there are no "args only"). llvm-svn: 114252
* Fix issues with CreateInstanceName, a virtual function, being calledCaroline Tice2010-09-161-1/+8
| | | | | | in an initializer. llvm-svn: 114107
* Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0Johnny Chen2010-09-141-1/+1
| | | | | | | | | | | | | was used to set the selected thread if none was selected. Use a more robust API to accomplish the task. Also fixed an error found, while investigating, in CommandObjectThreadSelect:: Execute() where the return status was not properly set if successful. As a result, both the stl step-in test cases with expectedFailure decorators now passed. llvm-svn: 113825
* When the debugger updates its symbol context, if no thread or frame are ↵Jim Ingham2010-09-101-0/+10
| | | | | | selected select the first thread's 0th frame. llvm-svn: 113657
* Add comments to InstanceSettings constructors explaining why they have Caroline Tice2010-09-091-2/+6
| | | | | | | to be set up the way they are. Comment out code that removes pending settings for live instances (after the settings are copied over). llvm-svn: 113519
* Make all debugger-level user settable variables into instance variables.Caroline Tice2010-09-091-23/+30
| | | | | | | Make get/set variable at the debugger level always set the particular debugger's instance variables rather than the default variables. llvm-svn: 113474
* Make sure creating a pending instance doesn't also trigger creating a live ↵Caroline Tice2010-09-081-6/+9
| | | | | | | | | instance; also make sure creating a pending instance uses the specified instance name rather than creating a new one; add brackets to instance names when searching for and removing pending instances. llvm-svn: 113370
* Move common code from GetSettingsController in Process & Debugger into ↵Jim Ingham2010-09-071-12/+3
| | | | | | | | static functions in UserSettingsController.cpp. llvm-svn: 113268
* Fix various minor bugs in the Settings stuff.Caroline Tice2010-09-071-2/+22
| | | | llvm-svn: 113245
* This is a very large commit that completely re-does the way lldbCaroline Tice2010-09-041-0/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | handles user settable internal variables (the equivalent of set/show variables in gdb). In addition to the basic infrastructure (most of which is defined in UserSettingsController.{h,cpp}, there are examples of two classes that have been set up to contain user settable variables (the Debugger and Process classes). The 'settings' command has been modified to be a command-subcommand structure, and the 'set', 'show' and 'append' commands have been moved into this sub-commabnd structure. The old StateVariable class has been completely replaced by this, and the state variable dictionary has been removed from the Command Interpreter. Places that formerly accessed the state variable mechanism have been modified to access the variables in this new structure instead (checking the term-width; getting/checking the prompt; etc.) Variables are attached to classes; there are two basic "flavors" of variables that can be set: "global" variables (static/class-wide), and "instance" variables (one per instance of the class). The whole thing has been set up so that any global or instance variable can be set at any time (e.g. on start up, in your .lldbinit file), whether or not any instances actually exist (there's a whole pending and default values mechanism to help deal with that). llvm-svn: 113041
* Fixed an lldb infrastructure bug, where the debugger should reaaly update itsJohnny Chen2010-09-031-1/+1
| | | | | | | | | | | execution context only when the process is still alive. When running the test suite, the debugger is launching and killing processes constantly. This might be the cause of the test hang as reported in rdar://problem/8377854, where the debugger was looping infinitely trying to update a supposedly stale thread list. llvm-svn: 113022
* Added a way to open the current source file & line in an external editor, ↵Jim Ingham2010-08-301-1/+2
| | | | | | | | and you can turn this on with: lldb -e llvm-svn: 112502
* Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to ↵Jim Ingham2010-08-261-10/+10
| | | | | | "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. llvm-svn: 112221
* Remove use of STL collection class use of the "data()" method since it isn'tGreg Clayton2010-07-201-1/+1
| | | | | | | part of C++'98. Most of these were "std::vector<T>::data()" and "std::string::data()". llvm-svn: 108957
* Add a unique ID to each debugger instance.Caroline Tice2010-06-301-0/+21
| | | | | | | | | | | | | | | | | Add functions to look up debugger by id Add global variable to lldb python module, to hold debugger id Modify embedded Python interpreter to update the global variable with the id of its current debugger. Modify the char ** typemap definition in lldb.swig to accept 'None' (for NULL) as a valid value. The point of all this is so that, when you drop into the embedded interpreter from the command interpreter (or when doing Python-based breakpoint commands), there is a way for the Python side to find/get the correct debugger instance ( by checking debugger_unique_id, then calling SBDebugger::FindDebuggerWithID on it). llvm-svn: 107287
* Very large changes that were needed in order to allow multiple connectionsGreg Clayton2010-06-231-65/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to the debugger from GUI windows. Previously there was one global debugger instance that could be accessed that had its own command interpreter and current state (current target/process/thread/frame). When a GUI debugger was attached, if it opened more than one window that each had a console window, there were issues where the last one to setup the global debugger object won and got control of the debugger. To avoid this we now create instances of the lldb_private::Debugger that each has its own state: - target list for targets the debugger instance owns - current process/thread/frame - its own command interpreter - its own input, output and error file handles to avoid conflicts - its own input reader stack So now clients should call: SBDebugger::Initialize(); // (static function) SBDebugger debugger (SBDebugger::Create()); // Use which ever file handles you wish debugger.SetErrorFileHandle (stderr, false); debugger.SetOutputFileHandle (stdout, false); debugger.SetInputFileHandle (stdin, true); // main loop SBDebugger::Terminate(); // (static function) SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to ensure nothing gets destroyed too early when multiple clients might be attached. Cleaned up the command interpreter and the CommandObject and all subclasses to take more appropriate arguments. llvm-svn: 106615
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+434
llvm-svn: 105619
OpenPOWER on IntegriCloud