History log of /external/lldb/include/lldb/Target/Thread.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
008f3dc79c762b7d240b5ad6d4fb148c5cb039ca 18-Jul-2013 Jim Ingham <jingham@apple.com> This commit does two things. One, it converts the return value of the QueueThreadPlanXXX
plan providers from a "ThreadPlan *" to a "lldb::ThreadPlanSP". That was needed to fix
a bug where the ThreadPlanStepInRange wasn't checking with its sub-plans to make sure they
succeed before trying to proceed further. If the sub-plan failed and as a result didn't make
any progress, you could end up retrying the same failing algorithm in an infinite loop.

<rdar://problem/14043602>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
d1ddde0c443e67b37f9303b5bdff19aad9f54fdc 24-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13643315>

Fixed performance issues that arose after changing SBTarget, SBProcess, SBThread and SBFrame over to using a std::shared_ptr to a ExecutionContextRef. The ExecutionContextRef doesn't store a std::weak_ptr to a stack frame because stack frames often get replaced with new version, so it held onto a StackID object that would allow us to ask the thread each time for the frame for the StackID. The linear function was too slow for large recursive stacks. We also fixed an issue where anytime the std::shared_ptr<ExecutionContextRef> in any SBTarget, SBProcess, SBThread objects was turned into an ExecutionContext object, it would try to resolve all items in the ExecutionContext which are shared pointers. Even if the StackID in the ExecutionContextRef was invalid, it was looking through all frames in every thread. This causes a lot of unnecessary frame accesses.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
375ba883a11c84b7eb27f6f04751aea878e3e9b0 14-May-2013 Daniel Malea <daniel.malea@intel.com> Fix inline stepping test case on Linux because Thread::ThreadStoppedForAReason ignored virtual steps.
- add IsVirtualStep() virtual function to ThreadPlan, and implement it for
ThreadPlanStepInRange
- make GetPrivateStopReason query the current thread plan for a virtual stop to
decide if the current stop reason needs to be preserved
- remove extra check for an existing process in GetPrivateStopReason



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
1f85fa8c8611a175819009dd83e724b6788a6587 10-May-2013 Andrew Kaylor <andrew.kaylor@intel.com> Adding support for setting thread stop state when a process stops.

This re-submission of this patch fixes a problem where the code sometimes caused a deadlock. The Process::SetPrivateState method was locking the Process::m_private_state variable and then later calling ThreadList::DidStop, which locks the ThreadList mutex. Other methods in ThreadList which were being called from other threads lock the ThreadList mutex and then call Process::GetPrivateState which locks the Process::m_private_state mutex. To avoid deadlocks, Process::SetPrivateState now locks the ThreadList mutex before locking the Process::m_private_state mutex.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
85e3c2f2f7e60a772f9fffa3fc42d46e493d198c 09-May-2013 Daniel Malea <daniel.malea@intel.com> Revert r181482 as it causes occasional hangs in LLDB buildbots

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
863aa28adf536c9c008e1590f25da662431d6f13 09-May-2013 Greg Clayton <gclayton@apple.com> Changed the formerly pure virtual function:

namespace lldb_private {
class Thread
{
virtual lldb::StopInfoSP
GetPrivateStopReason() = 0;
};
}

To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function:

namespace lldb_private {
class Thread
{
virtual bool
CalculateStopInfo() = 0;
}
}

This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings.

Also renamed:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopReason();

To:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopInfo();

Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
52e4391bf4239f770f856392869f652f5417f489 09-May-2013 Andrew Kaylor <andrew.kaylor@intel.com> Adding code to set thread state to stopped when the process stops.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
7c79a27b955432dfd3ad9439640f0af2eccf37b8 08-May-2013 Jim Ingham <jingham@apple.com> Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.

Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.

Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--

M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
a46013bde54626b68cd2013b108f73a205f4b29a 01-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13700260>
<rdar://problem/13723772>

Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves.

A few things are introduced:
- lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread.
- Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification.
- Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them
- Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
5042acfb254338f60ef8bc3a8715e229795d941f 20-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13697881>

Fixed the GDB remote with the python OS plug-in to not show core threads when they aren't desired and also to have the threads "to the right thing" when continuing.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.

Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
81f4b8953db5db67bec754dc895a5a83c96c84fb 18-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Remove duplicate "friend" declaration.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
9acf3699d2bea583b45c762f4cd82b2a4af6131b 12-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13491977>

