[Lldb-commits] [lldb] [lldb] upgrade HandleFrameFormatVariable callees to llvm::Expected (PR #144731)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 19 02:41:23 PDT 2025
================
@@ -236,199 +236,141 @@ static bool PrettyPrintFunctionNameWithArgs(Stream &out_stream,
return true;
}
-static std::optional<llvm::StringRef>
-GetDemangledBasename(const SymbolContext &sc) {
+static llvm::Expected<std::pair<llvm::StringRef, DemangledNameInfo>>
+GetAndValidateInfo(const SymbolContext &sc) {
Mangled mangled = sc.GetPossiblyInlinedFunctionName();
if (!mangled)
- return std::nullopt;
+ return llvm::createStringError("Function does not have a mangled name.");
auto demangled_name = mangled.GetDemangledName().GetStringRef();
if (demangled_name.empty())
- return std::nullopt;
+ return llvm::createStringError("Function does not have a demangled name.");
const std::optional<DemangledNameInfo> &info = mangled.GetDemangledInfo();
if (!info)
- return std::nullopt;
+ return llvm::createStringError("Function does not have demangled info.");
// Function without a basename is nonsense.
if (!info->hasBasename())
- return std::nullopt;
+ return llvm::createStringError("Info do not have basename range.");
----------------
Michael137 wrote:
Can we make all these error messages more unique? So we can tell by looking at the log which branch was taken here?
https://github.com/llvm/llvm-project/pull/144731
More information about the lldb-commits
mailing list