LLDB  mainline
TraceOptions.h
Go to the documentation of this file.
1 //===-- TraceOptions.h ------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_TraceOptions_h_
10 #define liblldb_TraceOptions_h_
11 
12 #include "lldb/lldb-defines.h"
13 #include "lldb/lldb-enumerations.h"
14 
16 
17 namespace lldb_private {
18 class TraceOptions {
19 public:
20  TraceOptions() : m_trace_params(new StructuredData::Dictionary()) {}
21 
23  return m_trace_params;
24  }
25 
26  lldb::TraceType getType() const { return m_type; }
27 
28  uint64_t getTraceBufferSize() const { return m_trace_buffer_size; }
29 
30  uint64_t getMetaDataBufferSize() const { return m_meta_data_buffer_size; }
31 
33  m_trace_params = dict_obj;
34  }
35 
36  void setType(lldb::TraceType type) { m_type = type; }
37 
38  void setTraceBufferSize(uint64_t size) { m_trace_buffer_size = size; }
39 
40  void setMetaDataBufferSize(uint64_t size) { m_meta_data_buffer_size = size; }
41 
42  void setThreadID(lldb::tid_t thread_id) { m_thread_id = thread_id; }
43 
44  lldb::tid_t getThreadID() const { return m_thread_id; }
45 
46 private:
47  lldb::TraceType m_type;
48  uint64_t m_trace_buffer_size;
49  uint64_t m_meta_data_buffer_size;
50  lldb::tid_t m_thread_id;
51 
52  /// m_trace_params is meant to hold any custom parameters
53  /// apart from meta buffer size and trace size.
54  /// The interpretation of such parameters is left to
55  /// the lldb-server.
56  StructuredData::DictionarySP m_trace_params;
57 };
58 }
59 
60 #endif // liblldb_TraceOptions_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
void setMetaDataBufferSize(uint64_t size)
Definition: TraceOptions.h:40
void setType(lldb::TraceType type)
Definition: TraceOptions.h:36
void setTraceParams(const StructuredData::DictionarySP &dict_obj)
Definition: TraceOptions.h:32
std::shared_ptr< Dictionary > DictionarySP
const StructuredData::DictionarySP & getTraceParams() const
Definition: TraceOptions.h:22
A class which can hold structured data.
lldb::tid_t getThreadID() const
Definition: TraceOptions.h:44
void setThreadID(lldb::tid_t thread_id)
Definition: TraceOptions.h:42
uint64_t tid_t
Definition: lldb-types.h:86
uint64_t getTraceBufferSize() const
Definition: TraceOptions.h:28
uint64_t getMetaDataBufferSize() const
Definition: TraceOptions.h:30
void setTraceBufferSize(uint64_t size)
Definition: TraceOptions.h:38
lldb::TraceType getType() const
Definition: TraceOptions.h:26