mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:37:35 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -41,7 +41,7 @@ ELFObjectInfo const* Backtrace::object_info_for_region(Reader const& coredump, M
|
|||
return info_ptr;
|
||||
}
|
||||
|
||||
Backtrace::Backtrace(const Reader& coredump, const ELF::Core::ThreadInfo& thread_info, Function<void(size_t, size_t)> on_progress)
|
||||
Backtrace::Backtrace(Reader const& coredump, const ELF::Core::ThreadInfo& thread_info, Function<void(size_t, size_t)> on_progress)
|
||||
: m_thread_info(move(thread_info))
|
||||
{
|
||||
#if ARCH(I386)
|
||||
|
@ -92,7 +92,7 @@ Backtrace::Backtrace(const Reader& coredump, const ELF::Core::ThreadInfo& thread
|
|||
}
|
||||
}
|
||||
|
||||
void Backtrace::add_entry(const Reader& coredump, FlatPtr ip)
|
||||
void Backtrace::add_entry(Reader const& coredump, FlatPtr ip)
|
||||
{
|
||||
auto ip_region = coredump.region_containing(ip);
|
||||
if (!ip_region.has_value()) {
|
||||
|
|
|
@ -38,14 +38,14 @@ public:
|
|||
String to_string(bool color = false) const;
|
||||
};
|
||||
|
||||
Backtrace(const Reader&, const ELF::Core::ThreadInfo&, Function<void(size_t, size_t)> on_progress = {});
|
||||
Backtrace(Reader const&, const ELF::Core::ThreadInfo&, Function<void(size_t, size_t)> on_progress = {});
|
||||
~Backtrace() = default;
|
||||
|
||||
ELF::Core::ThreadInfo const& thread_info() const { return m_thread_info; }
|
||||
Vector<Entry> const& entries() const { return m_entries; }
|
||||
|
||||
private:
|
||||
void add_entry(const Reader&, FlatPtr ip);
|
||||
void add_entry(Reader const&, FlatPtr ip);
|
||||
ELFObjectInfo const* object_info_for_region(Reader const&, MemoryRegionInfo const&);
|
||||
|
||||
bool m_skip_loader_so { false };
|
||||
|
|
|
@ -77,7 +77,7 @@ Optional<ByteBuffer> Reader::decompress_coredump(ReadonlyBytes raw_coredump)
|
|||
return bytebuffer.release_value();
|
||||
}
|
||||
|
||||
Reader::NotesEntryIterator::NotesEntryIterator(const u8* notes_data)
|
||||
Reader::NotesEntryIterator::NotesEntryIterator(u8 const* notes_data)
|
||||
: m_current(bit_cast<const ELF::Core::NotesEntry*>(notes_data))
|
||||
, start(notes_data)
|
||||
{
|
||||
|
@ -103,22 +103,22 @@ void Reader::NotesEntryIterator::next()
|
|||
VERIFY(!at_end());
|
||||
switch (type()) {
|
||||
case ELF::Core::NotesEntryHeader::Type::ProcessInfo: {
|
||||
const auto* current = bit_cast<const ELF::Core::ProcessInfo*>(m_current);
|
||||
auto const* current = bit_cast<const ELF::Core::ProcessInfo*>(m_current);
|
||||
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->json_data + strlen(current->json_data) + 1);
|
||||
break;
|
||||
}
|
||||
case ELF::Core::NotesEntryHeader::Type::ThreadInfo: {
|
||||
const auto* current = bit_cast<const ELF::Core::ThreadInfo*>(m_current);
|
||||
auto const* current = bit_cast<const ELF::Core::ThreadInfo*>(m_current);
|
||||
m_current = bit_cast<const ELF::Core::NotesEntry*>(current + 1);
|
||||
break;
|
||||
}
|
||||
case ELF::Core::NotesEntryHeader::Type::MemoryRegionInfo: {
|
||||
const auto* current = bit_cast<const ELF::Core::MemoryRegionInfo*>(m_current);
|
||||
auto const* current = bit_cast<const ELF::Core::MemoryRegionInfo*>(m_current);
|
||||
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->region_name + strlen(current->region_name) + 1);
|
||||
break;
|
||||
}
|
||||
case ELF::Core::NotesEntryHeader::Type::Metadata: {
|
||||
const auto* current = bit_cast<const ELF::Core::Metadata*>(m_current);
|
||||
auto const* current = bit_cast<const ELF::Core::Metadata*>(m_current);
|
||||
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->json_data + strlen(current->json_data) + 1);
|
||||
break;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ Optional<FlatPtr> Reader::peek_memory(FlatPtr address) const
|
|||
return {};
|
||||
|
||||
FlatPtr offset_in_region = address - region->region_start;
|
||||
auto* region_data = bit_cast<const u8*>(image().program_header(region->program_header_index).raw_data());
|
||||
auto* region_data = bit_cast<u8 const*>(image().program_header(region->program_header_index).raw_data());
|
||||
FlatPtr value { 0 };
|
||||
ByteReader::load(region_data + offset_in_region, value);
|
||||
return value;
|
||||
|
@ -148,7 +148,7 @@ Optional<FlatPtr> Reader::peek_memory(FlatPtr address) const
|
|||
const JsonObject Reader::process_info() const
|
||||
{
|
||||
const ELF::Core::ProcessInfo* process_info_notes_entry = nullptr;
|
||||
NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
for (; !it.at_end(); it.next()) {
|
||||
if (it.type() != ELF::Core::NotesEntryHeader::Type::ProcessInfo)
|
||||
continue;
|
||||
|
@ -182,7 +182,7 @@ Optional<MemoryRegionInfo> Reader::first_region_for_object(StringView object_nam
|
|||
Optional<MemoryRegionInfo> Reader::region_containing(FlatPtr address) const
|
||||
{
|
||||
Optional<MemoryRegionInfo> ret;
|
||||
for_each_memory_region_info([&ret, address](const auto& region_info) {
|
||||
for_each_memory_region_info([&ret, address](auto const& region_info) {
|
||||
if (region_info.region_start <= address && region_info.region_end >= address) {
|
||||
ret = region_info;
|
||||
return IterationDecision::Break;
|
||||
|
@ -247,7 +247,7 @@ Vector<String> Reader::process_environment() const
|
|||
HashMap<String, String> Reader::metadata() const
|
||||
{
|
||||
const ELF::Core::Metadata* metadata_notes_entry = nullptr;
|
||||
NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
for (; !it.at_end(); it.next()) {
|
||||
if (it.type() != ELF::Core::NotesEntryHeader::Type::Metadata)
|
||||
continue;
|
||||
|
@ -268,7 +268,7 @@ HashMap<String, String> Reader::metadata() const
|
|||
return metadata;
|
||||
}
|
||||
|
||||
const Reader::LibraryData* Reader::library_containing(FlatPtr address) const
|
||||
Reader::LibraryData const* Reader::library_containing(FlatPtr address) const
|
||||
{
|
||||
static HashMap<String, OwnPtr<LibraryData>> cached_libs;
|
||||
auto region = region_containing(address);
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
NonnullRefPtr<Core::MappedFile> file;
|
||||
ELF::Image lib_elf;
|
||||
};
|
||||
const LibraryData* library_containing(FlatPtr address) const;
|
||||
LibraryData const* library_containing(FlatPtr address) const;
|
||||
|
||||
String resolve_object_path(StringView object_name) const;
|
||||
|
||||
|
@ -89,7 +89,7 @@ private:
|
|||
|
||||
class NotesEntryIterator {
|
||||
public:
|
||||
NotesEntryIterator(const u8* notes_data);
|
||||
NotesEntryIterator(u8 const* notes_data);
|
||||
|
||||
ELF::Core::NotesEntryHeader::Type type() const;
|
||||
const ELF::Core::NotesEntry* current() const;
|
||||
|
@ -99,7 +99,7 @@ private:
|
|||
|
||||
private:
|
||||
const ELF::Core::NotesEntry* m_current { nullptr };
|
||||
const u8* start { nullptr };
|
||||
u8 const* start { nullptr };
|
||||
};
|
||||
|
||||
// Private as we don't need anyone poking around in this JsonObject
|
||||
|
@ -122,7 +122,7 @@ private:
|
|||
template<typename Func>
|
||||
void Reader::for_each_memory_region_info(Func func) const
|
||||
{
|
||||
NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
for (; !it.at_end(); it.next()) {
|
||||
if (it.type() != ELF::Core::NotesEntryHeader::Type::MemoryRegionInfo)
|
||||
continue;
|
||||
|
@ -138,7 +138,7 @@ void Reader::for_each_memory_region_info(Func func) const
|
|||
raw_memory_region_info.region_start,
|
||||
raw_memory_region_info.region_end,
|
||||
raw_memory_region_info.program_header_index,
|
||||
{ bit_cast<const char*>(raw_data.offset_pointer(raw_data.size())) },
|
||||
{ bit_cast<char const*>(raw_data.offset_pointer(raw_data.size())) },
|
||||
};
|
||||
IterationDecision decision = func(memory_region_info);
|
||||
if (decision == IterationDecision::Break)
|
||||
|
@ -149,12 +149,12 @@ void Reader::for_each_memory_region_info(Func func) const
|
|||
template<typename Func>
|
||||
void Reader::for_each_thread_info(Func func) const
|
||||
{
|
||||
NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
|
||||
for (; !it.at_end(); it.next()) {
|
||||
if (it.type() != ELF::Core::NotesEntryHeader::Type::ThreadInfo)
|
||||
continue;
|
||||
ELF::Core::ThreadInfo thread_info;
|
||||
ByteReader::load(bit_cast<const u8*>(it.current()), thread_info);
|
||||
ByteReader::load(bit_cast<u8 const*>(it.current()), thread_info);
|
||||
|
||||
IterationDecision decision = func(thread_info);
|
||||
if (decision == IterationDecision::Break)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue