[trace] Replace TraceCursorUP with TraceCursorSP
authorJakob Johnson <johnsonjakob99@gmail.com>
Mon, 1 Aug 2022 14:34:47 +0000 (07:34 -0700)
committerJakob Johnson <johnsonjakob99@gmail.com>
Mon, 1 Aug 2022 20:53:53 +0000 (13:53 -0700)
commit3bec33b16db11c67d43bda134520a2132ff606c9
treec18d06b703167c8098baf948a18e738a27be4d1d
parente07a8155f5168fdaff9346152d7805a47cb49405
[trace] Replace TraceCursorUP with TraceCursorSP

The use of `std::unique_ptr` with `TraceCursor` adds unnecessary complexity to adding `SBTraceCursor` bindings
Specifically, since `TraceCursor` is an abstract class there's no clean
way to provide "deep clone" semantics for `TraceCursorUP` short of
creating a pure virtual `clone()` method (afaict).

After discussing with @wallace, we decided there is no strong reason to
favor wrapping `TraceCursor` with `std::unique_ptr` over `std::shared_ptr`, thus this diff
replaces all usages of `std::unique_ptr<TraceCursor>` with `std::shared_ptr<TraceCursor>`.

This sets the stage for future diffs to introduce `SBTraceCursor`
bindings in a more clean fashion.

Test Plan:

Differential Revision: https://reviews.llvm.org/D130925
lldb/include/lldb/Target/Trace.h
lldb/include/lldb/Target/TraceCursor.h
lldb/include/lldb/Target/TraceDumper.h
lldb/include/lldb/lldb-forward.h
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
lldb/source/Target/TraceDumper.cpp