blob: 01fdd1608706f60ce70f31dd5c84897ce1fc99e5 [file] [log] [blame]
Jason Molenda02706c32013-11-08 04:59:54 +00001//===-- HistoryThread.h -----------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_HistoryThread_h_
11#define liblldb_HistoryThread_h_
12
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"
22
23namespace lldb_private {
24
25class HistoryThread : public lldb_private::Thread
26{
27public:
Jason Molenda8ee9cb52013-11-16 01:24:22 +000028 HistoryThread (lldb_private::Process &process, lldb::tid_t tid, std::vector<lldb::addr_t> pcs, uint32_t stop_id, bool stop_id_is_valid);
Jason Molenda02706c32013-11-08 04:59:54 +000029
30 virtual ~HistoryThread ();
31
32 virtual lldb::RegisterContextSP
33 GetRegisterContext ();
34
35 virtual lldb::RegisterContextSP
36 CreateRegisterContextForFrame (StackFrame *frame);
37
38 virtual void
39 RefreshStateAfterStop() { }
40
41 bool
42 CalculateStopInfo () { return false; }
43
Jason Molendaa7b5afa2013-11-15 00:17:32 +000044 void
45 SetExtendedBacktraceToken (uint64_t token)
46 {
47 m_extended_unwind_token = token;
48 }
49
50 uint64_t
51 GetExtendedBacktraceToken ()
52 {
53 return m_extended_unwind_token;
54 }
55
56 const char *
57 GetQueueName ()
58 {
59 return m_queue_name.c_str();
60 }
61
62 void
63 SetQueueName (const char *name)
64 {
65 m_queue_name = name;
66 }
67
Jason Molendaa6e91302013-11-19 05:44:41 +000068 lldb::queue_id_t
69 GetQueueID ()
70 {
71 return m_queue_id;
72 }
73
74 void
75 SetQueueID (lldb::queue_id_t queue)
76 {
77 m_queue_id = queue;
78 }
79
Jason Molenda8ee9cb52013-11-16 01:24:22 +000080 const char *
81 GetThreadName ()
82 {
83 return m_thread_name.c_str();
84 }
85
86 uint32_t
87 GetExtendedBacktraceOriginatingIndexID ();
88
89 void
90 SetThreadName (const char *name)
91 {
92 m_thread_name = name;
93 }
94
Jason Molenda02706c32013-11-08 04:59:54 +000095protected:
96 virtual lldb::StackFrameListSP
97 GetStackFrameList ();
98
99 mutable Mutex m_framelist_mutex;
100 lldb::StackFrameListSP m_framelist;
101 std::vector<lldb::addr_t> m_pcs;
102 uint32_t m_stop_id;
103 bool m_stop_id_is_valid;
Jason Molendaa7b5afa2013-11-15 00:17:32 +0000104
105 uint64_t m_extended_unwind_token;
106 std::string m_queue_name;
Jason Molenda8ee9cb52013-11-16 01:24:22 +0000107 std::string m_thread_name;
108 lldb::tid_t m_originating_unique_thread_id;
Jason Molendaa6e91302013-11-19 05:44:41 +0000109 lldb::queue_id_t m_queue_id;
Jason Molenda02706c32013-11-08 04:59:54 +0000110};
111
112} // namespace lldb_private
113
114#endif // liblldb_HistoryThread_h_