From b1775c56b253e8f3c19e4ae8cfd67f9fe1fe45b1 Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Tue, 11 Apr 2023 21:40:00 +0000 Subject: [PATCH] Convert RISC-V numeric identifiers to strings Printing the register values as part of the stack trace relies on the CPU architecture being "riscv" or "riscv64" rather than the numeric identifiers (0x8005 and 0x8006, respectively). Fixed: 1432306 Test: Run `minidump_stackwalk` on a RISC-V minidump Change-Id: I0009da687438d51047e2ee39ffa1c50d78798caa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4416399 Reviewed-by: Joshua Peraza --- src/processor/minidump_processor.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index d56a7d63..5ba6ff4f 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -633,6 +633,16 @@ bool MinidumpProcessor::GetCPUInfo(Minidump* dump, SystemInfo* info) { break; } + case MD_CPU_ARCHITECTURE_RISCV: { + info->cpu = "riscv"; + break; + } + + case MD_CPU_ARCHITECTURE_RISCV64: { + info->cpu = "riscv64"; + break; + } + default: { // Assign the numeric architecture ID into the CPU string. char cpu_string[7];