Made some fixes to the OperatingSystemPython class:
- If any thread dictionary contains any "core=N" key/value pairs then the threads obtained from the lldb_private::Process itself will be placed inside the ThreadMemory threads and will be used to get the information for a thread.
- Cleaned up all the places where a thread inside a thread was causing problems



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
be51f8a81ecf1f50b2843b7b3ecb8cfbc54d9787 31-Jan-2013 Jim Ingham <jingham@apple.com> Add "thread return -x" to unwind the innermost user called expression (if you happen to have stopped in it due to a crash.)
Make the message when you hit an crash while evaluating an expression a little clearer, and mention "thread return -x".

rdar://problem/13110464


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
b794020ffbd6473c59a6e98be044df50abf7fc30 15-Jan-2013 Jim Ingham <jingham@apple.com> Separated the "expr --unwind-on-error" behavior into two parts, actual 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>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
f2ca573e8dc034ecc5050a874d8f01ace0703e18 12-Dec-2012 Jim Ingham <jingham@apple.com> Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:

Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63

and you want to get into "complex" skipping a, b and c, you can do:

(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
2e2812388b75d3c62c9518cc1a6550ce29325aa6 11-Dec-2012 Jim Ingham <jingham@apple.com> Broadcast an event when the selected thread is changed.

<rdar://problem/10976636>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
76b258db0611dad2f5b5ae51721a4bc0abd580ae 27-Nov-2012 Jim Ingham <jingham@apple.com> The Function calling thread plan was replacing the stored stop info too soon, causing recursive entry into the
breakpoint StopInfo's PerformAction, which is bad. Reworked this so that it is now correct.

<rdar://problem/12501259>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
1a00ab35c98b2acd393bb1ceee3e0e2bf4e02768 20-Nov-2012 Filipe Cabecinhas <me@filcab.net> Remove unneeded const qualifier

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
6bc24c10080b624a2782e6e42f683e5d65c6903c 16-Oct-2012 Jim Ingham <jingham@apple.com> Patch from Matt Kopec <matt.kopec@intel.com> to fix the problem that if two breakpoints were set on consecutive addresses, the continue from the
first breakpoint would skip the second.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
94a5d0de4433dce556db59758f3d6124eb0e1a2a 10-Oct-2012 Jim Ingham <jingham@apple.com> Change the Thread constructor over to take a Process& rather than a ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP.
Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame
changes the stack.
Made the Driver use this notification to print the new thread status rather than doing it in the command.
Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call.

<rdar://problem/12383087>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
3acaa926c8f0d32da48db61a5fcb95276e6a4006 25-Sep-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/9959501>

More KDP debugging process. We can not set breakpoints, hit them, resume, step and detach while running.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
f59388aa57559d7d074613d65b88abacfd699845 14-Sep-2012 Jim Ingham <jingham@apple.com> Make the unwinding of the stack part of "thread return" work, and add the thread return command.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
a17a81a1a9ff6b8d87c4a1e47dd874f6ea8a4f1d 12-Sep-2012 Jim Ingham <jingham@apple.com> Start at getting "thread return" working. Doesn't work yet.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
36de3c01c2f3ceac59b8e34b47c17fac200e27a1 08-Sep-2012 Jim Ingham <jingham@apple.com> Save and restore the current inlined depth over function calls.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
0c8fa2d7dd18ae1816c82846234c45f79142e3df 01-Sep-2012 Jim Ingham <jingham@apple.com> Initial check-in of "fancy" inlined stepping. Doesn't do anything useful unless you switch LLDB_FANCY_INLINED_STEPPING to true. With that
on, basic inlined stepping works, including step-over of inlined functions. But for some as yet mysterious reason i386 debugging gets an
assert and dies immediately. So for now its off.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
ee5bba0f13cac9134ab8f7d23c387891b90e14b3 23-Aug-2012 Jim Ingham <jingham@apple.com> Fix some indenting.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
d0bdddff8bc6dd5f71492452ce2bbd72fdaa147b 22-Aug-2012 Jim Ingham <jingham@apple.com> Rework how the API mutex is acquired when filling out an ExecutionContext from an ExecutionContextRef,
particularly in the SBThread & SBFrame interfaces. Instead of filling the whole context & then getting
the API mutex, we now get only the target, acquire the API mutex from it, then fill out the rest of the
context. This removes a race condition where you get a ThreadSP, then wait on the API mutex while another
command Destroy's the Thread you've just gotten.
Also fixed the ExecutionContextRef::Get*SP calls so they don't return invalid objects.
Also fixed the ExecutionContext::Has*Scope calls so they don't claim to have a scope if the object representing
that scope has been destroyed.
Also fixed a think-o in Thread::IsValid which was causing it to return the opposite of the desired value.

<rdar://problem/11995490>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
c6e82e4a323d7a7168b05365c53c9bc2e0d418e3 22-Aug-2012 Greg Clayton <gclayton@apple.com> Remove further outdated "settings" code and also implement a few missing things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
73844aa19a7360b662e2be710fc3c969d6c86606 22-Aug-2012 Greg Clayton <gclayton@apple.com> Reimplemented the code that backed the "settings" in lldb. There were many 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".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
a7d3dc75ec4f46033c3f991f11fb58a058091a85 11-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11852100>

The "stop-line-count-after" and "stop-line-count-before" settings are broken. This fixes them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
06b84494c72ceb559ca07ff5e2ccd2fe645b6363 04-Jul-2012 Jim Ingham <jingham@apple.com> Work around some problems destroying a process with older debugservers.

rdar://problem/11359989


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
cf5927ee246f5e431162f2753ed9e040dd060fe5 18-May-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11386214>
<rdar://problem/11455913>

"target symbol add" should flush the cached frames
"register write" should flush the thread state in case registers modifications change stack




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
038fa8e30621e0e55faed3479387d811986f28b7 10-May-2012 Jim Ingham <jingham@apple.com> If the ObjC Step Through Trampoline plan causes a target crash, properly propagate the error back to
the controlling plans so that they don't lose control.

Also change "ThreadPlanStepThrough" to take the return StackID for its backstop breakpoint as an argument
to the constructor rather than having it try to figure it out itself, since it might get it wrong whereas
the caller always knows where it is coming from.

rdar://problem/11402287


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
88e3de205708f14431559072ca258899b5ac31cc 03-May-2012 Jim Ingham <jingham@apple.com> Clean up the usage of "MasterPlan" status in ThreadPlans. Only user-initiated plans
should be MasterPlans that want to stay on the plan stack. So make all plans NOT
MasterPlans by default and then have the SB API's and the CommandObjectThread step
commands set this explicitly.

Also added a "clean up" phase to the Thread::ShouldStop so that if plans get stranded
on the stack, we can remove them. This is done by adding an IsPlanStale method to the
thread plans, and if the plan can know that it is no longer relevant, it returns true,
and the plan and its sub-plans will get discarded.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
2bcbaf625afd8f521da03ddaa146e7ea7650ee38 10-Apr-2012 Jim Ingham <jingham@apple.com> Rework how master plans declare themselves. Also make "PlanIsBasePlan" not rely only on this being the bottom plan in the stack, but allow the plan to declare itself as such.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
3feafabba22e8b7110d556cb1c8690461e391fdb 04-Apr-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11184458>

Found an issue where we might still have shared pointer references to lldb_private::Thread objects where the object itself is not valid and has been removed from the Process. When a thread is removed from a process, it will call Thread::DestroyThread() which well set a boolean member variable which is exposed now via:

bool
Thread::IsValid() const;

We then check the thread validity before handing out a shared pointer.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
2450cb19a85dcd4a14032bd96b16389416b4ff7f 29-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11035349>

Fixed an issue with stepping where the stack frame list could get changed out from underneath you when multiple threads start accessing frame info.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
598df88bd6fc33c6fb330bc859bdc277795501f3 14-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10434005>

Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
macros that allows us to easily compile for either C++.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
bf97d74c0c3e9a0f7c89fe0cd4a059015ec482d5 29-Feb-2012 Jim Ingham <jingham@apple.com> Make the StackFrameList::GetFrameAtIndex only fetch as many stack frames as needed to
get the frame requested.
<rdar://problem/10943135>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
f4124deeb9532044a38c0774ced872f2709347da 21-Feb-2012 Greg Clayton <gclayton@apple.com> Thread hardening part 3. Now lldb_private::Thread objects have std::weak_ptr
objects for the backlink to the lldb_private::Process. The issues we were
running into before was someone was holding onto a shared pointer to a
lldb_private::Thread for too long, and the lldb_private::Process parent object
would get destroyed and the lldb_private::Thread had a "Process &m_process"
member which would just treat whatever memory that used to be a Process as a
valid Process. This was mostly happening for lldb_private::StackFrame objects
that had a member like "Thread &m_thread". So this completes the internal
strong/weak changes.

Documented the ExecutionContext and ExecutionContextRef classes so that our
LLDB developers can understand when and where to use ExecutionContext and
ExecutionContextRef objects.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
289afcb5e26c2527a0d2e71f84e780b86bbcf90a 18-Feb-2012 Greg Clayton <gclayton@apple.com> The second part in thread hardening the internals of LLDB where we make
the lldb_private::StackFrame objects hold onto a weak pointer to the thread
object. The lldb_private::StackFrame objects the the most volatile objects
we have as when we are doing single stepping, frames can often get lost or
thrown away, only to be re-created as another object that still refers to the
same frame. We have another bug tracking that. But we need to be able to
have frames no longer be able to get the thread when they are not part of
a thread anymore, and this is the first step (this fix makes that possible
but doesn't implement it yet).

Also changed lldb_private::ExecutionContextScope to return shared pointers to
all objects in the execution context to further thread harden the internals.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
b4d7fc0c466d446876e5f2d701f0e574dd0be8e7 17-Feb-2012 Greg Clayton <gclayton@apple.com> This checking is part one of trying to add some threading safety to our
internals. The first part of this is to use a new class:

lldb_private::ExecutionContextRef

This class holds onto weak pointers to the target, process, thread and frame
and it also contains the thread ID and frame Stack ID in case the thread and
frame objects go away and come back as new objects that represent the same
logical thread/frame.

ExecutionContextRef objcets have accessors to access shared pointers for
the target, process, thread and frame which might return NULL if the backing
object is no longer available. This allows for references to persistent program
state without needing to hold a shared pointer to each object and potentially
keeping that object around for longer than it needs to be.

You can also "Lock" and ExecutionContextRef (which contains weak pointers)
object into an ExecutionContext (which contains strong, or shared pointers)
with code like

ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock());



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
149d1f525c4744c41984d4b9dab78f6a8ba1d147 01-Feb-2012 Jim Ingham <jingham@apple.com> Threads now store their "temporary" resume state, so we know whether they were suspended in the most
recent step, and if they weren't allowed to run, don't ask questions about their state unless explicitly
requested to do so.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
334d33a19fd28cf41cba74cc61cf149e7101a603 30-Jan-2012 Greg Clayton <gclayton@apple.com> SBFrame is now threadsafe using some extra tricks. One issue is that stack
frames might go away (the object itself, not the actual logical frame) when
we are single stepping due to the way we currently sometimes end up flushing
frames when stepping in/out/over. They later will come back to life
represented by another object yet they have the same StackID. Now when you get
a lldb::SBFrame object, it will track the frame it is initialized with until
the thread goes away or the StackID no longer exists in the stack for the
thread it was created on. It uses a weak_ptr to both the frame and thread and
also stores the StackID. These three items allow us to determine when the
stack frame object has gone away (the weak_ptr will be NULL) and allows us to
find the correct frame again. In our test suite we had such cases where we
were just getting lucky when something like this happened:

1 - stop at breakpoint
2 - get first frame in thread where we stopped
3 - run an expression that causes the program to JIT and run code
4 - run more expressions on the frame from step 2 which was very very luckily
still around inside a shared pointer, yet, not part of the current
thread (a new stack frame object had appeared with the same stack ID and
depth).

We now avoid all such issues and properly keep up to date, or we start
returning errors when the frame doesn't exist and always responds with
invalid answers.

Also fixed the UserSettingsController (not going to rewrite this just yet)
so that it doesn't crash on shutdown. Using weak_ptr's came in real handy to
track when the master controller has already gone away and this allowed me to
pull out the previous NotifyOwnerIsShuttingDown() patch as it is no longer
needed.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
13d24fb1817faa7ccc4cfd799113ba1a2b8968eb 29-Jan-2012 Greg Clayton <gclayton@apple.com> Switching back to using std::tr1::shared_ptr. We originally switched away
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).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
1586d9720002e407a3a097baf302de5fa4ca9c1b 17-Dec-2011 Jim Ingham <jingham@apple.com> Add the ability to capture the return value in a thread's stop info, and print it
as part of the thread format output.
Currently this is only done for the ThreadPlanStepOut.
Add a convenience API ABI::GetReturnValueObject.
Change the ValueObject::EvaluationPoint to BE an ExecutionContextScope, rather than
trying to hand out one of its subsidiary object's pointers. That way this will always
be good.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
987c7ebe1daa425ba7abfa9643800e3237146fc0 17-Sep-2011 Greg Clayton <gclayton@apple.com> Adopt the intrusive pointers in:

