aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <wallace@fb.com>2021-06-01 15:34:06 -0700
committerWalter Erquinigo <wallace@fb.com>2021-06-17 15:14:47 -0700
commitbf9f21a28be171dc500cc68b4cb1fcd3fc33f229 (patch)
tree15fe415b67514d3e546353eea9ed6b208bcf65ae /lldb/source/Commands/CommandObjectThread.cpp
parentc1360fd5fced42ea45ce1eacbf1c5e1ed54fcac5 (diff)
downloadllvm-bf9f21a28be171dc500cc68b4cb1fcd3fc33f229.zip
llvm-bf9f21a28be171dc500cc68b4cb1fcd3fc33f229.tar.gz
llvm-bf9f21a28be171dc500cc68b4cb1fcd3fc33f229.tar.bz2
[trace][intel-pt] Create basic SB API
This adds a basic SB API for creating and stopping traces. Note: This doesn't add any APIs for inspecting individual instructions. That'd be a more complicated change and it might be better to enhande the dump functionality to output the data in binary format. I'll leave that for a later diff. This also enhances the existing tests so that they test the same flow using both the command interface and the SB API. I also did some cleanup of legacy code. Differential Revision: https://reviews.llvm.org/D103500
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 98ace0c..809dce3 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -1868,11 +1868,11 @@ public:
bool DoExecute(Args &args, CommandReturnObject &result) override {
Process *process = m_exe_ctx.GetProcessPtr();
-
+
if (args.GetArgumentCount() == 0) {
process->PruneThreadPlans();
result.SetStatus(eReturnStatusSuccessFinishNoResult);
- return true;
+ return true;
}
const size_t num_args = args.GetArgumentCount();
@@ -1960,12 +1960,12 @@ public:
~CommandObjectTraceStop() override = default;
bool DoExecuteOnThreads(Args &command, CommandReturnObject &result,
- const std::vector<lldb::tid_t> &tids) override {
+ llvm::ArrayRef<lldb::tid_t> tids) override {
ProcessSP process_sp = m_exe_ctx.GetProcessSP();
TraceSP trace_sp = process_sp->GetTarget().GetTrace();
- if (llvm::Error err = trace_sp->StopThreads(tids))
+ if (llvm::Error err = trace_sp->Stop(tids))
result.SetError(toString(std::move(err)));
else
result.SetStatus(eReturnStatusSuccessFinishResult);