Skip to content

Commit 8ae7669

Browse files
log the error instead of just consuming it
1 parent 9ccf1ba commit 8ae7669

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ static bool PrintDemangledArgumentList(Stream &s, const SymbolContext &sc) {
360360

361361
auto info_or_err = GetAndValidateInfo(sc);
362362
if (!info_or_err) {
363-
llvm::consumeError(info_or_err.takeError());
363+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), info_or_err.takeError(),
364+
"Failed to retrieve demangled info: {0}");
364365
return false;
365366
}
366367
auto [demangled_name, info] = *info_or_err;
@@ -1897,7 +1898,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
18971898
case FormatEntity::Entry::Type::FunctionScope: {
18981899
auto scope_or_err = GetDemangledScope(sc);
18991900
if (!scope_or_err) {
1900-
llvm::consumeError(scope_or_err.takeError());
1901+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), scope_or_err.takeError(),
1902+
"Failed to retrieve scope: {0}");
19011903
return false;
19021904
}
19031905

@@ -1909,7 +1911,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19091911
case FormatEntity::Entry::Type::FunctionBasename: {
19101912
auto name_or_err = GetDemangledBasename(sc);
19111913
if (!name_or_err) {
1912-
llvm::consumeError(name_or_err.takeError());
1914+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), name_or_err.takeError(),
1915+
"Failed to retrieve basename: {0}");
19131916
return false;
19141917
}
19151918

@@ -1921,7 +1924,9 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19211924
case FormatEntity::Entry::Type::FunctionTemplateArguments: {
19221925
auto template_args_or_err = GetDemangledTemplateArguments(sc);
19231926
if (!template_args_or_err) {
1924-
llvm::consumeError(template_args_or_err.takeError());
1927+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language),
1928+
template_args_or_err.takeError(),
1929+
"Failed to retrieve template arguments: {0}");
19251930
return false;
19261931
}
19271932

@@ -1956,7 +1961,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19561961
case FormatEntity::Entry::Type::FunctionReturnRight: {
19571962
auto return_rhs_or_err = GetDemangledReturnTypeRHS(sc);
19581963
if (!return_rhs_or_err) {
1959-
llvm::consumeError(return_rhs_or_err.takeError());
1964+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), return_rhs_or_err.takeError(),
1965+
"Failed to retrieve RHS return type: {0}");
19601966
return false;
19611967
}
19621968

@@ -1967,7 +1973,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19671973
case FormatEntity::Entry::Type::FunctionReturnLeft: {
19681974
auto return_lhs_or_err = GetDemangledReturnTypeLHS(sc);
19691975
if (!return_lhs_or_err) {
1970-
llvm::consumeError(return_lhs_or_err.takeError());
1976+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), return_lhs_or_err.takeError(),
1977+
"Failed to retrieve LHS return type: {0}");
19711978
return false;
19721979
}
19731980

@@ -1978,7 +1985,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19781985
case FormatEntity::Entry::Type::FunctionQualifiers: {
19791986
auto quals_or_err = GetDemangledFunctionQualifiers(sc);
19801987
if (!quals_or_err) {
1981-
llvm::consumeError(quals_or_err.takeError());
1988+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), quals_or_err.takeError(),
1989+
"Failed to retrieve function qualifiers: {0}");
19821990
return false;
19831991
}
19841992

@@ -1989,7 +1997,8 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable(
19891997
case FormatEntity::Entry::Type::FunctionSuffix: {
19901998
auto suffix_or_err = GetDemangledFunctionSuffix(sc);
19911999
if (!suffix_or_err) {
1992-
llvm::consumeError(suffix_or_err.takeError());
2000+
LLDB_LOG_ERROR(GetLog(LLDBLog::Language), suffix_or_err.takeError(),
2001+
"Failed to retrieve suffix: {0}");
19932002
return false;
19942003
}
19952004

0 commit comments

Comments
 (0)