lldb_private::Breakpoint
lldb_private::BreakpointLocations
lldb_private::BreakpointSite
lldb_private::Debugger
lldb_private::StackFrame
lldb_private::Thread
lldb_private::Target



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
fdf24efe672bf3fa041cdbebd2d7f406b11882bd 09-Sep-2011 Jim Ingham <jingham@apple.com> Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line.
Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets
the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the
current source file.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
37f962e785be99dc4f0c5e9d02416992ff03bbd0 22-Aug-2011 Greg Clayton <gclayton@apple.com> Added a new plug-in type: lldb_private::OperatingSystem. The operating system
plug-ins are add on plug-ins for the lldb_private::Process class that can add
thread contexts that are read from memory. It is common in kernels to have
a lot of threads that are not currently executing on any cores (JTAG debugging
also follows this sort of thing) and are context switched out whose state is
stored in memory data structures. Clients can now subclass the OperatingSystem
plug-ins and then make sure their Create functions correcltly only enable
themselves when the right binary/target triple are being debugged. The
operating system plug-ins get a chance to attach themselves to processes just
after launching or attaching and are given a lldb_private::Process object
pointer which can be inspected to see if the main executable, target triple,
or any shared libraries match a case where the OS plug-in should be used.
Currently the OS plug-ins can create new threads, define the register contexts
for these threads (which can all be different if desired), and populate and
manage the thread info (stop reason, registers in the register context) as
the debug session goes on.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
c51ffbf896e398ada5f7e89b2fa5aec6f2224f09 12-Aug-2011 Greg Clayton <gclayton@apple.com> We were leaking a stack frame in StackFrameList in Thread.cpp which could
cause extra shared pointer references to one or more modules to be leaked.
This would cause many object files to stay around the life of LLDB, so after
a recompile and rexecution, we would keep adding more and more memory. After
fixing the leak, we found many cases where leaked stack frames were still
being used and causing crashes in the test suite. These are now all resolved.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
e426d855032b9b1962b98028b42e3a4e88975b03 03-Jun-2011 Peter Collingbourne <peter@pcc.me.uk> Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread base class

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@132586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
abe0fed36d83e1c37af9dae90c2d25db742b4515 18-Apr-2011 Greg Clayton <gclayton@apple.com> Centralized a lot of the status information for processes,
threads, and stack frame down in the lldb_private::Process,
lldb_private::Thread, lldb_private::StackFrameList and the
lldb_private::StackFrame classes. We had some command line
commands that had duplicate versions of the process status
output ("thread list" and "process status" for example).

