@@ -0,0 +1,221 @@
1+diff --git a/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
2+index b20a68b..38f1375 100644
3+--- a/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
4++++ b/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
5+@@ -36,19 +36,19 @@ namespace google_breakpad {
6+
7+ // Minidump defines register structures which are different from the raw
8+ // structures which we get from the kernel. These are platform specific
9+-// functions to juggle the ucontext and user structures into minidump format.
10++// functions to juggle the ucontext_t and user structures into minidump format.
11+
12+ #if defined(__i386__)
13+
14+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
15++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
16+ return uc->uc_mcontext.gregs[REG_ESP];
17+ }
18+
19+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
20++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
21+ return uc->uc_mcontext.gregs[REG_EIP];
22+ }
23+
24+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
25++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
26+ const struct _libc_fpstate* fp) {
27+ const greg_t* regs = uc->uc_mcontext.gregs;
28+
29+@@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
30+
31+ #elif defined(__x86_64)
32+
33+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
34++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
35+ return uc->uc_mcontext.gregs[REG_RSP];
36+ }
37+
38+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
39++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
40+ return uc->uc_mcontext.gregs[REG_RIP];
41+ }
42+
43+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
44++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
45+ const struct _libc_fpstate* fpregs) {
46+ const greg_t* regs = uc->uc_mcontext.gregs;
47+
48+@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
49+
50+ #elif defined(__ARM_EABI__)
51+
52+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
53++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
54+ return uc->uc_mcontext.arm_sp;
55+ }
56+
57+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
58++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
59+ return uc->uc_mcontext.arm_pc;
60+ }
61+
62+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
63++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
64+ out->context_flags = MD_CONTEXT_ARM_FULL;
65+
66+ out->iregs[0] = uc->uc_mcontext.arm_r0;
67+@@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
68+
69+ #elif defined(__aarch64__)
70+
71+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
72++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
73+ return uc->uc_mcontext.sp;
74+ }
75+
76+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
77++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
78+ return uc->uc_mcontext.pc;
79+ }
80+
81+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
82++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
83+ const struct fpsimd_context* fpregs) {
84+ out->context_flags = MD_CONTEXT_ARM64_FULL;
85+
86+@@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
87+
88+ #elif defined(__mips__)
89+
90+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
91++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
92+ return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
93+ }
94+
95+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
96++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
97+ return uc->uc_mcontext.pc;
98+ }
99+
100+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
101++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
102+ out->context_flags = MD_CONTEXT_MIPS_FULL;
103+
104+ for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
105+diff --git a/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
106+index b6e77b4..2de80b7 100644
107+--- a/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
108++++ b/common/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
109+@@ -39,23 +39,23 @@
110+
111+ namespace google_breakpad {
112+
113+-// Wraps platform-dependent implementations of accessors to ucontext structs.
114++// Wraps platform-dependent implementations of accessors to ucontext_t structs.
115+ struct UContextReader {
116+- static uintptr_t GetStackPointer(const struct ucontext* uc);
117++ static uintptr_t GetStackPointer(const ucontext_t* uc);
118+
119+- static uintptr_t GetInstructionPointer(const struct ucontext* uc);
120++ static uintptr_t GetInstructionPointer(const ucontext_t* uc);
121+
122+- // Juggle a arch-specific ucontext into a minidump format
123++ // Juggle a arch-specific ucontext_t into a minidump format
124+ // out: the minidump structure
125+ // info: the collection of register structures.
126+ #if defined(__i386__) || defined(__x86_64)
127+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
128++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
129+ const struct _libc_fpstate* fp);
130+ #elif defined(__aarch64__)
131+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
132++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
133+ const struct fpsimd_context* fpregs);
134+ #else
135+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
136++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
137+ #endif
138+ };
139+
140+diff --git a/common/google-breakpad/src/client/linux/handler/exception_handler.cc b/common/google-breakpad/src/client/linux/handler/exception_handler.cc
141+index 3e2d196..b6d02ef 100644
142+--- a/common/google-breakpad/src/client/linux/handler/exception_handler.cc
143++++ b/common/google-breakpad/src/client/linux/handler/exception_handler.cc
144+@@ -404,9 +404,9 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
145+ // Fill in all the holes in the struct to make Valgrind happy.
146+ memset(&context, 0, sizeof(context));
147+ memcpy(&context.siginfo, info, sizeof(siginfo_t));
148+- memcpy(&context.context, uc, sizeof(struct ucontext));
149++ memcpy(&context.context, uc, sizeof(ucontext_t));
150+ #if defined(__aarch64__)
151+- struct ucontext *uc_ptr = (struct ucontext*)uc;
152++ ucontext_t* uc_ptr = (ucontext_t*)uc;
153+ struct fpsimd_context *fp_ptr =
154+ (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
155+ if (fp_ptr->head.magic == FPSIMD_MAGIC) {
156+@@ -414,9 +414,9 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
157+ }
158+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
159+ // FP state is not part of user ABI on ARM Linux.
160+- // In case of MIPS Linux FP state is already part of struct ucontext
161++ // In case of MIPS Linux FP state is already part of ucontext_t
162+ // and 'float_state' is not a member of CrashContext.
163+- struct ucontext *uc_ptr = (struct ucontext*)uc;
164++ ucontext_t* uc_ptr = (ucontext_t*)uc;
165+ if (uc_ptr->uc_mcontext.fpregs) {
166+ memcpy(&context.float_state,
167+ uc_ptr->uc_mcontext.fpregs,
168+@@ -440,7 +440,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
169+ // ExceptionHandler::HandleSignal().
170+ siginfo.si_code = SI_USER;
171+ siginfo.si_pid = getpid();
172+- struct ucontext context;
173++ ucontext_t context;
174+ getcontext(&context);
175+ return HandleSignal(sig, &siginfo, &context);
176+ }
177+diff --git a/common/google-breakpad/src/client/linux/handler/exception_handler.h b/common/google-breakpad/src/client/linux/handler/exception_handler.h
178+index 591c310..42f4055 100644
179+--- a/common/google-breakpad/src/client/linux/handler/exception_handler.h
180++++ b/common/google-breakpad/src/client/linux/handler/exception_handler.h
181+@@ -191,11 +191,11 @@ class ExceptionHandler {
182+ struct CrashContext {
183+ siginfo_t siginfo;
184+ pid_t tid; // the crashing thread.
185+- struct ucontext context;
186++ ucontext_t context;
187+ #if !defined(__ARM_EABI__) && !defined(__mips__)
188+ // #ifdef this out because FP state is not part of user ABI for Linux ARM.
189+- // In case of MIPS Linux FP state is already part of struct
190+- // ucontext so 'float_state' is not required.
191++ // In case of MIPS Linux FP state is already part of ucontext_t so
192++ // 'float_state' is not required.
193+ fpstate_t float_state;
194+ #endif
195+ };
196+diff --git a/common/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc b/common/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc
197+index 494e2a2..c00436b 100644
198+--- a/common/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc
199++++ b/common/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc
200+@@ -328,7 +328,7 @@ class MicrodumpWriter {
201+
202+ void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
203+
204+- const struct ucontext* const ucontext_;
205++ const ucontext_t* const ucontext_;
206+ #if !defined(__ARM_EABI__) && !defined(__mips__)
207+ const google_breakpad::fpstate_t* const float_state_;
208+ #endif
209+diff --git a/common/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/common/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
210+index 8406ffe..7e6fe52 100644
211+--- a/common/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
212++++ b/common/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
213+@@ -1221,7 +1221,7 @@ class MinidumpWriter {
214+ const int fd_; // File descriptor where the minidum should be written.
215+ const char* path_; // Path to the file where the minidum should be written.
216+
217+- const struct ucontext* const ucontext_; // also from the signal handler
218++ const ucontext_t* const ucontext_; // also from the signal handler
219+ #if !defined(__ARM_EABI__) && !defined(__mips__)
220+ const google_breakpad::fpstate_t* const float_state_; // ditto
221+ #endif