llvm-project/lldb/source/Target
Dave Lee b0186c25c6 [lldb] Refine ThreadPlan::ShouldAutoContinue
Adjust `ShouldAutoContinue` to be available to any thread plan previous to the plan that
explains a stop, not limited to the parent to the plan that explains the stop.

Before this change, `Thread::ShouldStop` did the following:

1. find the plan that explains the stop
2. if it's not a master plan, continue processing previous (aka parent) plans
3. first, call `ShouldAutoContinue` on the immediate parent of the explaining plan
4. then loop over previous plans, calling `ShouldStop` and `MischiefManaged`

Of note, the iteration in step 4 does not call `ShouldAutoContinue`, so again only the
plan just prior to the explaining plan is given the opportunity to override whether to
continue or stop.

This commit changes the loop call `ShouldAutoContinue`, giving each plan the opportunity
to override `ShouldStop` of previous plans.

Why? This allows a plan to do the following:

1. mark itself done and be popped off the stack
2. allow parent plans to finish their work, and to also be popped off the stack
3. and finally, have the thread continue, not stop

This is useful for stepping into async functions. A plan will would step far enough
enough to set a breakpoint on the async target, and then use `ShouldAutoContinue` to
unwind the necessary stepping, and then have the calling thread continue.

Differential Revision: https://reviews.llvm.org/D97076
2021-02-20 17:25:31 -08:00
..
ABI.cpp Make the error condition in Value::ValueType explicit (NFC) 2021-02-12 16:12:31 -08:00
AssertFrameRecognizer.cpp The AssertRecognizer used the module from a frames SC without checking it was non-null. 2020-11-13 11:41:32 -08:00
CMakeLists.txt [trace] rename ThreadIntelPT into TraceTrace 2020-10-19 15:15:02 -07:00
ExecutionContext.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
InstrumentationRuntime.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
InstrumentationRuntimeStopInfo.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
JITLoader.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
JITLoaderList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Language.cpp [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper 2020-05-04 14:06:55 -07:00
LanguageRuntime.cpp LanguageRuntime can provide an UnwindPlan for special occasions 2021-02-18 23:23:15 -08:00
Memory.cpp [LLDB] Fix AddressSanitizer failure in MemoryCache 2020-02-27 11:17:10 -08:00
MemoryHistory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
MemoryRegionInfo.cpp [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
ModuleCache.cpp [lldb] Use std::make_unique<> (NFC) 2020-06-24 17:48:40 -07:00
OperatingSystem.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
PathMappingList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Platform.cpp [lldb] "target create" shouldn't save target if the command failed 2020-12-12 16:40:58 +03:00
Process.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ProcessTrace.cpp [ThreadPlan] fix exec on Linux 2021-01-25 11:30:48 -08:00
Queue.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
QueueItem.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
QueueList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContext.cpp Remove code duplication from RegisterContextPOSIX_* 2020-06-18 01:02:46 +05:00
RegisterContextUnwind.cpp LanguageRuntime can provide an UnwindPlan for special occasions 2021-02-18 23:23:15 -08:00
RegisterNumber.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RemoteAwarePlatform.cpp [lldb/Target] Add custom interpreter option to `platform shell` 2020-09-02 16:36:10 +02:00
SectionLoadHistory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SectionLoadList.cpp [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
StackFrame.cpp [lldb] Fix a regression introduced by D75730 2020-10-22 08:38:03 -07:00
StackFrameList.cpp [lldb] Fix -Wmissing-field-initializers in StackFrameList 2020-06-09 11:58:08 +02:00
StackFrameRecognizer.cpp [lldb] Make deleting frame recognizers actually work 2020-07-23 17:43:37 +02:00
StackID.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StopInfo.cpp [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
StructuredDataPlugin.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SystemRuntime.cpp [lldb] Have LanguageRuntime and SystemRuntime share a base class (NFC) 2020-07-24 16:28:34 -07:00
Target.cpp Reland "[lldb] Make CommandInterpreter's execution context the same as debugger's one" 2021-02-08 15:09:09 +03:00
TargetList.cpp [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
TargetProperties.td [lldb] Allow LLDB to automatically retry a failed expression with an imported std C++ module 2020-12-10 12:29:17 +01:00
Thread.cpp [lldb] Refine ThreadPlan::ShouldAutoContinue 2021-02-20 17:25:31 -08:00
ThreadCollection.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadList.cpp Allow the ThreadPlanStackMap to hold the thread plans for threads 2020-04-03 14:56:28 -07:00
ThreadPlan.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanBase.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanCallFunction.cpp [lldb] Minor refinements to ThreadPlan::RestoreThreadState (NFC) 2021-02-15 17:57:13 -08:00
ThreadPlanCallFunctionUsingABI.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanCallOnFunctionExit.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadPlanCallUserExpression.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanPython.cpp Add a setting to force stepping to always run all threads. 2020-08-07 14:47:31 -07:00
ThreadPlanRunToAddress.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanShouldStopHere.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadPlanStack.cpp [lldb] Remove unused ThreadPlan tracer utilities (NFC) 2021-02-15 17:59:25 -08:00
ThreadPlanStepInRange.cpp [lldb] Add step target to ThreadPlanStepInRange constructor 2021-02-11 14:57:20 -08:00
ThreadPlanStepInstruction.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOut.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOverBreakpoint.cpp [lldb] Don't use static locals for return value storage in some *AsCString functions 2020-07-30 12:17:42 +02:00
ThreadPlanStepOverRange.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanStepRange.cpp Remove special Hexagon packet traversal code 2020-08-05 12:05:42 -05:00
ThreadPlanStepThrough.cpp [lldb] Remove very old misleading comment (NFC) 2021-02-15 18:14:57 -08:00
ThreadPlanStepUntil.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanTracer.cpp [lldb] Remove unused ThreadPlan tracer utilities (NFC) 2021-02-15 17:59:25 -08:00
ThreadSpec.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadTrace.cpp [trace] rename ThreadIntelPT into TraceTrace 2020-10-19 15:15:02 -07:00
Trace.cpp [trace][intel-pt] Implement the basic decoding functionality 2020-11-05 18:38:03 -08:00
TraceSessionFileParser.cpp [lldb] "target create" shouldn't save target if the command failed 2020-12-12 16:40:58 +03:00
UnixSignals.cpp [lldb] Format remaining signal table (NFC) 2020-10-08 21:51:41 -07:00
UnwindAssembly.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
UnwindLLDB.cpp [lldb] Make UnwindLLDB a non-plugin 2020-03-10 13:56:15 +01:00