/usr/lib/llvm-3.4/include/lldb/Target/ThreadList.h is in liblldb-3.4-dev 1:3.4.2-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | //===-- ThreadList.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_ThreadList_h_
#define liblldb_ThreadList_h_
#include <vector>
#include "lldb/lldb-private.h"
#include "lldb/Core/UserID.h"
#include "lldb/Utility/Iterable.h"
// FIXME: Currently this is a thread list with lots of functionality for use only by
// the process for which this is the thread list. If we ever want a container class
// to hand out that is just a random subset of threads, with iterator functionality,
// then we should make that part a base class, and make a ProcessThreadList for the
// process.
namespace lldb_private {
class ThreadList
{
friend class Process;
public:
ThreadList (Process *process);
ThreadList (const ThreadList &rhs);
~ThreadList ();
const ThreadList&
operator = (const ThreadList& rhs);
uint32_t
GetSize(bool can_update = true);
void
AddThread (const lldb::ThreadSP &thread_sp);
// Return the selected thread if there is one. Otherwise, return the thread
// selected at index 0.
lldb::ThreadSP
GetSelectedThread ();
bool
SetSelectedThreadByID (lldb::tid_t tid, bool notify = false);
bool
SetSelectedThreadByIndexID (uint32_t index_id, bool notify = false);
void
Clear();
void
Flush();
void
Destroy();
// Note that "idx" is not the same as the "thread_index". It is a zero
// based index to accessing the current threads, whereas "thread_index"
// is a unique index assigned
lldb::ThreadSP
GetThreadAtIndex (uint32_t idx, bool can_update = true);
typedef std::vector<lldb::ThreadSP> collection;
typedef LockingAdaptedIterable<collection, lldb::ThreadSP, vector_adapter> ThreadIterable;
ThreadIterable
Threads ()
{
return ThreadIterable(m_threads, GetMutex());
}
lldb::ThreadSP
FindThreadByID (lldb::tid_t tid, bool can_update = true);
lldb::ThreadSP
FindThreadByProtocolID (lldb::tid_t tid, bool can_update = true);
lldb::ThreadSP
RemoveThreadByID (lldb::tid_t tid, bool can_update = true);
lldb::ThreadSP
RemoveThreadByProtocolID (lldb::tid_t tid, bool can_update = true);
lldb::ThreadSP
FindThreadByIndexID (uint32_t index_id, bool can_update = true);
lldb::ThreadSP
GetThreadSPForThreadPtr (Thread *thread_ptr);
bool
ShouldStop (Event *event_ptr);
Vote
ShouldReportStop (Event *event_ptr);
Vote
ShouldReportRun (Event *event_ptr);
void
RefreshStateAfterStop ();
//------------------------------------------------------------------
/// The thread list asks tells all the threads it is about to resume.
/// If a thread can "resume" without having to resume the target, it
/// will return false for WillResume, and then the process will not be
/// restarted.
///
/// @return
/// \b true instructs the process to resume normally,
/// \b false means start & stopped events will be generated, but
/// the process will not actually run. The thread must then return
/// the correct StopInfo when asked.
///
//------------------------------------------------------------------
bool
WillResume ();
void
DidResume ();
void
DidStop ();
void
DiscardThreadPlans();
uint32_t
GetStopID () const;
void
SetStopID (uint32_t stop_id);
Mutex &
GetMutex ();
void
Update (ThreadList &rhs);
protected:
void
SetShouldReportStop (Vote vote);
void
NotifySelectedThreadChanged (lldb::tid_t tid);
//------------------------------------------------------------------
// Classes that inherit from Process can see and modify these
//------------------------------------------------------------------
Process *m_process; ///< The process that manages this thread list.
uint32_t m_stop_id; ///< The process stop ID that this thread list is valid for.
collection m_threads; ///< The threads for this process.
lldb::tid_t m_selected_tid; ///< For targets that need the notion of a current thread.
private:
ThreadList ();
};
} // namespace lldb_private
#endif // liblldb_ThreadList_h_
|