mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:07:46 +00:00
Everywhere: Prefix hexadecimal numbers with 0x
Depending on the values it might be difficult to figure out whether a value is decimal or hexadecimal. So let's make this more obvious. Also this allows copying and pasting those numbers into GNOME calculator and probably also other apps which auto-detect the base.
This commit is contained in:
parent
7bfd319652
commit
31f30e732a
15 changed files with 67 additions and 86 deletions
|
@ -44,9 +44,9 @@ int main(int argc, char** argv)
|
|||
outln("{}:", pid);
|
||||
|
||||
if (extended) {
|
||||
outln("Address Size Resident Dirty Access VMObject Type Purgeable CoW Pages Name");
|
||||
outln("Address Size Resident Dirty Access VMObject Type Purgeable CoW Pages Name");
|
||||
} else {
|
||||
outln("Address Size Access Name");
|
||||
outln("Address Size Access Name");
|
||||
}
|
||||
|
||||
auto file_contents = file->read_all();
|
||||
|
@ -74,11 +74,7 @@ int main(int argc, char** argv)
|
|||
(map.get("shared").to_bool() ? "s" : "-"),
|
||||
(map.get("syscall").to_bool() ? "c" : "-"));
|
||||
|
||||
#if ARCH(I386)
|
||||
out("{:08x} ", address);
|
||||
#else
|
||||
out("{:16x} ", address);
|
||||
#endif
|
||||
out("{:p} ", address);
|
||||
out("{:>10} ", size);
|
||||
if (extended) {
|
||||
auto resident = map.get("amount_resident").to_string();
|
||||
|
|
|
@ -530,14 +530,14 @@ int main(int argc, char** argv)
|
|||
outln("There are no sections in this file.");
|
||||
} else {
|
||||
outln("Section Headers:");
|
||||
outln(" Name Type Address Offset Size Flags");
|
||||
outln(" Name Type Address Offset Size Flags");
|
||||
|
||||
elf_image.for_each_section([](const ELF::Image::Section& section) {
|
||||
out(" {:19} ", section.name());
|
||||
out("{:15} ", object_section_header_type_to_string(section.type()));
|
||||
out("{:08x} ", section.address());
|
||||
out("{:08x} ", section.offset());
|
||||
out("{:08x} ", section.size());
|
||||
out("{:p} ", section.address());
|
||||
out("{:p} ", section.offset());
|
||||
out("{:p} ", section.size());
|
||||
out("{}", section.flags());
|
||||
outln();
|
||||
});
|
||||
|
@ -714,11 +714,11 @@ int main(int argc, char** argv)
|
|||
|
||||
if (object->symbol_count()) {
|
||||
// FIXME: Add support for init/fini/start/main sections
|
||||
outln(" Num: Value Size Type Bind Name");
|
||||
outln(" Num: Value Size Type Bind Name");
|
||||
object->for_each_symbol([](const ELF::DynamicObject::Symbol& sym) {
|
||||
out(" {:>4}: ", sym.index());
|
||||
out("{:08x} ", sym.value());
|
||||
out("{:08x} ", sym.size());
|
||||
out("{:p} ", sym.value());
|
||||
out("{:p} ", sym.size());
|
||||
out("{:8} ", object_symbol_type_to_string(sym.type()));
|
||||
out("{:8} ", object_symbol_binding_to_string(sym.bind()));
|
||||
out("{}", sym.name());
|
||||
|
@ -736,12 +736,12 @@ int main(int argc, char** argv)
|
|||
if (display_symbol_table) {
|
||||
if (elf_image.symbol_count()) {
|
||||
outln("Symbol table '{}' contains {} entries:", ELF_SYMTAB, elf_image.symbol_count());
|
||||
outln(" Num: Value Size Type Bind Name");
|
||||
outln(" Num: Value Size Type Bind Name");
|
||||
|
||||
elf_image.for_each_symbol([](const ELF::Image::Symbol& sym) {
|
||||
out(" {:>4}: ", sym.index());
|
||||
out("{:08x} ", sym.value());
|
||||
out("{:08x} ", sym.size());
|
||||
out("{:p} ", sym.value());
|
||||
out("{:p} ", sym.size());
|
||||
out("{:8} ", object_symbol_type_to_string(sym.type()));
|
||||
out("{:8} ", object_symbol_binding_to_string(sym.bind()));
|
||||
out("{}", sym.name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue