mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-26 04:35:39 +03:00
90 lines
3.3 KiB
Diff
90 lines
3.3 KiB
Diff
--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
|
+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
|
@@ -49,7 +49,7 @@
|
|
}
|
|
|
|
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
|
- const struct _libc_fpstate* fp) {
|
|
+ const struct _fpstate* fp) {
|
|
const greg_t* regs = uc->uc_mcontext.gregs;
|
|
|
|
out->context_flags = MD_CONTEXT_X86_FULL |
|
|
@@ -97,7 +97,7 @@
|
|
}
|
|
|
|
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
|
- const struct _libc_fpstate* fpregs) {
|
|
+ const struct _fpstate* fpregs) {
|
|
const greg_t* regs = uc->uc_mcontext.gregs;
|
|
|
|
out->context_flags = MD_CONTEXT_AMD64_FULL;
|
|
--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
|
|
+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
|
|
@@ -50,7 +50,7 @@
|
|
// info: the collection of register structures.
|
|
#if defined(__i386__) || defined(__x86_64)
|
|
static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
|
- const struct _libc_fpstate* fp);
|
|
+ const struct _fpstate* fp);
|
|
#elif defined(__aarch64__)
|
|
static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
|
const struct fpsimd_context* fpregs);
|
|
--- ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
|
|
+++ ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
|
|
@@ -48,7 +48,7 @@
|
|
#if defined(__aarch64__)
|
|
typedef struct fpsimd_context fpstate_t;
|
|
#elif !defined(__ARM_EABI__) && !defined(__mips__)
|
|
-typedef struct _libc_fpstate fpstate_t;
|
|
+typedef struct _fpstate fpstate_t;
|
|
#endif
|
|
|
|
// These entries store a list of memory regions that the client wants included
|
|
--- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
|
|
+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
|
|
@@ -36,6 +36,7 @@
|
|
#include <elf.h>
|
|
#include <link.h>
|
|
#include <stddef.h>
|
|
+#include <limits.h>
|
|
|
|
#include "common/memory_range.h"
|
|
|
|
@@ -51,9 +52,9 @@
|
|
typedef ElfW(Phdr) Phdr;
|
|
typedef ElfW(Word) Word;
|
|
typedef ElfW(Addr) Addr;
|
|
-#if __WORDSIZE == 32
|
|
+#if ULONG_MAX == 0xffffffff
|
|
static const int kClass = ELFCLASS32;
|
|
-#elif __WORDSIZE == 64
|
|
+#elif ULONG_MAX == 0xffffffffffffffff
|
|
static const int kClass = ELFCLASS64;
|
|
#else
|
|
#error "Unsupported __WORDSIZE for ElfCoreDump."
|
|
--- ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
|
+++ ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
|
@@ -490,7 +490,9 @@
|
|
siginfo.si_code = SI_USER;
|
|
siginfo.si_pid = getpid();
|
|
ucontext_t context;
|
|
+#if defined(__GLIBC__)
|
|
getcontext(&context);
|
|
+#endif
|
|
return HandleSignal(sig, &siginfo, &context);
|
|
}
|
|
|
|
@@ -675,9 +677,13 @@
|
|
sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
|
|
|
|
CrashContext context;
|
|
+#if defined(__GLIBC__)
|
|
int getcontext_result = getcontext(&context.context);
|
|
if (getcontext_result)
|
|
return false;
|
|
+#else
|
|
+ return false;
|
|
+#endif
|
|
|
|
#if defined(__i386__)
|
|
// In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved
|