summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/StopInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rework how the breakpoint conditions & callbacks are handled. We now ↵Jim Ingham2011-12-091-60/+61
| | | | | | | | | iterate over all the locations at the site that got hit, and first check the condition, and if that location's condition says we should stop, then we run the callback. In the end if any location's condition and callback say we should stop, then we stop. llvm-svn: 146242
* Do a better job of detecting when a breakpoint command has set the target ↵Jim Ingham2011-11-081-7/+52
| | | | | | | | running again (except you have to ignore cases where the breakpoint runs expressions, those don't count as really "running again"). llvm-svn: 144064
* Added a language parameter to the expression parser,Sean Callanan2011-11-071-0/+2
| | | | | | | | | | | which will in the future allow expressions to be compiled as C, C++, and Objective-C instead of the current default Objective-C++. This feature requires some additional support from Clang -- specifically, it requires reference types in the parser regardless of language -- so it is not yet exposed to the user. llvm-svn: 144042
* Grab the address of the breakpoint site for the StopInfoBreakpoint so ifJim Ingham2011-10-281-3/+21
| | | | | | | it gets deleted before GetDescription is called we still at least know where it was. llvm-svn: 143175
* Add a commnad to set a condition for a watchpoint. Example:Johnny Chen2011-10-171-0/+118
| | | | | | | | | | | | | | | watchpoint modify -c 'global==5' modifies the last created watchpoint so that the condition expression is evaluated at the stop point to decide whether we should proceed with the stopping. Also add SBWatchpont::SetCondition(const char *condition) to set condition programmatically. Test cases to come later. llvm-svn: 142227
* SBValue::Watch() and SBValue::WatchPointee() are now the official API for ↵Johnny Chen2011-10-141-5/+5
| | | | | | | | | | | | | | | | | | creating a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee encapsulated by SBValue (WatchPointee). Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that. Modified the watchpoint related test suite to reflect the change. Plus replacing WatchpointLocation with Watchpoint throughout the code base. There are still cleanups to be dome. This patch passes the whole test suite. Check it in so that we aggressively catch regressions. llvm-svn: 141925
* Add SB API class SBWatchpointLocation and some extra methods to the SBTarget ↵Johnny Chen2011-09-261-0/+1
| | | | | | | | | | | class to iterate on the available watchpoint locations and to perform watchpoint manipulations. I still need to export the SBWatchpointLocation class as well as the added watchpoint manipulation methods to the Python interface. And write test cases for them. llvm-svn: 140575
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* StopInfoWatchpoint should override the StopInfo::ShouldStop() virtual method ↵Johnny Chen2011-09-211-4/+40
| | | | | | | | | and delegate to the WatchpointLocation object to check whether it should stop and allow it to update the hit count, among other bookkeepings. llvm-svn: 140279
* This patch modifies the expression parser to allow itSean Callanan2011-09-151-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to execute expressions even in the absence of a process. This allows expressions to run in situations where the target cannot run -- e.g., to perform calculations based on type information, or to inspect a binary's static data. This modification touches the following files: lldb-private-enumerations.h Introduce a new enum specifying the policy for processing an expression. Some expressions should always be JITted, for example if they are functions that will be used over and over again. Some expressions should always be interpreted, for example if the target is unsafe to run. For most, it is acceptable to JIT them, but interpretation is preferable when possible. Target.[h,cpp] Have EvaluateExpression now accept the new enum. ClangExpressionDeclMap.[cpp,h] Add support for the IR interpreter and also make the ClangExpressionDeclMap more robust in the absence of a process. ClangFunction.[cpp,h] Add support for the new enum. IRInterpreter.[cpp,h] New implementation. ClangUserExpression.[cpp,h] Add support for the new enum, and for running expressions in the absence of a process. ClangExpression.h Remove references to the old DWARF-based method of evaluating expressions, because it has been superseded for now. ClangUtilityFunction.[cpp,h] Add support for the new enum. ClangExpressionParser.[cpp,h] Add support for the new enum, remove references to DWARF, and add support for checking whether the expression could be evaluated statically. IRForTarget.[h,cpp] Add support for the new enum, and add utility functions to support the interpreter. IRToDWARF.cpp Removed CommandObjectExpression.cpp Remove references to the obsolete -i option. Process.cpp Modify calls to ClangUserExpression::Evaluate to pass the correct enum (for dlopen/dlclose) SBValue.cpp Add support for the new enum. SBFrame.cpp Add support for he new enum. BreakpointOptions.cpp Add support for the new enum. llvm-svn: 139772
* Move the handling of breakpoint conditions from the Private event loop to ↵Jim Ingham2011-08-091-3/+118
| | | | | | | | | | | the StopInfoBreakpoint::DoActions, which happens as the event is removed. Also use the return value of asynchronous breakpoint callbacks, they get checked before, and override the breakpoint conditions. Added ProcessModInfo class, to unify "stop_id generation" and "memory modification generation", and use where needed. llvm-svn: 137102
* Created a std::string in the base StopInfo class for the description andGreg Clayton2011-06-041-6/+47
| | | | | | | cleaned up all base classes that had their own copy. Added a SetDescription accessor to the StopInfo class. llvm-svn: 132615
* Rework the RunThreadPlan event handling to use Event Hijacking not stopping ↵Jim Ingham2011-02-081-2/+10
| | | | | | the event thread. Also clarify the logic of the function. llvm-svn: 125083
* Back up both the register AND the stop state when calling functions.Jim Ingham2011-01-201-0/+6
| | | | | | | Set the thread state to "bland" before calling functions so they don't inherit the pending signals and die. llvm-svn: 123869
* Added the ability to get more information on the SBThread's stop reasonGreg Clayton2010-11-181-0/+1
| | | | | | | | | | | | | | by being able to get the data count and data. Each thread stop reason has one or more data words that can help describe the stop. To do this I added: size_t SBThread::GetStopReasonDataCount(); uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx); llvm-svn: 119720
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-2/+2
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Added support for breakpoint conditions. I also had to separate the "run ↵Jim Ingham2010-10-141-0/+14
| | | | | | | | the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing. Also added support for remembering the "last set breakpoint" so that "break modify" will act on the last set breakpoint. llvm-svn: 116542
* There are now to new "settings set" variables that live in each debuggerGreg Clayton2010-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make breakpoint commands work again. Added a PerformAction to the stop info ↵Jim Ingham2010-08-101-3/+43
| | | | | | | | | | | - actions are run when the stop event is pulled from the event queue. Then made the StopInfoBreakpoint's PerformAction do the breakpoint command. Also fixed the StopInfoBreakpoint's GetDescription so it gets the breakpoint location info, not the breakpoint site info. llvm-svn: 110637
* Change Target & Process so they can really be initialized with an invalid ↵Jim Ingham2010-08-091-1/+1
| | | | | | | | | | | | architecture. Arrange that this then gets properly set on attach, or when a "file" is set. Add a completer for "process attach -n". Caveats: there isn't currently a way to handle multiple processes with the same name. That will have to wait on a way to pass annotations along with the completion strings. llvm-svn: 110624
* Abtracted the old "lldb_private::Thread::StopInfo" into an abtract class.Greg Clayton2010-08-041-0/+351
This will allow debugger plug-ins to make any instance of "lldb_private::StopInfo" that can completely describe any stop reason. It also provides a framework for doing intelligent things with the stop info at important times in the lifetime of the inferior. Examples include the signal stop info in StopInfoUnixSignal. It will check with the process to see that the current action is for the signal. These actions include wether to stop for the signal, wether the notify that the signal was hit, and wether to pass the signal along to the inferior process. The StopInfoUnixSignal class overrides the "ShouldStop()" method of StopInfo and this allows the stop info to determine if it should stop at the signal or continue the process. StopInfo subclasses must override the following functions: virtual lldb::StopReason GetStopReason () const = 0; virtual const char * GetDescription () = 0; StopInfo subclasses can override the following functions: // If the subclass returns "false", the inferior will resume. The default // version of this function returns "true" which means the default stop // info will stop the process. The breakpoint subclass will check if // the breakpoint wants us to stop by calling any installed callback on // the breakpoint, and also checking if the breakpoint is for the current // thread. Signals will check if they should stop based off of the // UnixSignal settings in the process. virtual bool ShouldStop (Event *event_ptr); // Sublasses can state if they want to notify the debugger when "ShouldStop" // returns false. This would be handy for breakpoints where you want to // log information and continue and is also used by the signal stop info // to notify that a signal was received (after it checks with the process // signal settings). virtual bool ShouldNotify (Event *event_ptr) { return false; } // Allow subclasses to do something intelligent right before we resume. // The signal class will figure out if the signal should be propagated // to the inferior process and pass that along to the debugger plug-ins. virtual void WillResume (lldb::StateType resume_state) { // By default, don't do anything } The support the Mach exceptions was moved into the lldb/source/Plugins/Process/Utility folder and now doesn't polute the lldb_private::Thread class with platform specific code. llvm-svn: 110184
OpenPOWER on IntegriCloud