1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -13,7 +13,7 @@
namespace Debug {
DebugInfo::DebugInfo(ELF::Image const& elf, DeprecatedString source_root, FlatPtr base_address)
DebugInfo::DebugInfo(ELF::Image const& elf, ByteString source_root, FlatPtr base_address)
: m_elf(elf)
, m_source_root(move(source_root))
, m_base_address(base_address)
@ -91,8 +91,8 @@ ErrorOr<void> DebugInfo::prepare_lines()
return {};
}));
HashMap<DeprecatedFlyString, Optional<DeprecatedString>> memoized_full_paths;
auto compute_full_path = [&](DeprecatedFlyString const& file_path) -> Optional<DeprecatedString> {
HashMap<DeprecatedFlyString, Optional<ByteString>> memoized_full_paths;
auto compute_full_path = [&](DeprecatedFlyString const& file_path) -> Optional<ByteString> {
if (file_path.view().contains("Toolchain/"sv) || file_path.view().contains("libgcc"sv))
return {};
if (file_path.view().starts_with("./"sv) && !m_source_root.is_empty())
@ -135,11 +135,11 @@ Optional<DebugInfo::SourcePosition> DebugInfo::get_source_position(FlatPtr targe
return {};
}
Optional<DebugInfo::SourcePositionAndAddress> DebugInfo::get_address_from_source_position(DeprecatedString const& file, size_t line) const
Optional<DebugInfo::SourcePositionAndAddress> DebugInfo::get_address_from_source_position(ByteString const& file, size_t line) const
{
DeprecatedString file_path = file;
ByteString file_path = file;
if (!file_path.starts_with('/'))
file_path = DeprecatedString::formatted("/{}", file_path);
file_path = ByteString::formatted("/{}", file_path);
Optional<SourcePositionAndAddress> result;
for (auto const& line_entry : m_sorted_lines) {
@ -327,10 +327,10 @@ ErrorOr<void> DebugInfo::add_type_info_to_variable(Dwarf::DIE const& type_die, P
array_type_name.append(type_info->type_name);
for (auto array_size : type_info->dimension_sizes) {
array_type_name.append('[');
array_type_name.append(DeprecatedString::formatted("{:d}", array_size));
array_type_name.append(ByteString::formatted("{:d}", array_size));
array_type_name.append(']');
}
parent_variable->type_name = array_type_name.to_deprecated_string();
parent_variable->type_name = array_type_name.to_byte_string();
}
parent_variable->type = move(type_info);
parent_variable->type->type_tag = type_die.tag();
@ -350,7 +350,7 @@ bool DebugInfo::is_variable_tag_supported(Dwarf::EntryTag const& tag)
|| tag == Dwarf::EntryTag::ArrayType;
}
DeprecatedString DebugInfo::name_of_containing_function(FlatPtr address) const
ByteString DebugInfo::name_of_containing_function(FlatPtr address) const
{
auto function = get_containing_function(address);
if (!function.has_value())
@ -408,7 +408,7 @@ ErrorOr<DebugInfo::SourcePositionWithInlines> DebugInfo::get_source_position_wit
return {};
}
inline_chain.append({ DeprecatedString::formatted("{}/{}", caller_source_path->directory, caller_source_path->filename), caller_line.value() });
inline_chain.append({ ByteString::formatted("{}/{}", caller_source_path->directory, caller_source_path->filename), caller_line.value() });
return {};
};