Modify RISCV minidump context to match Crashpad

- RISCV32 will only include support for 32 bit floating point registers
- RISCV64 will only include support for 64 bit floating point registers
- RISCV 32/64 context will include a "version" field to account for
  future extensions

Fixed: 1447862

Tested: `make check` on x86 host
Tested: `minidump_stackwalk` for RISCV64 minidump on x86 host
Change-Id: I605d5b2c35e627a5dc986aaf818a9c9898f6ae0b
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4553281
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Thomas Gales
2023-05-22 22:51:47 +00:00
committed by Joshua Peraza
parent 8267ac6510
commit 64a53c1904
6 changed files with 72 additions and 117 deletions

View File

@@ -1259,12 +1259,11 @@ bool MinidumpContext::Read(uint32_t expected_size) {
Swap(&context_riscv->t5);
Swap(&context_riscv->t6);
for (int fpr_index = 0;
fpr_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT;
for (int fpr_index = 0; fpr_index < MD_CONTEXT_RISCV_FPR_COUNT;
++fpr_index) {
Swap(&context_riscv->float_save.regs[fpr_index]);
Swap(&context_riscv->fpregs[fpr_index]);
}
Swap(&context_riscv->float_save.fpcsr);
Swap(&context_riscv->fcsr);
}
SetContextRISCV(context_riscv.release());
@@ -1338,12 +1337,11 @@ bool MinidumpContext::Read(uint32_t expected_size) {
Swap(&context_riscv64->t5);
Swap(&context_riscv64->t6);
for (int fpr_index = 0;
fpr_index < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT;
for (int fpr_index = 0; fpr_index < MD_CONTEXT_RISCV_FPR_COUNT;
++fpr_index) {
Swap(&context_riscv64->float_save.regs[fpr_index]);
Swap(&context_riscv64->fpregs[fpr_index]);
}
Swap(&context_riscv64->float_save.fpcsr);
Swap(&context_riscv64->fcsr);
}
SetContextRISCV64(context_riscv64.release());