Lines 36-54
namespace google_breakpad {
Link Here
|
36 |
|
36 |
|
37 |
// Minidump defines register structures which are different from the raw |
37 |
// Minidump defines register structures which are different from the raw |
38 |
// structures which we get from the kernel. These are platform specific |
38 |
// structures which we get from the kernel. These are platform specific |
39 |
// functions to juggle the ucontext and user structures into minidump format. |
39 |
// functions to juggle the ucontext_t and user structures into minidump format. |
40 |
|
40 |
|
41 |
#if defined(__i386__) |
41 |
#if defined(__i386__) |
42 |
|
42 |
|
43 |
uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { |
43 |
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { |
44 |
return uc->uc_mcontext.gregs[REG_ESP]; |
44 |
return uc->uc_mcontext.gregs[REG_ESP]; |
45 |
} |
45 |
} |
46 |
|
46 |
|
47 |
uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { |
47 |
uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { |
48 |
return uc->uc_mcontext.gregs[REG_EIP]; |
48 |
return uc->uc_mcontext.gregs[REG_EIP]; |
49 |
} |
49 |
} |
50 |
|
50 |
|
51 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, |
51 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, |
52 |
const struct _libc_fpstate* fp) { |
52 |
const struct _libc_fpstate* fp) { |
53 |
const greg_t* regs = uc->uc_mcontext.gregs; |
53 |
const greg_t* regs = uc->uc_mcontext.gregs; |
54 |
|
54 |
|
Lines 88-102
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
Link Here
|
88 |
|
88 |
|
89 |
#elif defined(__x86_64) |
89 |
#elif defined(__x86_64) |
90 |
|
90 |
|
91 |
uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { |
91 |
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { |
92 |
return uc->uc_mcontext.gregs[REG_RSP]; |
92 |
return uc->uc_mcontext.gregs[REG_RSP]; |
93 |
} |
93 |
} |
94 |
|
94 |
|
95 |
uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { |
95 |
uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { |
96 |
return uc->uc_mcontext.gregs[REG_RIP]; |
96 |
return uc->uc_mcontext.gregs[REG_RIP]; |
97 |
} |
97 |
} |
98 |
|
98 |
|
99 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, |
99 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, |
100 |
const struct _libc_fpstate* fpregs) { |
100 |
const struct _libc_fpstate* fpregs) { |
101 |
const greg_t* regs = uc->uc_mcontext.gregs; |
101 |
const greg_t* regs = uc->uc_mcontext.gregs; |
102 |
|
102 |
|
Lines 145-159
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
Link Here
|
145 |
|
145 |
|
146 |
#elif defined(__ARM_EABI__) |
146 |
#elif defined(__ARM_EABI__) |
147 |
|
147 |
|
148 |
uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { |
148 |
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { |
149 |
return uc->uc_mcontext.arm_sp; |
149 |
return uc->uc_mcontext.arm_sp; |
150 |
} |
150 |
} |
151 |
|
151 |
|
152 |
uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { |
152 |
uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { |
153 |
return uc->uc_mcontext.arm_pc; |
153 |
return uc->uc_mcontext.arm_pc; |
154 |
} |
154 |
} |
155 |
|
155 |
|
156 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { |
156 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { |
157 |
out->context_flags = MD_CONTEXT_ARM_FULL; |
157 |
out->context_flags = MD_CONTEXT_ARM_FULL; |
158 |
|
158 |
|
159 |
out->iregs[0] = uc->uc_mcontext.arm_r0; |
159 |
out->iregs[0] = uc->uc_mcontext.arm_r0; |
Lines 184-198
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
Link Here
|
184 |
|
184 |
|
185 |
#elif defined(__aarch64__) |
185 |
#elif defined(__aarch64__) |
186 |
|
186 |
|
187 |
uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { |
187 |
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { |
188 |
return uc->uc_mcontext.sp; |
188 |
return uc->uc_mcontext.sp; |
189 |
} |
189 |
} |
190 |
|
190 |
|
191 |
uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { |
191 |
uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { |
192 |
return uc->uc_mcontext.pc; |
192 |
return uc->uc_mcontext.pc; |
193 |
} |
193 |
} |
194 |
|
194 |
|
195 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, |
195 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, |
196 |
const struct fpsimd_context* fpregs) { |
196 |
const struct fpsimd_context* fpregs) { |
197 |
out->context_flags = MD_CONTEXT_ARM64_FULL; |
197 |
out->context_flags = MD_CONTEXT_ARM64_FULL; |
198 |
|
198 |
|
Lines 210-224
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
Link Here
|
210 |
|
210 |
|
211 |
#elif defined(__mips__) |
211 |
#elif defined(__mips__) |
212 |
|
212 |
|
213 |
uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { |
213 |
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { |
214 |
return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; |
214 |
return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; |
215 |
} |
215 |
} |
216 |
|
216 |
|
217 |
uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { |
217 |
uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { |
218 |
return uc->uc_mcontext.pc; |
218 |
return uc->uc_mcontext.pc; |
219 |
} |
219 |
} |
220 |
|
220 |
|
221 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { |
221 |
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { |
222 |
#if _MIPS_SIM == _ABI64 |
222 |
#if _MIPS_SIM == _ABI64 |
223 |
out->context_flags = MD_CONTEXT_MIPS64_FULL; |
223 |
out->context_flags = MD_CONTEXT_MIPS64_FULL; |
224 |
#elif _MIPS_SIM == _ABIO32 |
224 |
#elif _MIPS_SIM == _ABIO32 |