LLDB
mainline
llvm-project
lldb
source
Target
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
9
#include "
lldb/Target/TraceCursor.h
"
10
11
#include "
lldb/Target/ExecutionContext.h
"
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
21
ExecutionContextRef
&
TraceCursor::GetExecutionContextRef
() {
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
{
30
return
GetItemKind
() ==
lldb::eTraceItemKindError
;
31
}
32
33
bool
TraceCursor::IsEvent
()
const
{
34
return
GetItemKind
() ==
lldb::eTraceItemKindEvent
;
35
}
36
37
bool
TraceCursor::IsInstruction
()
const
{
38
return
GetItemKind
() ==
lldb::eTraceItemKindInstruction
;
39
}
40
41
const
char
*
TraceCursor::GetEventTypeAsString
()
const
{
42
return
EventKindToString
(
GetEventType
());
43
}
44
45
const
char
*
TraceCursor::EventKindToString
(
lldb::TraceEvent
event_kind) {
46
switch
(event_kind) {
47
case
lldb::eTraceEventDisabledHW
:
48
return
"hardware disabled tracing"
;
49
case
lldb::eTraceEventDisabledSW
:
50
return
"software disabled tracing"
;
51
case
lldb::eTraceEventCPUChanged
:
52
return
"CPU core changed"
;
53
case
lldb::eTraceEventHWClockTick
:
54
return
"HW clock tick"
;
55
case
lldb::eTraceEventSyncPoint
:
56
return
"trace synchronization point"
;
57
}
58
llvm_unreachable(
"Fully covered switch above"
);
59
}
ExecutionContext.h
TraceCursor.h
Trace.h
lldb_private::ExecutionContextRef
Execution context objects refer to objects in the execution of the program that is being debugged.
Definition:
ExecutionContext.h:72
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::TraceCursor::TraceCursor
TraceCursor(lldb::ThreadSP thread_sp)
Create a cursor that initially points to the end of the trace, i.e.
Definition:
TraceCursor.cpp:18
lldb_private::TraceCursor::IsError
bool IsError() const
Definition:
TraceCursor.cpp:29
lldb_private::TraceCursor::GetEventTypeAsString
const char * GetEventTypeAsString() const
Definition:
TraceCursor.cpp:41
lldb_private::TraceCursor::EventKindToString
static const char * EventKindToString(lldb::TraceEvent event_kind)
Definition:
TraceCursor.cpp:45
lldb_private::TraceCursor::GetItemKind
virtual lldb::TraceItemKind GetItemKind() const =0
Trace item information (instructions, errors and events)
lldb_private::TraceCursor::IsInstruction
bool IsInstruction() const
Definition:
TraceCursor.cpp:37
lldb_private::TraceCursor::SetForwards
void SetForwards(bool forwards)
Set the direction to use in the TraceCursor::Next() method.
Definition:
TraceCursor.cpp:25
lldb_private::TraceCursor::m_exe_ctx_ref
ExecutionContextRef m_exe_ctx_ref
Definition:
TraceCursor.h:288
lldb_private::TraceCursor::m_forwards
bool m_forwards
Definition:
TraceCursor.h:289
lldb_private::TraceCursor::GetExecutionContextRef
ExecutionContextRef & GetExecutionContextRef()
Definition:
TraceCursor.cpp:21
lldb_private::TraceCursor::IsEvent
bool IsEvent() const
Definition:
TraceCursor.cpp:33
lldb_private::TraceCursor::GetEventType
virtual lldb::TraceEvent GetEventType() const =0
lldb_private::TraceCursor::IsForwards
bool IsForwards() const
Check if the direction to use in the TraceCursor::Next() method is forwards.
Definition:
TraceCursor.cpp:27
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb
Definition:
SBAddress.h:15
lldb::ThreadSP
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition:
lldb-forward.h:450
lldb::TraceEvent
TraceEvent
Events that might happen during a trace session.
Definition:
lldb-enumerations.h:1233
lldb::eTraceEventSyncPoint
@ eTraceEventSyncPoint
The underlying tracing technology emitted a synchronization event used by trace processors.
Definition:
lldb-enumerations.h:1245
lldb::eTraceEventCPUChanged
@ eTraceEventCPUChanged
Event due to CPU change for a thread.
Definition:
lldb-enumerations.h:1240
lldb::eTraceEventHWClockTick
@ eTraceEventHWClockTick
Event due to a CPU HW clock tick.
Definition:
lldb-enumerations.h:1242
lldb::eTraceEventDisabledHW
@ eTraceEventDisabledHW
Tracing was disable for some time due to a hardware trigger.
Definition:
lldb-enumerations.h:1237
lldb::eTraceEventDisabledSW
@ eTraceEventDisabledSW
Tracing was disabled for some time due to a software trigger.
Definition:
lldb-enumerations.h:1235
lldb::eTraceItemKindInstruction
@ eTraceItemKindInstruction
Definition:
lldb-enumerations.h:1252
lldb::eTraceItemKindEvent
@ eTraceItemKindEvent
Definition:
lldb-enumerations.h:1251
lldb::eTraceItemKindError
@ eTraceItemKindError
Definition:
lldb-enumerations.h:1250
llvm
Definition:
Debugger.h:54
Generated on Fri Dec 20 2024 17:28:02 for LLDB by
1.9.6