003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/include/lldb/Target
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
include
/
lldb
/
Target
/
📁
..
📄
ABI.h
(7 KB)
📄
AssertFrameRecognizer.h
(1.79 KB)
📄
DynamicLoader.h
(12.8 KB)
📄
ExecutionContext.h
(23.91 KB)
📄
ExecutionContextScope.h
(2.07 KB)
📄
InstrumentationRuntime.h
(3.06 KB)
📄
InstrumentationRuntimeStopInfo.h
(1.3 KB)
📄
JITLoader.h
(2.15 KB)
📄
JITLoaderList.h
(1.17 KB)
📄
Language.h
(9.42 KB)
📄
LanguageRuntime.h
(6.71 KB)
📄
Memory.h
(4.66 KB)
📄
MemoryHistory.h
(998 B)
📄
MemoryRegionInfo.h
(4.76 KB)
📄
ModuleCache.h
(2.42 KB)
📄
OperatingSystem.h
(2.66 KB)
📄
PathMappingList.h
(4.09 KB)
📄
Platform.h
(42.4 KB)
📄
Process.h
(110.8 KB)
📄
ProcessStructReader.h
(3.27 KB)
📄
Queue.h
(5.04 KB)
📄
QueueItem.h
(5.24 KB)
📄
QueueList.h
(3.32 KB)
📄
RegisterCheckpoint.h
(1.89 KB)
📄
RegisterContext.h
(7.73 KB)
📄
RegisterContextUnwind.h
(9.73 KB)
📄
RegisterNumber.h
(1.71 KB)
📄
RemoteAwarePlatform.h
(3.76 KB)
📄
SectionLoadHistory.h
(2.79 KB)
📄
SectionLoadList.h
(2.36 KB)
📄
StackFrame.h
(20.05 KB)
📄
StackFrameList.h
(5.83 KB)
📄
StackFrameRecognizer.h
(5.65 KB)
📄
StackID.h
(3.16 KB)
📄
StopInfo.h
(6.92 KB)
📄
StructuredDataPlugin.h
(7.14 KB)
📄
SystemRuntime.h
(11.83 KB)
📄
Target.h
(49.2 KB)
📄
TargetList.h
(7.75 KB)
📄
Thread.h
(49.21 KB)
📄
ThreadCollection.h
(1.63 KB)
📄
ThreadList.h
(4.65 KB)
📄
ThreadPlan.h
(24.41 KB)
📄
ThreadPlanBase.h
(1.79 KB)
📄
ThreadPlanCallFunction.h
(5.55 KB)
📄
ThreadPlanCallFunctionUsingABI.h
(1.98 KB)
📄
ThreadPlanCallOnFunctionExit.h
(1.56 KB)
📄
ThreadPlanCallUserExpression.h
(2.21 KB)
📄
ThreadPlanPython.h
(2.11 KB)
📄
ThreadPlanRunToAddress.h
(2.04 KB)
📄
ThreadPlanShouldStopHere.h
(5.02 KB)
📄
ThreadPlanStack.h
(5.48 KB)
📄
ThreadPlanStepInRange.h
(4.66 KB)
📄
ThreadPlanStepInstruction.h
(1.86 KB)
📄
ThreadPlanStepOut.h
(3.67 KB)
📄
ThreadPlanStepOverBreakpoint.h
(1.84 KB)
📄
ThreadPlanStepOverRange.h
(1.83 KB)
📄
ThreadPlanStepRange.h
(3.69 KB)
📄
ThreadPlanStepThrough.h
(1.97 KB)
📄
ThreadPlanStepUntil.h
(2.12 KB)
📄
ThreadPlanTracer.h
(2.32 KB)
📄
ThreadSpec.h
(3.35 KB)
📄
UnixSignals.h
(4.25 KB)
📄
Unwind.h
(2.4 KB)
📄
UnwindAssembly.h
(1.81 KB)
📄
UnwindLLDB.h
(5.69 KB)
Editing: ThreadPlanStack.h
//===-- ThreadPlanStack.h ---------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLDB_TARGET_THREADPLANSTACK_H #define LLDB_TARGET_THREADPLANSTACK_H #include <mutex> #include <string> #include <unordered_map> #include <vector> #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-private.h" namespace lldb_private { // The ThreadPlans have a thread for use when they are asked all the ThreadPlan // state machine questions, but they should never cache any pointers from their // owning lldb_private::Thread. That's because we want to be able to detach // them from an owning thread, then reattach them by TID. // The ThreadPlanStack holds the ThreadPlans for a given TID. All its methods // are private, and it should only be accessed through the owning thread. When // it is detached from a thread, all you can do is reattach it or delete it. class ThreadPlanStack { friend class lldb_private::Thread; public: ThreadPlanStack(const Thread &thread, bool make_empty = false); ~ThreadPlanStack() {} enum StackKind { ePlans, eCompletedPlans, eDiscardedPlans }; using PlanStack = std::vector<lldb::ThreadPlanSP>; void DumpThreadPlans(Stream &s, lldb::DescriptionLevel desc_level, bool include_internal) const; size_t CheckpointCompletedPlans(); void RestoreCompletedPlanCheckpoint(size_t checkpoint); void DiscardCompletedPlanCheckpoint(size_t checkpoint); void ThreadDestroyed(Thread *thread); void EnableTracer(bool value, bool single_stepping); void SetTracer(lldb::ThreadPlanTracerSP &tracer_sp); void PushPlan(lldb::ThreadPlanSP new_plan_sp); lldb::ThreadPlanSP PopPlan(); lldb::ThreadPlanSP DiscardPlan(); // If the input plan is nullptr, discard all plans. Otherwise make sure this // plan is in the stack, and if so discard up to and including it. void DiscardPlansUpToPlan(ThreadPlan *up_to_plan_ptr); void DiscardAllPlans(); void DiscardConsultingMasterPlans(); lldb::ThreadPlanSP GetCurrentPlan() const; lldb::ThreadPlanSP GetCompletedPlan(bool skip_private = true) const; lldb::ThreadPlanSP GetPlanByIndex(uint32_t plan_idx, bool skip_private = true) const; lldb::ValueObjectSP GetReturnValueObject() const; lldb::ExpressionVariableSP GetExpressionVariable() const; bool AnyPlans() const; bool AnyCompletedPlans() const; bool AnyDiscardedPlans() const; bool IsPlanDone(ThreadPlan *plan) const; bool WasPlanDiscarded(ThreadPlan *plan) const; ThreadPlan *GetPreviousPlan(ThreadPlan *current_plan) const; ThreadPlan *GetInnermostExpression() const; void WillResume(); private: const PlanStack &GetStackOfKind(ThreadPlanStack::StackKind kind) const; void PrintOneStack(Stream &s, llvm::StringRef stack_name, const PlanStack &stack, lldb::DescriptionLevel desc_level, bool include_internal) const; PlanStack m_plans; ///< The stack of plans this thread is executing. PlanStack m_completed_plans; ///< Plans that have been completed by this /// stop. They get deleted when the thread /// resumes. PlanStack m_discarded_plans; ///< Plans that have been discarded by this /// stop. They get deleted when the thread /// resumes. size_t m_completed_plan_checkpoint = 0; // Monotonically increasing token for // completed plan checkpoints. std::unordered_map<size_t, PlanStack> m_completed_plan_store; }; class ThreadPlanStackMap { public: ThreadPlanStackMap(Process &process) : m_process(process) {} ~ThreadPlanStackMap() {} // Prune the map using the current_threads list. void Update(ThreadList ¤t_threads, bool delete_missing, bool check_for_new = true); void AddThread(Thread &thread) { lldb::tid_t tid = thread.GetID(); m_plans_list.emplace(tid, thread); } bool RemoveTID(lldb::tid_t tid) { auto result = m_plans_list.find(tid); if (result == m_plans_list.end()) return false; result->second.ThreadDestroyed(nullptr); m_plans_list.erase(result); return true; } ThreadPlanStack *Find(lldb::tid_t tid) { auto result = m_plans_list.find(tid); if (result == m_plans_list.end()) return nullptr; else return &result->second; } void Clear() { for (auto plan : m_plans_list) plan.second.ThreadDestroyed(nullptr); m_plans_list.clear(); } // Implements Process::DumpThreadPlans void DumpPlans(Stream &strm, lldb::DescriptionLevel desc_level, bool internal, bool ignore_boring, bool skip_unreported); // Implements Process::DumpThreadPlansForTID bool DumpPlansForTID(Stream &strm, lldb::tid_t tid, lldb::DescriptionLevel desc_level, bool internal, bool ignore_boring, bool skip_unreported); bool PrunePlansForTID(lldb::tid_t tid); private: Process &m_process; using PlansList = std::unordered_map<lldb::tid_t, ThreadPlanStack>; PlansList m_plans_list; }; } // namespace lldb_private #endif // LLDB_TARGET_THREADPLANSTACK_H
Upload File
Create Folder