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 
14 using namespace lldb;
15 using namespace lldb_private;
16 using namespace llvm;
17 
18 TraceCursor::TraceCursor(lldb::ThreadSP thread_sp)
19  : m_exe_ctx_ref(ExecutionContext(thread_sp)) {}
20 
22  return m_exe_ctx_ref;
23 }
24 
25 void TraceCursor::SetForwards(bool forwards) { m_forwards = forwards; }
26 
27 bool TraceCursor::IsForwards() const { return m_forwards; }
28 
29 bool TraceCursor::IsError() const {
31 }
32 
33 bool TraceCursor::IsEvent() const {
35 }
36 
39 }
40 
41 const char *TraceCursor::GetEventTypeAsString() const {
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 }
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
llvm
Definition: Debugger.h:50
lldb::eTraceItemKindError
@ eTraceItemKindError
Definition: lldb-enumerations.h:1180
lldb::eTraceItemKindInstruction
@ eTraceItemKindInstruction
Definition: lldb-enumerations.h:1182
lldb_private::TraceCursor::IsForwards
bool IsForwards() const
Check if the direction to use in the TraceCursor::Next() method is forwards.
Definition: TraceCursor.cpp:27
Trace.h
lldb::TraceEvent
TraceEvent
Events that might happen during a trace session.
Definition: lldb-enumerations.h:1163
lldb_private::TraceCursor::m_forwards
bool m_forwards
Definition: TraceCursor.h:287
lldb::eTraceItemKindEvent
@ eTraceItemKindEvent
Definition: lldb-enumerations.h:1181
lldb_private::TraceCursor::GetItemKind
virtual lldb::TraceItemKind GetItemKind() const =0
Trace item information (instructions, errors and events)
lldb_private::TraceCursor::GetEventType
virtual lldb::TraceEvent GetEventType() const =0
lldb_private::TraceCursor::IsInstruction
bool IsInstruction() const
Definition: TraceCursor.cpp:37
lldb::eTraceEventSyncPoint
@ eTraceEventSyncPoint
The underlying tracing technology emitted a synchronization event used by trace processors.
Definition: lldb-enumerations.h:1175
lldb_private::TraceCursor::GetEventTypeAsString
const char * GetEventTypeAsString() const
Definition: TraceCursor.cpp:41
lldb::eTraceEventDisabledHW
@ eTraceEventDisabledHW
Tracing was disable for some time due to a hardware trigger.
Definition: lldb-enumerations.h:1167
lldb::eTraceEventCPUChanged
@ eTraceEventCPUChanged
Event due to CPU change for a thread.
Definition: lldb-enumerations.h:1170
lldb_private::TraceCursor::IsEvent
bool IsEvent() const
Definition: TraceCursor.cpp:33
TraceCursor.h
lldb_private::TraceCursor::m_exe_ctx_ref
ExecutionContextRef m_exe_ctx_ref
Definition: TraceCursor.h:286
lldb_private::TraceCursor::IsError
bool IsError() const
Definition: TraceCursor.cpp:29
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::eTraceEventHWClockTick
@ eTraceEventHWClockTick
Event due to a CPU HW clock tick.
Definition: lldb-enumerations.h:1172
lldb_private::TraceCursor::EventKindToString
static const char * EventKindToString(lldb::TraceEvent event_kind)
Definition: TraceCursor.cpp:45
lldb::eTraceEventDisabledSW
@ eTraceEventDisabledSW
Tracing was disabled for some time due to a software trigger.
Definition: lldb-enumerations.h:1165
lldb_private::TraceCursor::SetForwards
void SetForwards(bool forwards)
Set the direction to use in the TraceCursor::Next() method.
Definition: TraceCursor.cpp:25
lldb
Definition: SBAddress.h:15
lldb_private::ExecutionContextRef
Execution context objects refer to objects in the execution of the program that is being debugged.
Definition: ExecutionContext.h:72
ExecutionContext.h
lldb_private::TraceCursor::GetExecutionContextRef
ExecutionContextRef & GetExecutionContextRef()
Definition: TraceCursor.cpp:21