tpopela / rpms / chromium

Forked from rpms/chromium 6 years ago
Clone

Blame chromium-59.0.3071.115-ucontext-fix.patch

d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc.ucontextfix	2017-07-12 15:23:33.019591380 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2017-07-12 15:32:52.069197546 -0400
d9e2499
@@ -36,19 +36,19 @@ namespace google_breakpad {
d9e2499
 
d9e2499
 // Minidump defines register structures which are different from the raw
d9e2499
 // structures which we get from the kernel. These are platform specific
d9e2499
-// functions to juggle the ucontext and user structures into minidump format.
d9e2499
+// functions to juggle the ucontext_t and user structures into minidump format.
d9e2499
 
d9e2499
 #if defined(__i386__)
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.gregs[REG_ESP];
d9e2499
 }
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.gregs[REG_EIP];
d9e2499
 }
d9e2499
 
d9e2499
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
d9e2499
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
d9e2499
                                     const struct _libc_fpstate* fp) {
d9e2499
   const greg_t* regs = uc->uc_mcontext.gregs;
d9e2499
 
d9e2499
@@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawC
d9e2499
 
d9e2499
 #elif defined(__x86_64)
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.gregs[REG_RSP];
d9e2499
 }
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.gregs[REG_RIP];
d9e2499
 }
d9e2499
 
d9e2499
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
d9e2499
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
d9e2499
                                     const struct _libc_fpstate* fpregs) {
d9e2499
   const greg_t* regs = uc->uc_mcontext.gregs;
d9e2499
 
d9e2499
@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawC
d9e2499
 
d9e2499
 #elif defined(__ARM_EABI__)
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.arm_sp;
d9e2499
 }
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.arm_pc;
d9e2499
 }
d9e2499
 
d9e2499
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
d9e2499
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
d9e2499
   out->context_flags = MD_CONTEXT_ARM_FULL;
d9e2499
 
d9e2499
   out->iregs[0] = uc->uc_mcontext.arm_r0;
d9e2499
@@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawC
d9e2499
 
d9e2499
 #elif defined(__aarch64__)
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.sp;
d9e2499
 }
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.pc;
d9e2499
 }
d9e2499
 
d9e2499
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
d9e2499
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
d9e2499
                                     const struct fpsimd_context* fpregs) {
d9e2499
   out->context_flags = MD_CONTEXT_ARM64_FULL;
d9e2499
 
d9e2499
@@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawC
d9e2499
 
d9e2499
 #elif defined(__mips__)
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
d9e2499
 }
d9e2499
 
d9e2499
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
d9e2499
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
d9e2499
   return uc->uc_mcontext.pc;
d9e2499
 }
d9e2499
 
d9e2499
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
d9e2499
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
d9e2499
 #if _MIPS_SIM == _ABI64
d9e2499
   out->context_flags = MD_CONTEXT_MIPS64_FULL;
d9e2499
 #elif _MIPS_SIM == _ABIO32
d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.ucontextfix	2017-07-12 15:33:08.486806743 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2017-07-12 15:33:57.299644808 -0400
d9e2499
@@ -39,23 +39,23 @@
d9e2499
 
d9e2499
 namespace google_breakpad {
d9e2499
 
d9e2499
-// Wraps platform-dependent implementations of accessors to ucontext structs.
d9e2499
+// Wraps platform-dependent implementations of accessors to ucontext_t structs.
d9e2499
 struct UContextReader {
d9e2499
-  static uintptr_t GetStackPointer(const struct ucontext* uc);
d9e2499
+  static uintptr_t GetStackPointer(const ucontext_t* uc);
d9e2499
 
d9e2499
-  static uintptr_t GetInstructionPointer(const struct ucontext* uc);
d9e2499
+  static uintptr_t GetInstructionPointer(const ucontext_t* uc);
d9e2499
 
d9e2499
-  // Juggle a arch-specific ucontext into a minidump format
d9e2499
+  // Juggle a arch-specific ucontext_t into a minidump format
d9e2499
   //   out: the minidump structure
d9e2499
   //   info: the collection of register structures.
d9e2499
 #if defined(__i386__) || defined(__x86_64)
d9e2499
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
d9e2499
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
d9e2499
                              const struct _libc_fpstate* fp);
d9e2499
 #elif defined(__aarch64__)
d9e2499
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
d9e2499
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
d9e2499
                              const struct fpsimd_context* fpregs);
d9e2499
 #else
d9e2499
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
d9e2499
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
d9e2499
 #endif
d9e2499
 };
d9e2499
 