Removed the "file" command and placed it where it should
have been: "target create". Made an alias for "file" to
"target create" so we stay compatible with GDB commands.

We can now have multple usable targets in lldb at the
same time. This is nice for comparing two runs of a program
or debugging more than one binary at the same time. The
new command is "target select <target-idx>" and also to see
a list of the current targets you can use the new "target list"
command. The flow in a debug session can be:

(lldb) target create /path/to/exe/a.out
(lldb) breakpoint set --name main
(lldb) run
... hit breakpoint
(lldb) target create /bin/ls
(lldb) run /tmp
Process 36001 exited with status = 0 (0x00000000)
(lldb) target list
Current targets:
target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
* target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) target select 0
Current targets:
* target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) bt
* thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1
frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16
frame #1: 0x0000000100000b64 a.out`start + 52

Above we created a target for "a.out" and ran and hit a
breakpoint at "main". Then we created a new target for /bin/ls
and ran it. Then we listed the targest and selected our original
"a.out" program, so we showed two concurent debug sessions
going on at the same time.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
5c4b1607e8783a3d3f1f28fa66fcaa89ac246bd1 31-Mar-2011 Jim Ingham <jingham@apple.com> Add GetFrameWithStackID to the StackFrameList and the Thread (which routes to its StackFrameList.)

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
2a456816c5d7c575f2e141acd48bb5f8085d9910 10-Mar-2011 Caroline Tice <ctice@apple.com> The UserSettings controllers must be initialized & terminated in the
correct order. Previously this was tacitly implemented but not
enforced, so it was possible to accidentally do things in the wrong
order and cause problems. This fixes that problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
f9f40c20b210eea72ab042c63178ca000f005ed9 08-Feb-2011 Jim Ingham <jingham@apple.com> Rework the RunThreadPlan event handling to use Event Hijacking not stopping the event thread. Also clarify the logic of the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
1ebdcc7789aac1ef30ad6dcd485dff86c63136ad 21-Jan-2011 Greg Clayton <gclayton@apple.com> Added support for stepping out of a frame. If you have 10 stack frames, and you
select frame #3, you can then do a step out and be able to go directly to the
frame above frame #3!

