• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- SBTraceOptions ------------------------------------------*- 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 LLDB_API_SBTRACEOPTIONS_H
10 #define LLDB_API_SBTRACEOPTIONS_H
11 
12 #include "lldb/API/SBDefines.h"
13 
14 namespace lldb {
15 
16 class LLDB_API SBTraceOptions {
17 public:
18   SBTraceOptions();
19 
20   lldb::TraceType getType() const;
21 
22   uint64_t getTraceBufferSize() const;
23 
24   /// The trace parameters consist of any custom parameters
25   /// apart from the generic parameters such as
26   /// TraceType, trace_buffer_size and meta_data_buffer_size.
27   /// The returned parameters would be formatted as a JSON Dictionary.
28   lldb::SBStructuredData getTraceParams(lldb::SBError &error);
29 
30   uint64_t getMetaDataBufferSize() const;
31 
32   /// SBStructuredData is meant to hold any custom parameters
33   /// apart from meta buffer size and trace size. They should
34   /// be formatted as a JSON Dictionary.
35   void setTraceParams(lldb::SBStructuredData &params);
36 
37   void setType(lldb::TraceType type);
38 
39   void setTraceBufferSize(uint64_t size);
40 
41   void setMetaDataBufferSize(uint64_t size);
42 
43   void setThreadID(lldb::tid_t thread_id);
44 
45   lldb::tid_t getThreadID();
46 
47   explicit operator bool() const;
48 
49   bool IsValid();
50 
51 protected:
52   friend class SBProcess;
53   friend class SBTrace;
54 
55   lldb::TraceOptionsSP m_traceoptions_sp;
56 };
57 }
58 
59 #endif // LLDB_API_SBTRACEOPTIONS_H
60