1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +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

@ -289,10 +289,10 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
return Error::from_string_literal("Malformed profile (strings is not an array)");
auto const& strings = strings_value.value();
HashMap<FlatPtr, DeprecatedString> profile_strings;
HashMap<FlatPtr, ByteString> profile_strings;
for (FlatPtr string_id = 0; string_id < strings.size(); ++string_id) {
auto const& value = strings.at(string_id);
profile_strings.set(string_id, value.to_deprecated_string());
profile_strings.set(string_id, value.to_byte_string());
}
auto events_value = object.get_array("events"sv);
@ -317,7 +317,7 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
event.pid = perf_event.get_i32("pid"sv).value_or(0);
event.tid = perf_event.get_i32("tid"sv).value_or(0);
auto type_string = perf_event.get_deprecated_string("type"sv).value_or({});
auto type_string = perf_event.get_byte_string("type"sv).value_or({});
if (type_string == "sample"sv) {
event.data = Event::SampleData {};
@ -333,13 +333,13 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
} else if (type_string == "signpost"sv) {
auto string_id = perf_event.get_addr("arg1"sv).value_or(0);
event.data = Event::SignpostData {
.string = profile_strings.get(string_id).value_or(DeprecatedString::formatted("Signpost #{}", string_id)),
.string = profile_strings.get(string_id).value_or(ByteString::formatted("Signpost #{}", string_id)),
.arg = perf_event.get_addr("arg2"sv).value_or(0),
};
} else if (type_string == "mmap"sv) {
auto ptr = perf_event.get_addr("ptr"sv).value_or(0);
auto size = perf_event.get_integer<size_t>("size"sv).value_or(0);
auto name = perf_event.get_deprecated_string("name"sv).value_or({});
auto name = perf_event.get_byte_string("name"sv).value_or({});
event.data = Event::MmapData {
.ptr = ptr,
@ -359,7 +359,7 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
continue;
} else if (type_string == "process_create"sv) {
auto parent_pid = perf_event.get_integer<pid_t>("parent_pid"sv).value_or(0);
auto executable = perf_event.get_deprecated_string("executable"sv).value_or({});
auto executable = perf_event.get_byte_string("executable"sv).value_or({});
event.data = Event::ProcessCreateData {
.parent_pid = parent_pid,
.executable = executable,
@ -377,7 +377,7 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
all_processes.append(move(sampled_process));
continue;
} else if (type_string == "process_exec"sv) {
auto executable = perf_event.get_deprecated_string("executable"sv).value_or({});
auto executable = perf_event.get_byte_string("executable"sv).value_or({});
event.data = Event::ProcessExecData {
.executable = executable,
};
@ -482,13 +482,13 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
auto ptr = frame.to_number<u64>();
u32 offset = 0;
DeprecatedFlyString object_name;
DeprecatedString symbol;
ByteString symbol;
if (maybe_kernel_base.has_value() && ptr >= maybe_kernel_base.value()) {
if (g_kernel_debuginfo_object.has_value()) {
symbol = g_kernel_debuginfo_object->elf.symbolicate(ptr - maybe_kernel_base.value(), &offset);
} else {
symbol = DeprecatedString::formatted("?? <{:p}>", ptr);
symbol = ByteString::formatted("?? <{:p}>", ptr);
}
} else {
auto it = current_processes.find(event.pid);
@ -500,7 +500,7 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
object_name = library->name;
symbol = library->symbolicate(ptr, &offset);
} else {
symbol = DeprecatedString::formatted("?? <{:p}>", ptr);
symbol = ByteString::formatted("?? <{:p}>", ptr);
}
}
@ -681,7 +681,7 @@ ProfileNode::ProfileNode(Process const& process)
{
}
ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
: m_process(process)
, m_symbol(move(symbol))
, m_pid(pid)
@ -689,7 +689,7 @@ ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& obje
, m_offset(offset)
, m_timestamp(timestamp)
{
DeprecatedString object;
ByteString object;
if (object_name.ends_with(": .text"sv)) {
object = object_name.view().substring_view(0, object_name.length() - 7);
} else {