Added StepOverUntil and StepOutOfFrame to the SBThread API to allow more powerful
stepping.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
15dcb7ca49b8d8f46910cf085b4c249aac5317fa 20-Jan-2011 Jim Ingham <jingham@apple.com> Back up both the register AND the stop state when calling functions.
Set the thread state to "bland" before calling functions so they don't
inherit the pending signals and die.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
123db408a6bc06614ec893040aaad84d8d0d16f9 12-Jan-2011 Greg Clayton <gclayton@apple.com> Added the following functions to SBThread to allow threads to be suspended when a process is resumed:

bool SBThread::Suspend();
bool SBThread::Resume();
bool SBThread::IsSuspended();



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
08d7d3ae16110aa68ed40c161eac8571aeb94cd9 06-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed issues with RegisterContext classes and the subclasses. There was
an issue with the way the UnwindLLDB was handing out RegisterContexts: it
was making shared pointers to register contexts and then handing out just
the pointers (which would get put into shared pointers in the thread and
stack frame classes) and cause double free issues. MallocScribble helped to
find these issues after I did some other cleanup. To help avoid any
RegisterContext issue in the future, all code that deals with them now
returns shared pointers to the register contexts so we don't end up with
multiple deletions. Also now that the RegisterContext class doesn't require
a stack frame, we patched a memory leak where a StackFrame object was being
created and leaked.

