mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
98 lines
4.1 KiB
Diff
98 lines
4.1 KiB
Diff
diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
|
index 052ce37..95b0fb4 100644
|
|
--- a/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 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
|
|
}
|
|
|
|
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 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
|
|
}
|
|
|
|
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;
|
|
diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
|
|
index 2de80b7..4cf1377 100644
|
|
--- a/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 @@ struct UContextReader {
|
|
// 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);
|
|
diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
|
|
index d1dc331..d1cc562 100644
|
|
--- a/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 @@ class ExceptionHandler;
|
|
#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
|
|
--- ./breakpad/src/common/linux/elf_core_dump.h.orig
|
|
+++ ./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.orig
|
|
+++ ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
|
@@ -495,7 +495,9 @@
|
|
siginfo.si_code = SI_USER;
|
|
siginfo.si_pid = getpid();
|
|
ucontext_t context;
|
|
+#if defined(__GLIBC__)
|
|
getcontext(&context);
|
|
+#endif
|
|
return HandleSignal(sig, &siginfo, &context);
|
|
}
|
|
|
|
@@ -680,9 +682,14 @@
|
|
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
|