disasm: Demangle symbols

This commit is contained in:
Simon Wanner 2022-03-27 19:04:48 +02:00 committed by Andreas Kling
parent 4076619655
commit 6b5e4cdfbc
Notes: sideshowbarker 2024-07-17 04:02:08 +09:00

View file

@ -5,6 +5,7 @@
*/ */
#include <AK/Debug.h> #include <AK/Debug.h>
#include <AK/Demangle.h>
#include <AK/OwnPtr.h> #include <AK/OwnPtr.h>
#include <AK/QuickSort.h> #include <AK/QuickSort.h>
#include <AK/Vector.h> #include <AK/Vector.h>
@ -117,14 +118,14 @@ ErrorOr<int> serenity_main(Main::Arguments args)
while (current_symbol + 1 < symbols.end() && !(current_symbol + 1)->contains(virtual_offset) && (current_symbol + 1)->address() <= virtual_offset) { while (current_symbol + 1 < symbols.end() && !(current_symbol + 1)->contains(virtual_offset) && (current_symbol + 1)->address() <= virtual_offset) {
++current_symbol; ++current_symbol;
if (!is_first_symbol) if (!is_first_symbol)
outln("\n({} ({:p}-{:p}))\n", current_symbol->name, current_symbol->address(), current_symbol->address_end()); outln("\n({} ({:p}-{:p}))\n", demangle(current_symbol->name), current_symbol->address(), current_symbol->address_end());
} }
while (current_symbol + 1 < symbols.end() && (current_symbol + 1)->contains(virtual_offset)) { while (current_symbol + 1 < symbols.end() && (current_symbol + 1)->contains(virtual_offset)) {
if (!is_first_symbol && !current_instruction_is_in_symbol) if (!is_first_symbol && !current_instruction_is_in_symbol)
outln(); outln();
++current_symbol; ++current_symbol;
current_instruction_is_in_symbol = true; current_instruction_is_in_symbol = true;
outln("{:08x} <{}>:", current_symbol->address(), current_symbol->name); outln("{} ({:p}-{:p}):", demangle(current_symbol->name), current_symbol->address(), current_symbol->address_end());
} }
is_first_symbol = false; is_first_symbol = false;