[Lldb-commits] [lldb] [lldb] upgrade HandleFrameFormatVariable callees to llvm::Expected (PR #144731)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 20 01:39:27 PDT 2025
================
@@ -2008,38 +1979,54 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
return true;
}
case FormatEntity::Entry::Type::FunctionReturnRight: {
- std::optional<llvm::StringRef> return_rhs = GetDemangledReturnTypeRHS(sc);
- if (!return_rhs)
+ auto return_rhs_or_err = GetDemangledReturnTypeRHS(sc);
+ if (!return_rhs_or_err) {
+ LLDB_LOG_ERROR(GetLog(LLDBLog::Language), return_rhs_or_err.takeError(),
+ "Failed to handle ${function.return-right} frame-format "
+ "variable: {0}");
return false;
+ }
- s << *return_rhs;
+ s << *return_rhs_or_err;
return true;
}
case FormatEntity::Entry::Type::FunctionReturnLeft: {
- std::optional<llvm::StringRef> return_lhs = GetDemangledReturnTypeLHS(sc);
- if (!return_lhs)
+ auto return_lhs_or_err = GetDemangledReturnTypeLHS(sc);
+ if (!return_lhs_or_err) {
+ LLDB_LOG_ERROR(GetLog(LLDBLog::Language), return_lhs_or_err.takeError(),
+ "Failed to handle ${function.return-left} frame-format "
+ "variable: {0}");
return false;
+ }
- s << *return_lhs;
+ s << *return_lhs_or_err;
return true;
}
case FormatEntity::Entry::Type::FunctionQualifiers: {
- std::optional<llvm::StringRef> quals = GetDemangledFunctionQualifiers(sc);
- if (!quals)
+ auto quals_or_err = GetDemangledFunctionQualifiers(sc);
+ if (!quals_or_err) {
+ LLDB_LOG_ERROR(
+ GetLog(LLDBLog::Language), quals_or_err.takeError(),
+ "Failed to handle ${function.qualifiers} frame-format variable: {0}");
----------------
Michael137 wrote:
Apologies, I think you need to escape the `{` here. Since that's the syntax for specifying the format index. I think `{{` is the way to do that
https://github.com/llvm/llvm-project/pull/144731
More information about the lldb-commits
mailing list