Made the RegisterContext class not have a pointer to a StackFrame object as
one register context class can be used for N inlined stack frames so there is
not a 1 - 1 mapping. Updates the ExecutionContextScope part of the
RegisterContext class to never return a stack frame to indicate this when it
is asked to recreate the execution context. Now register contexts point to the
concrete frame using a concrete frame index. Concrete frames are all of the
frames that are actually formed on the stack of a thread. These concrete frames
can be turned into one or more user visible frames due to inlining. Each
inlined stack frame has the exact same register context (shared via shared
pointers) as any parent inlined stack frames all the way up to the concrete
frame itself.

So now the stack frames and the register contexts should behave much better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
6e889b142d6acbe1c318bc1b690dd9c3722d7095 17-Dec-2010 Greg Clayton <gclayton@apple.com> Removed libunwind sources as we aren't using them anymore.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
990de7bb41d3afec6b789155408ff322187d8682 19-Nov-2010 Greg Clayton <gclayton@apple.com> Cleaned up code that wasn't using the Initialize and Terminate paradigm by
changing it to use it. There was an extra parameter added to the static
accessor global user settings controllers that wasn't needed. A bool was being
used as a parameter to the accessor just so it could be used to clean up
the global user settings controller which is now fixed by splitting up the
initialization into the "static void Class::Initialize()", access into the
"static UserSettingsControllerSP & Class::GetSettingsController()", and
cleanup into "static void Class::Terminate()".

Also added initialize and terminate calls to the logging code to avoid issues
when LLDB is shutting down. There were cases after the logging was switched
over to use shared pointers where we could crash if the global destructor
chain was being run and it causes the log to be destroyed and any any logging
occurred.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
cdea2365030d283cd9082fa0b80bead79a104e55 18-Nov-2010 Jim Ingham <jingham@apple.com> The thread plan destructors may call Thread virtual methods. That means they have to get cleaned up in the derived class's destructor. Make sure that happens.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
48685687640e88515cd17b6fa613d13e180558d6 12-Nov-2010 Sean Callanan <scallanan@apple.com> Excised a version of the low-level function calling
logic that supported calling functions with arbitrary
arguments. We use ClangFunction for this, and the
low-level logic is only required to support one or two
pointer arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
745ac7a5826fe7c392007941a4046bfb1a8dff81 11-Nov-2010 Jim Ingham <jingham@apple.com> Add ThreadPlanTracer class to allow instruction step tracing of execution.
Also changed eSetVarTypeBool to eSetVarTypeBoolean to make it consistent with eArgTypeBoolean.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
ea9d4267a629a1c732eb0400fa0288cee31ad49d 05-Nov-2010 Jim Ingham <jingham@apple.com> Added the equivalent of gdb's "unwind-on-signal" to the expression command, and a parameter to control it in ClangUserExpression, and on down to ClangFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
7826c8894803dc729f29789ebc038956a94d3e7a 26-Oct-2010 Caroline Tice <ctice@apple.com> First pass at adding logging capabilities for the API functions. At the moment
it logs the function calls, their arguments and the return values. This is not
complete or polished, but I am committing it now, at the request of someone who
really wants to use it, even though it's not really done. It currently does not
attempt to log all the functions, just the most important ones. I will be
making further adjustments to the API logging code over the next few days/weeks.
(Suggestions for improvements are welcome).


Update the Python build scripts to re-build the swig C++ file whenever
the python-extensions.swig file is modified.

Correct the help for 'log enable' command (give it the correct number & type of
arguments).




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
6297a3a5c4d8b61f2429f371bdf207043dbca832 20-Oct-2010 Jim Ingham <jingham@apple.com> Don't cache the public stop reason, since it can change as plan completion 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
d168690e51f9020b926d3d0d57dc9a2cfb2095a8 15-Oct-2010 Jim Ingham <jingham@apple.com> Added support for breakpoint conditions. I also had to separate the "run 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
c12b6b40b93687539b0ca303f64eb77b6af6924d 11-Oct-2010 Greg Clayton <gclayton@apple.com> Added a new test case to test signals with.

