diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-04 19:20:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-08 19:02:26 +0000 |
commit | 81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch) | |
tree | 311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/lldb/source/Target/TraceCursor.cpp | |
parent | 5fff09660e06a66bed6482da9c70df328e16bbb6 (diff) | |
parent | 145449b1e420787bb99721a429341fa6be3adfb6 (diff) | |
download | src-81ad626541db97eb356e2c1d4a20eb2a26a766ab.tar.gz src-81ad626541db97eb356e2c1d4a20eb2a26a766ab.zip |
Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.
PR: 265425
MFC after: 2 weeks
Diffstat (limited to 'contrib/llvm-project/lldb/source/Target/TraceCursor.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Target/TraceCursor.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/contrib/llvm-project/lldb/source/Target/TraceCursor.cpp b/contrib/llvm-project/lldb/source/Target/TraceCursor.cpp index d0f69642cb90..1c3fabc4dec0 100644 --- a/contrib/llvm-project/lldb/source/Target/TraceCursor.cpp +++ b/contrib/llvm-project/lldb/source/Target/TraceCursor.cpp @@ -9,6 +9,7 @@ #include "lldb/Target/TraceCursor.h" #include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/Trace.h" using namespace lldb; using namespace lldb_private; @@ -21,15 +22,31 @@ ExecutionContextRef &TraceCursor::GetExecutionContextRef() { return m_exe_ctx_ref; } -void TraceCursor::SetGranularity( - lldb::TraceInstructionControlFlowType granularity) { - m_granularity = granularity; +void TraceCursor::SetForwards(bool forwards) { m_forwards = forwards; } + +bool TraceCursor::IsForwards() const { return m_forwards; } + +bool TraceCursor::IsError() const { + return GetItemKind() == lldb::eTraceItemKindError; } -void TraceCursor::SetIgnoreErrors(bool ignore_errors) { - m_ignore_errors = ignore_errors; +bool TraceCursor::IsEvent() const { + return GetItemKind() == lldb::eTraceItemKindEvent; } -void TraceCursor::SetForwards(bool forwards) { m_forwards = forwards; } +bool TraceCursor::IsInstruction() const { + return GetItemKind() == lldb::eTraceItemKindInstruction; +} -bool TraceCursor::IsForwards() const { return m_forwards; } +const char *TraceCursor::GetEventTypeAsString() const { + return EventKindToString(GetEventType()); +} + +const char *TraceCursor::EventKindToString(lldb::TraceEvent event_kind) { + switch (event_kind) { + case lldb::eTraceEventDisabledHW: + return "hardware disabled tracing"; + case lldb::eTraceEventDisabledSW: + return "software disabled tracing"; + } +} |