forked from OSchip/llvm-project
[trace][intel-pt] Fix a crash on unconsumed Expected's Error
Reproducible with build using libipt and -DLLVM_ENABLE_ASSERTIONS=ON: (lldb) b main (lldb) r (lldb) process trace start
This commit is contained in:
parent
16ff1a7023
commit
18a8527642
|
@ -542,7 +542,14 @@ IntelPTManager::GetBinaryData(const TraceGetBinaryDataRequest &request) const {
|
|||
|
||||
void IntelPTManager::ClearProcessTracing() { m_process_trace = None; }
|
||||
|
||||
bool IntelPTManager::IsSupported() { return (bool)GetOSEventType(); }
|
||||
bool IntelPTManager::IsSupported() {
|
||||
Expected<uint32_t> intel_pt_type = GetOSEventType();
|
||||
if (!intel_pt_type) {
|
||||
llvm::consumeError(intel_pt_type.takeError());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IntelPTManager::IsProcessTracingEnabled() const {
|
||||
return (bool)m_process_trace;
|
||||
|
|
Loading…
Reference in New Issue