Added frame relative frame selection to "frame select". You can now select
frames relative to the current frame (which defaults to zero if the current
frame hasn't yet been set for a thread):

The gdb "up" command can be done as:
(lldb) frame select -r 1
The gdb "down" command can be done as:
(lldb) frame select -r -1

Place the following in your ~/.lldbinit file for "up" and "down":

command alias up frame select -r 1
command alias down frame select -r -1




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
a830adbcd63d1995a01e6e18da79893c1426ca43 04-Oct-2010 Greg Clayton <gclayton@apple.com> There are now to new "settings set" variables that live in each debugger
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
1ebef44c126bd3a615b3ad844c46a82a82efa0e7 27-Sep-2010 Caroline Tice <ctice@apple.com> Create more useful instance names for target, process and thread instances.

Change default 'set' behavior so that all instance settings for the specified variable will be
updated, unless the "-n" ("--no_override") command options is specified.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
ccd584dccb920cdb028de69950774c3bcdc025ec 23-Sep-2010 Jim Ingham <jingham@apple.com> Add GetSP to the StackFrame.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
bcb5b454767121980d937d2610ba762fdb575c45 20-Sep-2010 Caroline Tice <ctice@apple.com> Make GetInstanceSettingsValue methods take an Error * rather than an Error &,
and have them return a bool to indicate success or not.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
5bc8c97d62b2e399bd90fb7e00c903d7887412ab 20-Sep-2010 Caroline Tice <ctice@apple.com> Add UserSettings to Target class, making Target settings
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
d0a5a23d734da7a2170802ccd096f53b8a527811 19-Sep-2010 Greg Clayton <gclayton@apple.com> Added code that will allow completely customizable prompts for use in
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
0021c97fbd17e38113d2e76b93c94ee05213ee45 16-Sep-2010 Johnny Chen <johnny.chen@apple.com> Undo 114084 and 114087 to unbreak the build for the time being.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
a2784ee3c8451936d50abf94dcb29527d1a2a85a 16-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Turns out CreateInstanceName is duplicated in two other places. Make them static too, sigh.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
004afcb95736e97d071b1dd9b5254800e11e581c 08-Sep-2010 Caroline Tice <ctice@apple.com> Make sure creating a pending instance doesn't also trigger creating a live 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
20594b1b003f63ed34ebafeec37634ee44552339 08-Sep-2010 Jim Ingham <jingham@apple.com> Add a user settings controller to Thread. Then added a step-avoid-regexp setting
which controls whether to stop in a function matching the regexp.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
5205f0b6585a127acc6ed210021abb6091220a89 03-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the StackFrame to correctly resolve the StackID's SymbolContextScope.

Added extra logging for stepping.

Fixed an issue where cached stack frame data could be lost between runs when
the thread plans read a stack frame.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
c833295baeec641086f536e78050388af36784f8 26-Aug-2010 Jim Ingham <jingham@apple.com> Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
f40e30823926f27e3cb9364f3c8fe2e4be0c7658 26-Aug-2010 Greg Clayton <gclayton@apple.com> Cleaned up the inline stack frame code one more time to prepare for inlined
code stepping. Also we now store the stack frames for the current and previous
stops in the thread in std::auto_ptr objects. When we create a thread stack
frame list we pass the previous frame into it so it can re-use the frames
and maintain will allow for variable changes to be detected. I will implement
the stack frame reuse next.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
782b9ccd9f2b290585cd6bb4c1f0cc6cb7e22e15 25-Aug-2010 Greg Clayton <gclayton@apple.com> Cleaned up the inline backtrace code even more by moving all stack backtracing
functionality into StackFrameList. This will allow us to copy the previous
stack backtrace from the previous stop into another variable so we can re-use
as much as possible from the previous stack backtrace.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
32f4fdde0882395aec2ea56d1adcce78759105b7 25-Aug-2010 Greg Clayton <gclayton@apple.com> Fixed another issue with the inline stack frames where if the first frame
has inlined functions that all started at the same address, then the inlined
backtrace would not produce correct stack frames.

Also cleaned up and inlined a lot of stuff in lldb_private::Address.

Added a function to StackFrame to detect if the frame is a concrete frame so
we can detect the difference between actual frames and inlined frames.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
22a6bf31b82dcf47ff6014bc47a99173595f156f 24-Aug-2010 Greg Clayton <gclayton@apple.com> Clear the inline stack frame info when we clean all stack frames.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
33ed170599d41fe407a4dcf5f0875c75e1ad1375 24-Aug-2010 Greg Clayton <gclayton@apple.com> Added support for inlined stack frames being represented as real stack frames
which is now on by default. Frames are gotten from the unwinder as concrete
frames, then if inline frames are to be shown, extra information to track
and reconstruct these frames is cached with each Thread and exanded as needed.

I added an inline height as part of the lldb_private::StackID class, the class
that helps us uniquely identify stack frames. This allows for two frames to
shared the same call frame address, yet differ only in inline height.

Fixed setting breakpoint by address to not require addresses to resolve.

A quick example:

% cat main.cpp

% ./build/Debug/lldb test/stl/a.out
Current executable set to 'test/stl/a.out' (x86_64).
(lldb) breakpoint set --address 0x0000000100000d31
Breakpoint created: 1: address = 0x0000000100000d31, locations = 1
(lldb) r
Launching 'a.out' (x86_64)
(lldb) Process 38031 Stopped
* thread #1: tid = 0x2e03, pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280, stop reason = breakpoint 1.1, queue = com.apple.main-thread
277
278 _CharT*
279 _M_data() const
280 -> { return _M_dataplus._M_p; }
281
282 _CharT*
283 _M_data(_CharT* __p)
(lldb) bt
thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread
frame #0: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280
frame #1: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_rep() const at /usr/include/c++/4.2.1/bits/basic_string.h:288
frame #2: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::size() const at /usr/include/c++/4.2.1/bits/basic_string.h:606
frame #3: pc = 0x0000000100000d31, where = a.out`main [inlined] operator<< <char, std::char_traits<char>, std::allocator<char> > at /usr/include/c++/4.2.1/bits/basic_string.h:2414
frame #4: pc = 0x0000000100000d31, where = a.out`main + 33 at /Volumes/work/gclayton/Documents/src/lldb/test/stl/main.cpp:14
frame #5: pc = 0x0000000100000d08, where = a.out`start + 52

Each inline frame contains only the variables that they contain and each inlined
stack frame is treated as a single entity.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
71219089a9896e3c5c307f7465c8f90f2a9f6d68 12-Aug-2010 Jim Ingham <jingham@apple.com> Now that we are using the Unwinder (or Jason's new unwinder when that comes about) all the plugin-specific details of getting stack frames
should be hidden behind that, and the "GetStackFrameAtIndex" and "GetStackFrameCount" algorithms become generic. So I moved them to Thread.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
643ee7301b5d4b05c321d906bc0d7ff11f571295 04-Aug-2010 Greg Clayton <gclayton@apple.com> Abtracted the old "lldb_private::Thread::StopInfo" into an abtract class.
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
7661a98ba99c585034bc60dbe43ad80599cc6dd3 23-Jul-2010 Greg Clayton <gclayton@apple.com> Centralized the Mach exception stop info code by adding it as a first
class citizen on the StopInfo class.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
5a47e8bcc7277dc3683f2af2aeb9717184e8360c 19-Jun-2010 Jim Ingham <jingham@apple.com> Two changes in this checkin. Added a ThreadPlanKind so that I can do some reasoning based on the kind of thread plan
without having to use RTTI.
Removed the ThreadPlanContinue and replaced with a ShouldAutoContinue query that serves the same purpose. Having to push
another plan to assert that if there's no other indication the target should continue when this plan is popped was flakey
and error prone. This method is more stable, and fixed problems we were having with thread specific breakpoints.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
649492b3614c11e52a2dbe3693bbdf97efec9ba0 18-Jun-2010 Jim Ingham <jingham@apple.com> Change the Breakpoint & BreakpointLocation GetDescription methods so they call the BreakpointOptions::GetDescription rather
than picking bits out of the breakpoint options. Added BreakpointOptions::GetDescription to do this job. Some more mucking
around to keep the breakpoint listing from getting too verbose.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
3c7b5b9f83cae58ca366db2bba37dc09485f7dcc 16-Jun-2010 Jim Ingham <jingham@apple.com> Add a "thread specification" class that specifies thread specific breakpoints by name, index, queue or TID.
Push this through all the breakpoint management code. Allow this to be set when the breakpoint is created.
Fix the Process classes so that a breakpoint hit that is not for a particular thread is not reported as a
breakpoint hit event for that thread.
Added a "breakpoint configure" command to allow you to reset any of the thread
specific options (or the ignore count.)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
8f5fd6b999b0c9b7398870ccc3ed438d7a6a0830 12-Jun-2010 Greg Clayton <gclayton@apple.com> I have eliminated RTTI from LLDB!

Also added a shell script build phase that fixes the headers in
LLDB.framework.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Target/Thread.h