diff --git a/snapshot/linux/exception_snapshot_linux.cc b/snapshot/linux/exception_snapshot_linux.cc index 6e2a9275..c57e072e 100644 --- a/snapshot/linux/exception_snapshot_linux.cc +++ b/snapshot/linux/exception_snapshot_linux.cc @@ -130,7 +130,7 @@ bool ExceptionSnapshotLinux::ReadContext( LinuxVMAddress gprs_address = context_address + offsetof(UContext, mcontext32) + - offsetof(MContext32, gprs); + offsetof(ContextTraits32::MContext32, gprs); SignalThreadContext32 thread_context; if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) { @@ -207,7 +207,7 @@ bool ExceptionSnapshotLinux::ReadContext( LinuxVMAddress gprs_address = context_address + offsetof(UContext, mcontext64) + - offsetof(MContext64, gprs); + offsetof(ContextTraits64::MContext64, gprs); ThreadContext::t64_t thread_context; if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) { diff --git a/snapshot/linux/signal_context.h b/snapshot/linux/signal_context.h index f9d2cb9d..98844151 100644 --- a/snapshot/linux/signal_context.h +++ b/snapshot/linux/signal_context.h @@ -19,6 +19,7 @@ #include #include +#include #include #include "build/build_config.h" @@ -244,7 +245,7 @@ struct SignalThreadContext32 { using SignalThreadContext64 = ThreadContext::t64_t; -struct MContext32 { +struct MContext32Data { uint32_t trap_no; uint32_t error_code; uint32_t oldmask; @@ -252,19 +253,19 @@ struct MContext32 { uint32_t fault_address; }; -struct MContext64 { +struct MContext64Data { uint64_t fault_address; SignalThreadContext64 gprs; }; struct ContextTraits32 : public Traits32 { - using MContext32 = MContext32; + using MContext32 = MContext32Data; using MContext64 = Nothing; }; struct ContextTraits64 : public Traits64 { using MContext32 = Nothing; - using MContext64 = MContext64; + using MContext64 = MContext64Data; }; template