1 //===-- HistoryThread.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_HistoryThread_h_
11 #define liblldb_HistoryThread_h_
13 #include "lldb/lldb-private.h"
14 #include "lldb/Host/Mutex.h"
15 #include "lldb/Core/Broadcaster.h"
16 #include "lldb/Core/Event.h"
17 #include "lldb/Core/UserID.h"
18 #include "lldb/Core/UserSettingsController.h"
19 #include "lldb/Target/ExecutionContextScope.h"
20 #include "lldb/Target/StackFrameList.h"
21 #include "lldb/Target/Thread.h"
23 namespace lldb_private {
25 //----------------------------------------------------------------------
26 /// @class HistoryThread HistoryThread.h "HistoryThread.h"
27 /// @brief A thread object representing a backtrace from a previous point in the process execution
29 /// This subclass of Thread is used to provide a backtrace from earlier in
30 /// process execution. It is given a backtrace list of pc addresses and
31 /// optionally a stop_id of when those pc addresses were collected, and it will
32 /// create stack frames for them.
33 //----------------------------------------------------------------------
35 class HistoryThread : public lldb_private::Thread
38 HistoryThread (lldb_private::Process &process, lldb::tid_t tid, std::vector<lldb::addr_t> pcs, uint32_t stop_id, bool stop_id_is_valid);
40 virtual ~HistoryThread ();
42 virtual lldb::RegisterContextSP
43 GetRegisterContext ();
45 virtual lldb::RegisterContextSP
46 CreateRegisterContextForFrame (StackFrame *frame);
49 RefreshStateAfterStop() { }
52 CalculateStopInfo () { return false; }
55 SetExtendedBacktraceToken (uint64_t token)
57 m_extended_unwind_token = token;
61 GetExtendedBacktraceToken ()
63 return m_extended_unwind_token;
69 return m_queue_name.c_str();
73 SetQueueName (const char *name)
85 SetQueueID (lldb::queue_id_t queue)
93 return m_thread_name.c_str();
97 GetExtendedBacktraceOriginatingIndexID ();
100 SetThreadName (const char *name)
102 m_thread_name = name;
106 virtual lldb::StackFrameListSP
107 GetStackFrameList ();
109 mutable Mutex m_framelist_mutex;
110 lldb::StackFrameListSP m_framelist;
111 std::vector<lldb::addr_t> m_pcs;
113 bool m_stop_id_is_valid;
115 uint64_t m_extended_unwind_token;
116 std::string m_queue_name;
117 std::string m_thread_name;
118 lldb::tid_t m_originating_unique_thread_id;
119 lldb::queue_id_t m_queue_id;
122 } // namespace lldb_private
124 #endif // liblldb_HistoryThread_h_