mozilla-ucontext.patch
author zaitor@opensuse.org
Sun, 01 Oct 2017 23:13:44 +0200
branchfirefox56
changeset 996 84d25951c2db
parent 992 b2ba34e0dc10
permissions -rw-r--r--
- Drop libgnomeui-devel, and replace it with pkgconfig(gconf-2.0), pkgconfig(gtk+-2.0), pkgconfig(gtk+-unix-print-2.0), pkgconfig(glib-2.0), pkgconfig(gobject-2.0) and pkgconfig(gdk-x11-2.0) BuildRequires, align with what configure looks for.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
992
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
# HG changeset patch
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
# User Wolfgang Rosenauer <wr@rosenauer.org>
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
# Parent  f6b8a48d89d77c7a3eb13fef234c618943306c2b
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
Replace struct ucontext with ucontext_t
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
diff --git a/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.cc b/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
--- a/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
+++ b/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
@@ -35,25 +35,25 @@
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    10
 namespace google_breakpad {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    11
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
 // Minidump defines register structures which are different from the raw
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
 // structures which we get from the kernel. These are platform specific
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
 // functions to juggle the ucontext and user structures into minidump format.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
 #if defined(__i386__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
   return uc->uc_mcontext.gregs[REG_ESP];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
   return uc->uc_mcontext.gregs[REG_EIP];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    29
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
                                     const struct _libc_fpstate* fp) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
   const greg_t* regs = uc->uc_mcontext.gregs;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    32
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    33
   out->context_flags = MD_CONTEXT_X86_FULL |
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    34
                        MD_CONTEXT_X86_FLOATING_POINT;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    35
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    36
   out->gs = regs[REG_GS];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    37
   out->fs = regs[REG_FS];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    38
@@ -83,25 +83,25 @@ void UContextReader::FillCPUContext(RawC
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
   out->float_save.data_selector = fp->datasel;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
   // 8 registers * 10 bytes per register.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
   my_memcpy(out->float_save.register_area, fp->_st, 10 * 8);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
 #elif defined(__x86_64)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
   return uc->uc_mcontext.gregs[REG_RSP];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    53
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    54
   return uc->uc_mcontext.gregs[REG_RIP];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    55
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    56
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    58
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    59
                                     const struct _libc_fpstate* fpregs) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
   const greg_t* regs = uc->uc_mcontext.gregs;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    61
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    62
   out->context_flags = MD_CONTEXT_AMD64_FULL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    63
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    64
   out->cs = regs[REG_CSGSFS] & 0xffff;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    65
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    66
   out->fs = (regs[REG_CSGSFS] >> 32) & 0xffff;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    67
