LLDB mainline
TraceCursor.cpp
Go to the documentation of this file.
1//===-- TraceCursor.cpp -----------------------------------------*- 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
10
12#include "lldb/Target/Trace.h"
13
14using namespace lldb;
15using namespace lldb_private;
16using namespace llvm;
17
19 : m_exe_ctx_ref(ExecutionContext(thread_sp)) {}
20
22 return m_exe_ctx_ref;
23}
24
25void TraceCursor::SetForwards(bool forwards) { m_forwards = forwards; }
26
27bool TraceCursor::IsForwards() const { return m_forwards; }
28
31}
32
35}
36
39}
40
43}
44
46 switch (event_kind) {
48 return "hardware disabled tracing";
50 return "software disabled tracing";
52 return "CPU core changed";
54 return "HW clock tick";
56 return "trace synchronization point";
57 }
58 llvm_unreachable("Fully covered switch above");
59}
Execution context objects refer to objects in the execution of the program that is being debugged.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
TraceCursor(lldb::ThreadSP thread_sp)
Create a cursor that initially points to the end of the trace, i.e.
Definition: TraceCursor.cpp:18
const char * GetEventTypeAsString() const
Definition: TraceCursor.cpp:41
static const char * EventKindToString(lldb::TraceEvent event_kind)
Definition: TraceCursor.cpp:45
virtual lldb::TraceItemKind GetItemKind() const =0
Trace item information (instructions, errors and events)
void SetForwards(bool forwards)
Set the direction to use in the TraceCursor::Next() method.
Definition: TraceCursor.cpp:25
ExecutionContextRef m_exe_ctx_ref
Definition: TraceCursor.h:288
ExecutionContextRef & GetExecutionContextRef()
Definition: TraceCursor.cpp:21
virtual lldb::TraceEvent GetEventType() const =0
bool IsForwards() const
Check if the direction to use in the TraceCursor::Next() method is forwards.
Definition: TraceCursor.cpp:27
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition: lldb-forward.h:446
TraceEvent
Events that might happen during a trace session.
@ eTraceEventSyncPoint
The underlying tracing technology emitted a synchronization event used by trace processors.
@ eTraceEventCPUChanged
Event due to CPU change for a thread.
@ eTraceEventHWClockTick
Event due to a CPU HW clock tick.
@ eTraceEventDisabledHW
Tracing was disable for some time due to a hardware trigger.
@ eTraceEventDisabledSW
Tracing was disabled for some time due to a software trigger.
@ eTraceItemKindInstruction
@ eTraceItemKindEvent
@ eTraceItemKindError
Definition: Debugger.h:54