diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-07-21 19:53:38 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-22 08:57:01 +0200 |
commit | 31f30e732a947cabdefcd3a7d3758fa5ff3601fa (patch) | |
tree | 9d492dc3592ab739a92c9e396e64e2ae1dc08f9c /Userland/Applications/CrashReporter | |
parent | 7bfd319652052c04999ed722d70ede7568e1907a (diff) | |
download | serenity-31f30e732a947cabdefcd3a7d3758fa5ff3601fa.zip |
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.
Diffstat (limited to 'Userland/Applications/CrashReporter')
-rw-r--r-- | Userland/Applications/CrashReporter/main.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index d2acee7cd1..b8bb70df15 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -86,21 +86,15 @@ static TitleAndText build_cpu_registers(const ELF::Core::ThreadInfo& thread_info StringBuilder builder; #if ARCH(I386) - builder.appendff("eax={:08x} ebx={:08x} ecx={:08x} edx={:08x}", regs.eax, regs.ebx, regs.ecx, regs.edx); - builder.append('\n'); - builder.appendff("ebp={:08x} esp={:08x} esi={:08x} edi={:08x}", regs.ebp, regs.esp, regs.esi, regs.edi); - builder.append('\n'); - builder.appendff("eip={:08x} eflags={:08x}", regs.eip, regs.eflags); + builder.appendff("eax={:p} ebx={:p} ecx={:p} edx={:p}\n", regs.eax, regs.ebx, regs.ecx, regs.edx); + builder.appendff("ebp={:p} esp={:p} esi={:p} edi={:p}\n", regs.ebp, regs.esp, regs.esi, regs.edi); + builder.appendff("eip={:p} eflags={:p}", regs.eip, regs.eflags); #else - builder.appendff("rax={:16x} rbx={:16x} rcx={:16x} rdx={:16x}", regs.rax, regs.rbx, regs.rcx, regs.rdx); - builder.append('\n'); - builder.appendff("rbp={:16x} rsp={:16x} rsi={:16x} rdi={:16x}", regs.rbp, regs.rsp, regs.rsi, regs.rdi); - builder.append('\n'); - builder.appendff(" r8={:16x} r9={:16x} r10={:16x} r11={:16x}", regs.r8, regs.r9, regs.r10, regs.r11); - builder.append('\n'); - builder.appendff("r12={:16x} r13={:16x} r14={:16x} r15={:16x}", regs.r12, regs.r13, regs.r14, regs.r15); - builder.append('\n'); - builder.appendff("rip={:16x} rflags={:16x}", regs.rip, regs.rflags); + builder.appendff("rax={:p} rbx={:p} rcx={:p} rdx={:p}\n", regs.rax, regs.rbx, regs.rcx, regs.rdx); + builder.appendff("rbp={:p} rsp={:p} rsi={:p} rdi={:p}\n", regs.rbp, regs.rsp, regs.rsi, regs.rdi); + builder.appendff(" r8={:p} r9={:p} r10={:p} r11={:p}\n", regs.r8, regs.r9, regs.r10, regs.r11); + builder.appendff("r12={:p} r13={:p} r14={:p} r15={:p}\n", regs.r12, regs.r13, regs.r14, regs.r15); + builder.appendff("rip={:p} rflags={:p}", regs.rip, regs.rflags); #endif return { |