@@ -140,25 +140,25 @@ void UContextReader::FillCPUContext(RawC
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    68
   out->flt_save.mx_csr = fpregs->mxcsr;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    69
   out->flt_save.mx_csr_mask = fpregs->mxcr_mask;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    70
   my_memcpy(&out->flt_save.float_registers, &fpregs->_st, 8 * 16);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    71
   my_memcpy(&out->flt_save.xmm_registers, &fpregs->_xmm, 16 * 16);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    72
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    73
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    74
 #elif defined(__ARM_EABI__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    75
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    76
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    77
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    78
   return uc->uc_mcontext.arm_sp;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    79
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    80
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    81
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    82
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    83
   return uc->uc_mcontext.arm_pc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    84
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    85
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    86
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    87
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    88
   out->context_flags = MD_CONTEXT_ARM_FULL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    89
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    90
   out->iregs[0] = uc->uc_mcontext.arm_r0;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    91
   out->iregs[1] = uc->uc_mcontext.arm_r1;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    92
   out->iregs[2] = uc->uc_mcontext.arm_r2;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    93
   out->iregs[3] = uc->uc_mcontext.arm_r3;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    94
   out->iregs[4] = uc->uc_mcontext.arm_r4;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    95
   out->iregs[5] = uc->uc_mcontext.arm_r5;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    96
@@ -179,25 +179,25 @@ void UContextReader::FillCPUContext(RawC
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    97
   // TODO: fix this after fixing ExceptionHandler
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    98
   out->float_save.fpscr = 0;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    99
   my_memset(&out->float_save.regs, 0, sizeof(out->float_save.regs));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   100
   my_memset(&out->float_save.extra, 0, sizeof(out->float_save.extra));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   101
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   102
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   103
 #elif defined(__aarch64__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   104
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   105
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   106
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   107
   return uc->uc_mcontext.sp;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   108
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   109
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   110
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   111
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   112
   return uc->uc_mcontext.pc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   113
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   114
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   115
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   116
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   117
                                     const struct fpsimd_context* fpregs) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   118
   out->context_flags = MD_CONTEXT_ARM64_FULL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   119
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   120
   out->cpsr = static_cast<uint32_t>(uc->uc_mcontext.pstate);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   121
   for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   122
     out->iregs[i] = uc->uc_mcontext.regs[i];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   123
   out->iregs[MD_CONTEXT_ARM64_REG_SP] = uc->uc_mcontext.sp;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   124
   out->iregs[MD_CONTEXT_ARM64_REG_PC] = uc->uc_mcontext.pc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   125
@@ -205,25 +205,25 @@ void UContextReader::FillCPUContext(RawC
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   126
   out->float_save.fpsr = fpregs->fpsr;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   127
   out->float_save.fpcr = fpregs->fpcr;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   128
   my_memcpy(&out->float_save.regs, &fpregs->vregs,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   129
       MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT * 16);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   130
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   131
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   132
 #elif defined(__mips__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   133
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   134
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   135
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   136
   return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   137
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   138
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   139
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   140
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   141
   return uc->uc_mcontext.pc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   142
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   143
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   144
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   145
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   146
 #if _MIPS_SIM == _ABI64
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   147
   out->context_flags = MD_CONTEXT_MIPS64_FULL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   148
 #elif _MIPS_SIM == _ABIO32
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   149
   out->context_flags = MD_CONTEXT_MIPS_FULL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   150
 #else
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   151
 #error "This mips ABI is currently not supported (n32)"
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   152
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   153
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   154
diff --git a/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.h b/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   155
--- a/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   156
+++ b/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   157
@@ -36,29 +36,29 @@
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   158
 #include "linux/dump_writer_common/raw_context_cpu.h"
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   159
 #include "common/memory.h"
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   160
 #include "google_breakpad/common/minidump_format.h"
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   161
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   162
 namespace google_breakpad {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   163
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   164
 // Wraps platform-dependent implementations of accessors to ucontext structs.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   165
 struct UContextReader {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   166
-  static uintptr_t GetStackPointer(const struct ucontext* uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   167
+  static uintptr_t GetStackPointer(const ucontext_t* uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   168
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   169
-  static uintptr_t GetInstructionPointer(const struct ucontext* uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   170
+  static uintptr_t GetInstructionPointer(const ucontext_t* uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   171
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   172
   // Juggle a arch-specific ucontext into a minidump format
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   173
   //   out: the minidump structure
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   174
   //   info: the collection of register structures.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   175
 #if defined(__i386__) || defined(__x86_64)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   176
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   177
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   178
                              const struct _libc_fpstate* fp);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   179
 #elif defined(__aarch64__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   180
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   181
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   182
                              const struct fpsimd_context* fpregs);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   183
 #else
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   184
-  static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   185
+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   186
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   187
 };
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   188
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   189
 }  // namespace google_breakpad
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   190
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   191
 #endif  // CLIENT_LINUX_DUMP_WRITER_COMMON_UCONTEXT_READER_H
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   192
diff --git a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   193
--- a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   194
+++ b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   195
@@ -434,30 +434,30 @@ bool ExceptionHandler::HandleSignal(int 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   196
       info->si_code == SI_TKILL;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   197
   if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   198
     sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   199
   }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   200
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   201
   // Fill in all the holes in the struct to make Valgrind happy.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   202
   memset(&g_crash_context_, 0, sizeof(g_crash_context_));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   203
   memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   204
-  memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   205
+  memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   206
 #if defined(__aarch64__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   207
-  struct ucontext* uc_ptr = (struct ucontext*)uc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   208
+  ucontext_t* uc_ptr = (ucontext_t*)uc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   209
   struct fpsimd_context* fp_ptr =
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   210
       (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   211
   if (fp_ptr->head.magic == FPSIMD_MAGIC) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   212
     memcpy(&g_crash_context_.float_state, fp_ptr,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   213
            sizeof(g_crash_context_.float_state));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   214
   }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   215
 #elif !defined(__ARM_EABI__) && !defined(__mips__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   216
   // FP state is not part of user ABI on ARM Linux.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   217
   // In case of MIPS Linux FP state is already part of struct ucontext
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   218
   // and 'float_state' is not a member of CrashContext.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   219
-  struct ucontext* uc_ptr = (struct ucontext*)uc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   220
+  ucontext_t* uc_ptr = (ucontext_t*)uc;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   221
   if (uc_ptr->uc_mcontext.fpregs) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   222
     memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   223
            sizeof(g_crash_context_.float_state));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   224
   }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   225
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   226
   g_crash_context_.tid = syscall(__NR_gettid);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   227
   if (crash_handler_ != NULL) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   228
     if (crash_handler_(&g_crash_context_, sizeof(g_crash_context_),
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   229
@@ -471,17 +471,17 @@ bool ExceptionHandler::HandleSignal(int 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   230
 // This is a public interface to HandleSignal that allows the client to
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   231
 // generate a crash dump. This function may run in a compromised context.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   232
 bool ExceptionHandler::SimulateSignalDelivery(int sig) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   233
   siginfo_t siginfo = {};
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   234
   // Mimic a trusted signal to allow tracing the process (see
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   235
   // ExceptionHandler::HandleSignal().
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   236
   siginfo.si_code = SI_USER;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   237
   siginfo.si_pid = getpid();
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   238
-  struct ucontext context;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   239
+  ucontext_t context;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   240
   getcontext(&context);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   241
   return HandleSignal(sig, &siginfo, &context);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   242
 }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   243
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   244
 // This function may run in a compromised context: see the top of the file.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   245
 bool ExceptionHandler::GenerateDump(CrashContext *context) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   246
   if (IsOutOfProcess())
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   247
     return crash_generation_client_->RequestDump(context, sizeof(*context));
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   248
diff --git a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.h b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   249
--- a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   250
+++ b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.h
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   251
@@ -186,17 +186,17 @@ class ExceptionHandler {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   252
                                     MinidumpCallback callback,
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   253
                                     void* callback_context);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   254
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   255
   // This structure is passed to minidump_writer.h:WriteMinidump via an opaque
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   256
   // blob. It shouldn't be needed in any user code.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   257
   struct CrashContext {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   258
     siginfo_t siginfo;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   259
     pid_t tid;  // the crashing thread.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   260
-    struct ucontext context;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   261
+    ucontext_t context;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   262
 #if !defined(__ARM_EABI__) && !defined(__mips__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   263
     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   264
     // In case of MIPS Linux FP state is already part of struct
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   265
     // ucontext so 'float_state' is not required.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   266
     fpstate_t float_state;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   267
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   268
   };
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   269
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   270
diff --git a/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc b/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   271
--- a/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   272
+++ b/toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   273
@@ -566,17 +566,17 @@ class MicrodumpWriter {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   274
          ++iter) {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   275
       DumpModule(iter->first, false, 0, iter->second);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   276
     }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   277
     return true;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   278
   }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   279
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   280
   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   281
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   282
-  const struct ucontext* const ucontext_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   283
+  const ucontext_t* const ucontext_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   284
 #if !defined(__ARM_EABI__) && !defined(__mips__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   285
   const google_breakpad::fpstate_t* const float_state_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   286
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   287
   LinuxDumper* dumper_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   288
   const MappingList& mapping_list_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   289
   const MicrodumpExtraInfo microdump_extra_info_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   290
   char* log_line_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   291
 };
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   292
diff --git a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   293
--- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   294
+++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   295
@@ -1242,17 +1242,17 @@ class MinidumpWriter {
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   296
       return false;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   297
     return WriteFile(result, buf);
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   298
   }
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   299
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   300
   // Only one of the 2 member variables below should be set to a valid value.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   301
   const int fd_;  // File descriptor where the minidum should be written.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   302
   const char* path_;  // Path to the file where the minidum should be written.
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   303
 
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   304
-  const struct ucontext* const ucontext_;  // also from the signal handler
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   305
+  const ucontext_t* const ucontext_;  // also from the signal handler
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   306
 #if !defined(__ARM_EABI__) && !defined(__mips__)
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   307
   const google_breakpad::fpstate_t* const float_state_;  // ditto
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   308
 #endif
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   309
   LinuxDumper* dumper_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   310
   MinidumpFileWriter minidump_writer_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   311
   off_t minidump_size_limit_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   312
   MDLocationDescriptor crashing_thread_context_;
b2ba34e0dc10 Firefox 55.0.3 and some other fixes
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   313
   // Blocks of memory written to the dump. These are all currently