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

LibELF+Lagom: Work towards getting LibELF in Lagom

Mostly -Wformat fixes, some of which pointed out real (if benign) bugs.
This commit is contained in:
Nico Weber 2020-08-08 22:45:20 -04:00 committed by Andreas Kling
parent 872834320a
commit 0586924bbd
6 changed files with 33 additions and 32 deletions

View file

@ -106,7 +106,7 @@ void Image::dump() const
for (unsigned i = 0; i < header().e_shnum; ++i) {
auto& section = this->section(i);
dbgprintf(" Section %u: {\n", i);
dbgprintf(" name: %s\n", section.name());
dbgprintf(" name: %.*s\n", (int)section.name().length(), section.name().characters_without_null_termination());
dbgprintf(" type: %x\n", section.type());
dbgprintf(" offset: %x\n", section.offset());
dbgprintf(" size: %u\n", section.size());
@ -118,8 +118,9 @@ void Image::dump() const
for (unsigned i = 1; i < symbol_count(); ++i) {
auto& sym = symbol(i);
dbgprintf("Symbol @%u:\n", i);
dbgprintf(" Name: %s\n", sym.name());
dbgprintf(" In section: %s\n", section_index_to_string(sym.section_index()));
dbgprintf(" Name: %.*s\n", (int)sym.name().length(), sym.name().characters_without_null_termination());
StringView section_index_string = section_index_to_string(sym.section_index());
dbgprintf(" In section: %.*s\n", (int)section_index_string.length(), section_index_string.characters_without_null_termination());
dbgprintf(" Value: %x\n", sym.value());
dbgprintf(" Size: %u\n", sym.size());
}