Skip to content

[lldb] Don't use lldb_assert directly (NFC) #9892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lldb/source/Plugins/Language/Swift/SwiftUnsafeTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,7 @@ lldb_private::formatters::swift::UnsafeTypeSyntheticFrontEnd::

m_unsafe_ptr = ::SwiftUnsafeType::Create(*valobj_sp.get());

lldb_assert(m_unsafe_ptr != nullptr, "Could not create Swift Unsafe Type",
__FUNCTION__, __FILE__, __LINE__);
lldbassert(m_unsafe_ptr != nullptr && "Could not create Swift Unsafe Type");

if (valobj_sp)
Update();
Expand Down
11 changes: 5 additions & 6 deletions lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ LLDBMemoryReader::resolvePointer(swift::remote::RemoteAddress address,
swift::remote::RemoteAbsolutePointer tagged_pointer("", tagged_address);
if (tagged_address !=
(uint64_t)signedPointerStripper(tagged_pointer).getOffset()) {
lldb_assert(false, "Tagged pointer runs into pointer authentication mask!",
__FUNCTION__, __FILE__, __LINE__);
lldbassert(false &&
"Tagged pointer runs into pointer authentication mask!");
return process_pointer;
}

Expand Down Expand Up @@ -531,10 +531,9 @@ LLDBMemoryReader::addModuleToAddressMap(ModuleSP module,
(uint64_t)signedPointerStripper(
swift::remote::RemoteAbsolutePointer("", module_end_address))
.getOffset()) {
lldb_assert(false,
"LLDBMemoryReader module to address map ran into pointer "
"authentication mask!",
__FUNCTION__, __FILE__, __LINE__);
lldbassert(false &&
"LLDBMemoryReader module to address map ran into pointer "
"authentication mask!");
return {};
}
// The address for the next image is the next pointer aligned address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1941,10 +1941,8 @@ UserExpression *TypeSystemSwiftTypeRefForExpressions::GetUserExpression(
if (!target_sp)
return nullptr;
if (ctx_obj != nullptr) {
lldb_assert(0,
"Swift doesn't support 'evaluate in the context"
" of an object'.",
__FUNCTION__, __FILE__, __LINE__);
lldbassert(false &&
"Swift doesn't support 'evaluate in the context of an object'.");
return nullptr;
}

Expand Down