36 debugger.
ref(), trace_description_file.
ref());
39 error.SetErrorString(
toString(trace_or_err.takeError()).c_str());
43 return SBTrace(trace_or_err.get());
50 error.SetErrorString(
"error: invalid trace");
54 error.SetErrorString(
"error: invalid thread");
58 if (llvm::Expected<lldb::TraceCursorSP> trace_cursor_sp =
62 error.SetErrorString(llvm::toString(trace_cursor_sp.takeError()).c_str());
75 error.SetErrorString(
"error: invalid trace");
76 else if (Expected<FileSpec> desc_file =
80 error.SetErrorString(llvm::toString(desc_file.takeError()).c_str());
97 error.SetErrorString(
"error: invalid trace");
98 else if (llvm::Error err =
100 error.SetErrorString(llvm::toString(std::move(err)).c_str());
110 error.SetErrorString(
"error: invalid trace");
112 if (llvm::Error err =
113 m_opaque_sp->Start(std::vector<lldb::tid_t>{thread.GetThreadID()},
115 error.SetErrorString(llvm::toString(std::move(err)).c_str());
125 error.SetErrorString(
"error: invalid trace");
127 error.SetErrorString(llvm::toString(std::move(err)).c_str());
135 error.SetErrorString(
"error: invalid trace");
136 else if (llvm::Error err =
m_opaque_sp->Stop({thread.GetThreadID()}))
137 error.SetErrorString(llvm::toString(std::move(err)).c_str());
143 return this->
operator bool();
146SBTrace::operator bool()
const {
148 return (
bool)m_opaque_sp;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT_VA(...)
lldb_private::Debugger & ref() const
void SetFileSpec(const lldb_private::FileSpec &fspec)
const lldb_private::FileSpec & ref() const
StructuredDataImplUP m_impl_up
lldb_private::Thread * get()
const char * GetStartConfigurationHelp()
SBTrace()
Default constructor for an invalid Trace object.
SBError Start(const SBStructuredData &configuration)
Start tracing all current and future threads in a live process using a provided configuration.
SBTraceCursor CreateNewCursor(SBError &error, SBThread &thread)
Get a TraceCursor for the given thread's trace.
SBError Stop()
Stop tracing all threads in a live process.
static SBTrace LoadTraceFromFile(SBError &error, SBDebugger &debugger, const SBFileSpec &trace_description_file)
See SBDebugger::LoadTraceFromFile.
SBFileSpec SaveToDisk(SBError &error, const SBFileSpec &bundle_dir, bool compact=false)
Save the trace to the specified directory, which will be created if needed.
lldb::TraceSP m_opaque_sp
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
static llvm::Expected< lldb::TraceSP > LoadPostMortemTraceFromFile(Debugger &debugger, const FileSpec &trace_description_file)
Load a trace from a trace description file and create Targets, Processes and Threads based on the con...
A class that represents a running process on the host machine.
const char * toString(AppleArm64ExceptionClass EC)
std::shared_ptr< lldb_private::Trace > TraceSP