File indexing completed on 2026-05-10 08:42:54
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_QUEUEITEM_H
0010 #define LLDB_TARGET_QUEUEITEM_H
0011
0012 #include <memory>
0013 #include <string>
0014 #include <vector>
0015
0016 #include "lldb/lldb-enumerations.h"
0017 #include "lldb/lldb-forward.h"
0018 #include "lldb/lldb-private.h"
0019
0020 #include "lldb/Core/Address.h"
0021 #include "lldb/Utility/ConstString.h"
0022
0023 namespace lldb_private {
0024
0025
0026
0027
0028
0029
0030
0031
0032 class QueueItem : public std::enable_shared_from_this<QueueItem> {
0033 public:
0034 QueueItem(lldb::QueueSP queue_sp, lldb::ProcessSP process_sp,
0035 lldb::addr_t item_ref, lldb_private::Address address);
0036
0037 ~QueueItem();
0038
0039
0040
0041
0042
0043
0044 lldb::QueueItemKind GetKind();
0045
0046
0047
0048
0049
0050 void SetKind(lldb::QueueItemKind item_kind);
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 lldb_private::Address &GetAddress();
0063
0064
0065
0066
0067
0068
0069 void SetAddress(lldb_private::Address addr);
0070
0071
0072
0073
0074
0075
0076
0077
0078 bool IsValid() { return m_queue_wp.lock() != nullptr; }
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092 lldb::ThreadSP GetExtendedBacktraceThread(ConstString type);
0093
0094 void SetItemThatEnqueuedThis(lldb::addr_t address_of_item) {
0095 m_item_that_enqueued_this_ref = address_of_item;
0096 }
0097
0098 lldb::addr_t GetItemThatEnqueuedThis();
0099
0100 void SetEnqueueingThreadID(lldb::tid_t tid) { m_enqueueing_thread_id = tid; }
0101
0102 lldb::tid_t GetEnqueueingThreadID();
0103
0104 void SetEnqueueingQueueID(lldb::queue_id_t qid) {
0105 m_enqueueing_queue_id = qid;
0106 }
0107
0108 lldb::queue_id_t GetEnqueueingQueueID();
0109
0110 void SetTargetQueueID(lldb::queue_id_t qid) { m_target_queue_id = qid; }
0111
0112 void SetStopID(uint32_t stop_id) { m_stop_id = stop_id; }
0113
0114 uint32_t GetStopID();
0115
0116 void SetEnqueueingBacktrace(std::vector<lldb::addr_t> backtrace) {
0117 m_backtrace = backtrace;
0118 }
0119
0120 std::vector<lldb::addr_t> &GetEnqueueingBacktrace();
0121
0122 void SetThreadLabel(std::string thread_name) { m_thread_label = thread_name; }
0123
0124 std::string GetThreadLabel();
0125
0126 void SetQueueLabel(std::string queue_name) { m_queue_label = queue_name; }
0127
0128 std::string GetQueueLabel();
0129
0130 void SetTargetQueueLabel(std::string queue_name) {
0131 m_target_queue_label = queue_name;
0132 }
0133
0134 lldb::ProcessSP GetProcessSP();
0135
0136 protected:
0137 void FetchEntireItem();
0138
0139 lldb::QueueWP m_queue_wp;
0140 lldb::ProcessWP m_process_wp;
0141
0142 lldb::addr_t m_item_ref;
0143
0144 lldb_private::Address m_address;
0145 bool m_have_fetched_entire_item;
0146
0147 lldb::QueueItemKind m_kind;
0148 lldb::addr_t m_item_that_enqueued_this_ref;
0149
0150
0151 lldb::tid_t m_enqueueing_thread_id;
0152 lldb::queue_id_t
0153 m_enqueueing_queue_id;
0154 lldb::queue_id_t m_target_queue_id;
0155 uint32_t m_stop_id;
0156 std::vector<lldb::addr_t> m_backtrace;
0157 std::string m_thread_label;
0158 std::string m_queue_label;
0159 std::string m_target_queue_label;
0160
0161 private:
0162 QueueItem(const QueueItem &) = delete;
0163 const QueueItem &operator=(const QueueItem &) = delete;
0164 };
0165
0166 }
0167
0168 #endif