[trace] Add SBTraceCursor bindings
authorJakob Johnson <johnsonjakob99@gmail.com>
Mon, 1 Aug 2022 19:23:22 +0000 (12:23 -0700)
committerJakob Johnson <johnsonjakob99@gmail.com>
Tue, 2 Aug 2022 23:55:33 +0000 (16:55 -0700)
commitf9b4ea0ce9efb4132a75551c40b2efc049e5b9f7
treef06dda7a0f52486d1096bb6ea4a35a9b4b1a8da0
parent3dfa5626434bf1e9f110e63e8224a66004f42eca
[trace] Add SBTraceCursor bindings

Add bindings for the `TraceCursor` to allow for programatic traversal of
traces.
This diff adds bindings for all public `TraceCursor` methods except
`GetHwClock` and also adds `SBTrace::CreateNewCursor`. A new unittest
has been added to TestTraceLoad.py that uses the new `SBTraceCursor` API
to test that the sequential and random access APIs of the `TraceCursor`
are equivalent.

This diff depends on D130925.

Test Plan:
`ninja lldb-dotest && ./bin/lldb-dotest -p TestTraceLoad`

Differential Revision: https://reviews.llvm.org/D130930
20 files changed:
lldb/bindings/interface/SBTrace.i
lldb/bindings/interface/SBTraceCursor.i [new file with mode: 0644]
lldb/bindings/interfaces.swig
lldb/include/lldb/API/SBDefines.h
lldb/include/lldb/API/SBTrace.h
lldb/include/lldb/API/SBTraceCursor.h [new file with mode: 0644]
lldb/include/lldb/Target/TraceCursor.h
lldb/include/lldb/lldb-defines.h
lldb/include/lldb/lldb-enumerations.h
lldb/source/API/CMakeLists.txt
lldb/source/API/SBTrace.cpp
lldb/source/API/SBTraceCursor.cpp [new file with mode: 0644]
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.h
lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
lldb/source/Target/TraceDumper.cpp
lldb/test/API/commands/trace/TestTraceLoad.py