if (!condition_error.Success()) {
const char *err_str =
- condition_error.AsCString("<Unknown Error>");
+ condition_error.AsCString("<unknown error>");
LLDB_LOGF(log, "Error evaluating condition: \"%s\"\n", err_str);
- std::string error_message;
- llvm::raw_string_ostream os(error_message);
- os << "stopped due to an error evaluating condition of "
- "breakpoint "
- << bp_loc_sp->GetConditionText() << '\n';
- os << err_str;
- os.flush();
+ StreamString strm;
+ strm << "stopped due to an error evaluating condition of "
+ "breakpoint ";
+ bp_loc_sp->GetDescription(&strm, eDescriptionLevelBrief);
+ strm << ": \"" << bp_loc_sp->GetConditionText() << "\"\n";
+ strm << err_str;
Debugger::ReportError(
- std::move(error_message),
+ strm.GetString().str(),
exe_ctx.GetTargetRef().GetDebugger().GetID());
} else {
LLDB_LOGF(log,
}
}
} else {
- StreamSP error_sp = debugger.GetAsyncErrorStream();
- error_sp->Printf(
- "Stopped due to an error evaluating condition of watchpoint ");
- wp_sp->GetDescription(error_sp.get(), eDescriptionLevelBrief);
- error_sp->Printf(": \"%s\"", wp_sp->GetConditionText());
- error_sp->EOL();
- const char *err_str = error.AsCString("<Unknown Error>");
+ const char *err_str = error.AsCString("<unknown error>");
LLDB_LOGF(log, "Error evaluating condition: \"%s\"\n", err_str);
- error_sp->PutCString(err_str);
- error_sp->EOL();
- error_sp->Flush();
- // If the condition fails to be parsed or run, we should stop.
- m_should_stop = true;
+ StreamString strm;
+ strm << "stopped due to an error evaluating condition of "
+ "watchpoint ";
+ wp_sp->GetDescription(&strm, eDescriptionLevelBrief);
+ strm << ": \"" << wp_sp->GetConditionText() << "\"\n";
+ strm << err_str;
+
+ Debugger::ReportError(strm.GetString().str(),
+ exe_ctx.GetTargetRef().GetDebugger().GetID());
}
}