blob: e6f46e272377d13ce3e66c20c36bac8379feac7a [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 Molenda8ee9cb52013-11-16 01:24:22 +000068 const char *
69 GetThreadName ()
70 {
71 return m_thread_name.c_str();
72 }
73
74 uint32_t
75 GetExtendedBacktraceOriginatingIndexID ();
76
77 void
78 SetThreadName (const char *name)
79 {
80 m_thread_name = name;
81 }
82
Jason Molenda02706c32013-11-08 04:59:54 +000083protected:
84 virtual lldb::StackFrameListSP
85 GetStackFrameList ();
86
87 mutable Mutex m_framelist_mutex;
88 lldb::StackFrameListSP m_framelist;
89 std::vector<lldb::addr_t> m_pcs;
90 uint32_t m_stop_id;
91 bool m_stop_id_is_valid;
Jason Molendaa7b5afa2013-11-15 00:17:32 +000092
93 uint64_t m_extended_unwind_token;
94 std::string m_queue_name;
Jason Molenda8ee9cb52013-11-16 01:24:22 +000095 std::string m_thread_name;
96 lldb::tid_t m_originating_unique_thread_id;
Jason Molenda02706c32013-11-08 04:59:54 +000097};
98
99} // namespace lldb_private
100
101#endif // liblldb_HistoryThread_h_