LLDB  mainline
TraceCursorIntelPT.h
Go to the documentation of this file.
1 //===-- TraceCursorIntelPT.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 LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
10 #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
11 
12 #include "IntelPTDecoder.h"
14 
15 namespace lldb_private {
16 namespace trace_intel_pt {
17 
19 public:
20  TraceCursorIntelPT(lldb::ThreadSP thread_sp,
21  DecodedThreadSP decoded_thread_sp);
22 
23  size_t Seek(int64_t offset, SeekType origin) override;
24 
25  virtual bool Next() override;
26 
27  llvm::Error GetError() override;
28 
29  lldb::addr_t GetLoadAddress() override;
30 
31  llvm::Optional<uint64_t> GetTimestampCounter() override;
32 
33  lldb::TraceInstructionControlFlowType
35 
36  bool IsError() override;
37 
38 private:
40 
41  /// Storage of the actual instructions
43  /// Internal instruction index currently pointing at.
44  size_t m_pos;
45 };
46 
47 } // namespace trace_intel_pt
48 } // namespace lldb_private
49 
50 #endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
lldb_private::trace_intel_pt::TraceCursorIntelPT::GetLoadAddress
lldb::addr_t GetLoadAddress() override
Definition: TraceCursorIntelPT.cpp:84
TraceIntelPTSessionFileParser.h
lldb_private::trace_intel_pt::TraceCursorIntelPT::GetError
llvm::Error GetError() override
Get the corresponding error message if the cursor points to an error in the trace.
Definition: TraceCursorIntelPT.cpp:80
IntelPTDecoder.h
lldb_private::TraceCursor::SeekType
SeekType
Helper enum to indicate the reference point when invoking TraceCursor::Seek().
Definition: TraceCursor.h:77
lldb_private::TraceCursor
Class used for iterating over the instructions of a thread's trace.
Definition: TraceCursor.h:73
lldb_private::trace_intel_pt::TraceCursorIntelPT::IsError
bool IsError() override
Instruction or error information.
Definition: TraceCursorIntelPT.cpp:76
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::trace_intel_pt::TraceCursorIntelPT::Seek
size_t Seek(int64_t offset, SeekType origin) override
Definition: TraceCursorIntelPT.cpp:54
lldb_private::trace_intel_pt::TraceCursorIntelPT::GetInternalInstructionSize
size_t GetInternalInstructionSize()
Definition: TraceCursorIntelPT.cpp:28
lldb_private::trace_intel_pt::TraceCursorIntelPT::TraceCursorIntelPT
TraceCursorIntelPT(lldb::ThreadSP thread_sp, DecodedThreadSP decoded_thread_sp)
Definition: TraceCursorIntelPT.cpp:20
lldb_private::trace_intel_pt::TraceCursorIntelPT::m_pos
size_t m_pos
Internal instruction index currently pointing at.
Definition: TraceCursorIntelPT.h:44
lldb_private::trace_intel_pt::TraceCursorIntelPT::m_decoded_thread_sp
DecodedThreadSP m_decoded_thread_sp
Storage of the actual instructions.
Definition: TraceCursorIntelPT.h:42
lldb_private::trace_intel_pt::DecodedThreadSP
std::shared_ptr< DecodedThread > DecodedThreadSP
Definition: DecodedThread.h:159
lldb_private::trace_intel_pt::TraceCursorIntelPT::GetInstructionControlFlowType
lldb::TraceInstructionControlFlowType GetInstructionControlFlowType() override
Definition: TraceCursorIntelPT.cpp:93
lldb_private::trace_intel_pt::TraceCursorIntelPT::GetTimestampCounter
llvm::Optional< uint64_t > GetTimestampCounter() override
Get the timestamp counter associated with the current instruction.
Definition: TraceCursorIntelPT.cpp:88
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
lldb_private::trace_intel_pt::TraceCursorIntelPT::Next
virtual bool Next() override
Move the cursor to the next instruction that matches the current granularity.
Definition: TraceCursorIntelPT.cpp:32
lldb_private::trace_intel_pt::TraceCursorIntelPT
Definition: TraceCursorIntelPT.h:18