LLDB  mainline
IntelPTProcessTrace.h
Go to the documentation of this file.
1 //===-- IntelPTProcessTrace.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_IntelPTProcessTrace_H_
10 #define liblldb_IntelPTProcessTrace_H_
11 
13 #include <memory>
14 
15 namespace lldb_private {
16 namespace process_linux {
17 
18 /// Interface to be implemented by each 'process trace' strategy (per cpu, per
19 /// thread, etc).
21 public:
22  virtual ~IntelPTProcessTrace() = default;
23 
24  virtual void ProcessDidStop() {}
25 
26  virtual void ProcessWillResume() {}
27 
28  /// Construct a minimal jLLDBTraceGetState response for this process trace.
30 
31  virtual bool TracesThread(lldb::tid_t tid) const = 0;
32 
33  /// \copydoc IntelPTThreadTraceCollection::TraceStart()
34  virtual llvm::Error TraceStart(lldb::tid_t tid) = 0;
35 
36  /// \copydoc IntelPTThreadTraceCollection::TraceStop()
37  virtual llvm::Error TraceStop(lldb::tid_t tid) = 0;
38 
39  /// \return
40  /// \b None if this instance doesn't support the requested data, an \a
41  /// llvm::Error if this isntance supports it but fails at fetching it, and
42  /// \b Error::success() otherwise.
43  virtual llvm::Expected<llvm::Optional<std::vector<uint8_t>>>
44  TryGetBinaryData(const TraceGetBinaryDataRequest &request) = 0;
45 };
46 
47 using IntelPTProcessTraceUP = std::unique_ptr<IntelPTProcessTrace>;
48 
49 } // namespace process_linux
50 } // namespace lldb_private
51 
52 #endif // liblldb_IntelPTProcessTrace_H_
lldb_private::TraceGetBinaryDataRequest
jLLDBTraceGetBinaryData gdb-remote packet
Definition: TraceGDBRemotePackets.h:149
lldb_private::process_linux::IntelPTProcessTrace::TraceStart
virtual llvm::Error TraceStart(lldb::tid_t tid)=0
Start tracing the thread given by its tid.
lldb_private::TraceIntelPTGetStateResponse
Definition: TraceIntelPTGDBRemotePackets.h:111
lldb_private::process_linux::IntelPTProcessTrace::ProcessWillResume
virtual void ProcessWillResume()
Definition: IntelPTProcessTrace.h:26
lldb_private::process_linux::IntelPTProcessTrace::GetState
virtual TraceIntelPTGetStateResponse GetState()=0
Construct a minimal jLLDBTraceGetState response for this process trace.
lldb_private::process_linux::IntelPTProcessTrace
Interface to be implemented by each 'process trace' strategy (per cpu, per thread,...
Definition: IntelPTProcessTrace.h:20
TraceIntelPTGDBRemotePackets.h
lldb_private::process_linux::IntelPTProcessTrace::TryGetBinaryData
virtual llvm::Expected< llvm::Optional< std::vector< uint8_t > > > TryGetBinaryData(const TraceGetBinaryDataRequest &request)=0
lldb_private::process_linux::IntelPTProcessTrace::TracesThread
virtual bool TracesThread(lldb::tid_t tid) const =0
lldb_private::process_linux::IntelPTProcessTrace::~IntelPTProcessTrace
virtual ~IntelPTProcessTrace()=default
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::process_linux::IntelPTProcessTrace::TraceStop
virtual llvm::Error TraceStop(lldb::tid_t tid)=0
Stop tracing the thread given by its tid.
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
lldb_private::process_linux::IntelPTProcessTraceUP
std::unique_ptr< IntelPTProcessTrace > IntelPTProcessTraceUP
Definition: IntelPTProcessTrace.h:47
lldb_private::process_linux::IntelPTProcessTrace::ProcessDidStop
virtual void ProcessDidStop()
Definition: IntelPTProcessTrace.h:24
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86