mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-28 07:48:14 +08:00
linux: fix ARM snapshot context traits build.
On GCC with libstdc++, ContextTraits fail to build because of the missing declaration of offsetof (should include cstddef) and for aliasing a type with the same name overriding previous declaration. Change-Id: Ic497238122bcb430f14f9234644c483a8e27e3b6 Reviewed-on: https://chromium-review.googlesource.com/1114606 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
This commit is contained in:
parent
17dff19b21
commit
4b05be4265
@ -130,7 +130,7 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
|
|||||||
|
|
||||||
LinuxVMAddress gprs_address =
|
LinuxVMAddress gprs_address =
|
||||||
context_address + offsetof(UContext<ContextTraits32>, mcontext32) +
|
context_address + offsetof(UContext<ContextTraits32>, mcontext32) +
|
||||||
offsetof(MContext32, gprs);
|
offsetof(ContextTraits32::MContext32, gprs);
|
||||||
|
|
||||||
SignalThreadContext32 thread_context;
|
SignalThreadContext32 thread_context;
|
||||||
if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) {
|
if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) {
|
||||||
@ -207,7 +207,7 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
|
|||||||
|
|
||||||
LinuxVMAddress gprs_address =
|
LinuxVMAddress gprs_address =
|
||||||
context_address + offsetof(UContext<ContextTraits64>, mcontext64) +
|
context_address + offsetof(UContext<ContextTraits64>, mcontext64) +
|
||||||
offsetof(MContext64, gprs);
|
offsetof(ContextTraits64::MContext64, gprs);
|
||||||
|
|
||||||
ThreadContext::t64_t thread_context;
|
ThreadContext::t64_t thread_context;
|
||||||
if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) {
|
if (!memory->Read(gprs_address, sizeof(thread_context), &thread_context)) {
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
@ -244,7 +245,7 @@ struct SignalThreadContext32 {
|
|||||||
|
|
||||||
using SignalThreadContext64 = ThreadContext::t64_t;
|
using SignalThreadContext64 = ThreadContext::t64_t;
|
||||||
|
|
||||||
struct MContext32 {
|
struct MContext32Data {
|
||||||
uint32_t trap_no;
|
uint32_t trap_no;
|
||||||
uint32_t error_code;
|
uint32_t error_code;
|
||||||
uint32_t oldmask;
|
uint32_t oldmask;
|
||||||
@ -252,19 +253,19 @@ struct MContext32 {
|
|||||||
uint32_t fault_address;
|
uint32_t fault_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MContext64 {
|
struct MContext64Data {
|
||||||
uint64_t fault_address;
|
uint64_t fault_address;
|
||||||
SignalThreadContext64 gprs;
|
SignalThreadContext64 gprs;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ContextTraits32 : public Traits32 {
|
struct ContextTraits32 : public Traits32 {
|
||||||
using MContext32 = MContext32;
|
using MContext32 = MContext32Data;
|
||||||
using MContext64 = Nothing;
|
using MContext64 = Nothing;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ContextTraits64 : public Traits64 {
|
struct ContextTraits64 : public Traits64 {
|
||||||
using MContext32 = Nothing;
|
using MContext32 = Nothing;
|
||||||
using MContext64 = MContext64;
|
using MContext64 = MContext64Data;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Traits>
|
template <typename Traits>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user