d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.cc.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.cc
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.cc.ucontextfix	2017-07-12 15:34:09.094364048 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.cc	2017-07-12 15:35:36.483283853 -0400
d9e2499
@@ -439,9 +439,9 @@ bool ExceptionHandler::HandleSignal(int
d9e2499
   // Fill in all the holes in the struct to make Valgrind happy.
d9e2499
   memset(&g_crash_context_, 0, sizeof(g_crash_context_));
d9e2499
   memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
d9e2499
-  memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext));
d9e2499
+  memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
d9e2499
 #if defined(__aarch64__)
d9e2499
-  struct ucontext* uc_ptr = (struct ucontext*)uc;
d9e2499
+  ucontext_t* uc_ptr = (ucontext_t*)uc;
d9e2499
   struct fpsimd_context* fp_ptr =
d9e2499
       (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
d9e2499
   if (fp_ptr->head.magic == FPSIMD_MAGIC) {
d9e2499
@@ -450,9 +450,9 @@ bool ExceptionHandler::HandleSignal(int
d9e2499
   }
d9e2499
 #elif !defined(__ARM_EABI__) && !defined(__mips__)
d9e2499
   // FP state is not part of user ABI on ARM Linux.
d9e2499
-  // In case of MIPS Linux FP state is already part of struct ucontext
d9e2499
+  // In case of MIPS Linux FP state is already part of ucontext_t
d9e2499
   // and 'float_state' is not a member of CrashContext.
d9e2499
-  struct ucontext* uc_ptr = (struct ucontext*)uc;
d9e2499
+  ucontext_t* uc_ptr = (ucontext_t*)uc;
d9e2499
   if (uc_ptr->uc_mcontext.fpregs) {
d9e2499
     memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
d9e2499
            sizeof(g_crash_context_.float_state));
d9e2499
@@ -476,7 +476,7 @@ bool ExceptionHandler::SimulateSignalDel
d9e2499
   // ExceptionHandler::HandleSignal().
d9e2499
   siginfo.si_code = SI_USER;
d9e2499
   siginfo.si_pid = getpid();
d9e2499
-  struct ucontext context;
d9e2499
+  ucontext_t context;
d9e2499
   getcontext(&context);
d9e2499
   return HandleSignal(sig, &siginfo, &context);
d9e2499
 }
d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.h.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.h
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.h.ucontextfix	2017-07-12 15:35:48.559996380 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/handler/exception_handler.h	2017-07-12 15:36:32.615948562 -0400
d9e2499
@@ -191,11 +191,11 @@ class ExceptionHandler {
d9e2499
   struct CrashContext {
d9e2499
     siginfo_t siginfo;
d9e2499
     pid_t tid;  // the crashing thread.
d9e2499
-    struct ucontext context;
d9e2499
+    ucontext_t context;
d9e2499
 #if !defined(__ARM_EABI__) && !defined(__mips__)
d9e2499
     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
d9e2499
     // In case of MIPS Linux FP state is already part of struct
d9e2499
-    // ucontext so 'float_state' is not required.
d9e2499
+    // ucontext_t so 'float_state' is not required.
d9e2499
     fpstate_t float_state;
d9e2499
 #endif
d9e2499
   };
d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/microdump_writer/microdump_writer.cc.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/microdump_writer/microdump_writer.cc.ucontextfix	2017-07-12 15:37:26.232674196 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/microdump_writer/microdump_writer.cc	2017-07-12 15:37:39.032369973 -0400
d9e2499
@@ -579,7 +579,7 @@ class MicrodumpWriter {
d9e2499
 
d9e2499
   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
d9e2499
 
d9e2499
-  const struct ucontext* const ucontext_;
d9e2499
+  const ucontext_t* const ucontext_;
d9e2499
 #if !defined(__ARM_EABI__) && !defined(__mips__)
d9e2499
   const google_breakpad::fpstate_t* const float_state_;
d9e2499
 #endif
d9e2499
diff -up chromium-59.0.3071.115/breakpad/src/client/linux/minidump_writer/minidump_writer.cc.ucontextfix chromium-59.0.3071.115/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
d9e2499
--- chromium-59.0.3071.115/breakpad/src/client/linux/minidump_writer/minidump_writer.cc.ucontextfix	2017-07-12 15:37:54.041013246 -0400
d9e2499
+++ chromium-59.0.3071.115/breakpad/src/client/linux/minidump_writer/minidump_writer.cc	2017-07-12 15:38:19.600405748 -0400
d9e2499
@@ -1323,7 +1323,7 @@ class MinidumpWriter {
d9e2499
   const int fd_;  // File descriptor where the minidum should be written.
d9e2499
   const char* path_;  // Path to the file where the minidum should be written.
d9e2499
 
d9e2499
-  const struct ucontext* const ucontext_;  // also from the signal handler
d9e2499
+  const ucontext_t* const ucontext_;  // also from the signal handler
d9e2499
 #if !defined(__ARM_EABI__) && !defined(__mips__)
d9e2499
   const google_breakpad::fpstate_t* const float_state_;  // ditto
d9e2499
 #endif