From e72b7dea1a2752ddd5562735d4eef5a840d302e7 Mon Sep 17 00:00:00 2001 From: sanjam panda Date: Tue, 4 Aug 2026 11:18:47 +0000 Subject: [PATCH 1/2] Fixes #131535 for linux-s390x, #131604 introduced a crash --- src/coreclr/debug/crashreport/inproccrashreporter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 64f3a451197ffb..c7be1e5b030329 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -58,6 +58,8 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "riscv64"; #elif defined(TARGET_LOONGARCH64) "loongarch64"; +#elif defined(TARGET_S390X) + "s390x"; #else #error "Unsupported arch" #endif @@ -1241,6 +1243,10 @@ CrashReportHelpers::WriteRegistersToJson( #define CRASH_MCREG_SP(uc) (static_cast((uc)->uc_mcontext.__gregs[2])) #define CRASH_MCREG_FP(uc) (static_cast((uc)->uc_mcontext.__gregs[8])) +#elif defined(TARGET_S390X) + #define CRASH_MCREG_PC(uc) (static_cast((uc)->uc_mcontext.psw.addr)) + #define CRASH_MCREG_SP(uc) (static_cast((uc)->uc_mcontext.gregs[15])) + #define CRASH_MCREG_FP(uc) (static_cast((uc)->uc_mcontext.gregs[11])) #else #error "Unsupported arch" #endif From 1287fdaa33e5dcdae9db6f18a5ebb4cf1f1bcb00 Mon Sep 17 00:00:00 2001 From: Sanjam Panda <36253777+saitama951@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:49:13 +0530 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- src/coreclr/debug/crashreport/inproccrashreporter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index c7be1e5b030329..8f90f92c0edd6e 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -60,6 +60,8 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "loongarch64"; #elif defined(TARGET_S390X) "s390x"; +#elif defined(TARGET_POWERPC64) + "ppc64le"; #else #error "Unsupported arch" #endif @@ -1247,6 +1249,11 @@ CrashReportHelpers::WriteRegistersToJson( #define CRASH_MCREG_PC(uc) (static_cast((uc)->uc_mcontext.psw.addr)) #define CRASH_MCREG_SP(uc) (static_cast((uc)->uc_mcontext.gregs[15])) #define CRASH_MCREG_FP(uc) (static_cast((uc)->uc_mcontext.gregs[11])) + +#elif defined(TARGET_POWERPC64) + #define CRASH_MCREG_PC(uc) (static_cast((uc)->uc_mcontext.gp_regs[32])) + #define CRASH_MCREG_SP(uc) (static_cast((uc)->uc_mcontext.gp_regs[1])) + #define CRASH_MCREG_FP(uc) (static_cast((uc)->uc_mcontext.gp_regs[31])) #else #error "Unsupported arch" #endif