sd: sidebars are now visible in LOOL
[LibreOffice.git] / external / breakpad / ucontext.patch
bloba108ae11cd59b42fbdd3fab5954e26b6d218de2e
1 --- src/client/linux/dump_writer_common/ucontext_reader.cc
2 +++ src/client/linux/dump_writer_common/ucontext_reader.cc
3 @@ -40,15 +40,15 @@
5 #if defined(__i386__)
7 -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
8 +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
9 return uc->uc_mcontext.gregs[REG_ESP];
12 -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
13 +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
14 return uc->uc_mcontext.gregs[REG_EIP];
17 -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
18 +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
19 const struct _libc_fpstate* fp) {
20 const greg_t* regs = uc->uc_mcontext.gregs;
22 @@ -88,15 +88,15 @@
24 #elif defined(__x86_64)
26 -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
27 +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
28 return uc->uc_mcontext.gregs[REG_RSP];
31 -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
32 +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
33 return uc->uc_mcontext.gregs[REG_RIP];
36 -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
37 +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
38 const struct _libc_fpstate* fpregs) {
39 const greg_t* regs = uc->uc_mcontext.gregs;
41 @@ -145,15 +145,15 @@
43 #elif defined(__ARM_EABI__)
45 -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
46 +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
47 return uc->uc_mcontext.arm_sp;
50 -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
51 +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
52 return uc->uc_mcontext.arm_pc;
55 -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
56 +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
57 out->context_flags = MD_CONTEXT_ARM_FULL;
59 out->iregs[0] = uc->uc_mcontext.arm_r0;
60 @@ -184,15 +184,15 @@
62 #elif defined(__aarch64__)
64 -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
65 +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
66 return uc->uc_mcontext.sp;
69 -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
70 +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
71 return uc->uc_mcontext.pc;
74 -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
75 +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
76 const struct fpsimd_context* fpregs) {
77 out->context_flags = MD_CONTEXT_ARM64_FULL;
79 @@ -210,15 +210,15 @@
81 #elif defined(__mips__)
83 -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
84 +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
85 return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
88 -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
89 +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
90 return uc->uc_mcontext.pc;
93 -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
94 +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
95 out->context_flags = MD_CONTEXT_MIPS_FULL;
97 for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
98 --- src/client/linux/dump_writer_common/ucontext_reader.h
99 +++ src/client/linux/dump_writer_common/ucontext_reader.h
100 @@ -41,21 +41,21 @@
102 // Wraps platform-dependent implementations of accessors to ucontext structs.
103 struct UContextReader {
104 - static uintptr_t GetStackPointer(const struct ucontext* uc);
105 + static uintptr_t GetStackPointer(const ucontext_t* uc);
107 - static uintptr_t GetInstructionPointer(const struct ucontext* uc);
108 + static uintptr_t GetInstructionPointer(const ucontext_t* uc);
110 // Juggle a arch-specific ucontext into a minidump format
111 // out: the minidump structure
112 // info: the collection of register structures.
113 #if defined(__i386__) || defined(__x86_64)
114 - static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
115 + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
116 const struct _libc_fpstate* fp);
117 #elif defined(__aarch64__)
118 - static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
119 + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
120 const struct fpsimd_context* fpregs);
121 #else
122 - static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
123 + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
124 #endif
127 --- src/client/linux/handler/exception_handler.cc
128 +++ src/client/linux/handler/exception_handler.cc
129 @@ -439,9 +439,9 @@
130 // Fill in all the holes in the struct to make Valgrind happy.
131 memset(&g_crash_context_, 0, sizeof(g_crash_context_));
132 memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
133 - memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext));
134 + memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
135 #if defined(__aarch64__)
136 - struct ucontext* uc_ptr = (struct ucontext*)uc;
137 + ucontext_t* uc_ptr = (ucontext_t*)uc;
138 struct fpsimd_context* fp_ptr =
139 (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
140 if (fp_ptr->head.magic == FPSIMD_MAGIC) {
141 @@ -450,9 +450,9 @@
143 #elif !defined(__ARM_EABI__) && !defined(__mips__)
144 // FP state is not part of user ABI on ARM Linux.
145 - // In case of MIPS Linux FP state is already part of struct ucontext
146 + // In case of MIPS Linux FP state is already part of ucontext_t
147 // and 'float_state' is not a member of CrashContext.
148 - struct ucontext* uc_ptr = (struct ucontext*)uc;
149 + ucontext_t* uc_ptr = (ucontext_t*)uc;
150 if (uc_ptr->uc_mcontext.fpregs) {
151 memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
152 sizeof(g_crash_context_.float_state));
153 @@ -476,7 +476,7 @@
154 // ExceptionHandler::HandleSignal().
155 siginfo.si_code = SI_USER;
156 siginfo.si_pid = getpid();
157 - struct ucontext context;
158 + ucontext_t context;
159 getcontext(&context);
160 return HandleSignal(sig, &siginfo, &context);
162 --- src/client/linux/handler/exception_handler.h
163 +++ src/client/linux/handler/exception_handler.h
164 @@ -191,7 +191,7 @@
165 struct CrashContext {
166 siginfo_t siginfo;
167 pid_t tid; // the crashing thread.
168 - struct ucontext context;
169 + ucontext_t context;
170 #if !defined(__ARM_EABI__) && !defined(__mips__)
171 // #ifdef this out because FP state is not part of user ABI for Linux ARM.
172 // In case of MIPS Linux FP state is already part of struct
173 --- src/client/linux/microdump_writer/microdump_writer.cc
174 +++ src/client/linux/microdump_writer/microdump_writer.cc
175 @@ -395,7 +395,7 @@
177 void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
179 - const struct ucontext* const ucontext_;
180 + const ucontext_t* const ucontext_;
181 #if !defined(__ARM_EABI__) && !defined(__mips__)
182 const google_breakpad::fpstate_t* const float_state_;
183 #endif
184 --- src/client/linux/minidump_writer/minidump_writer.cc
185 +++ src/client/linux/minidump_writer/minidump_writer.cc
186 @@ -1238,7 +1238,7 @@
187 const int fd_; // File descriptor where the minidum should be written.
188 const char* path_; // Path to the file where the minidum should be written.
190 - const struct ucontext* const ucontext_; // also from the signal handler
191 + const ucontext_t* const ucontext_; // also from the signal handler
192 #if !defined(__ARM_EABI__) && !defined(__mips__)
193 const google_breakpad::fpstate_t* const float_state_; // ditto
194 #endif