OLD | NEW |
1 // Copyright (c) 2014, Google Inc. | 1 // Copyright (c) 2014, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | 213 uintptr_t UContextReader::GetStackPointer(const struct ucontext* 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 struct ucontext* 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 *uc) { |
| 222 #if _MIPS_SIM == _ABI64 |
| 223 out->context_flags = MD_CONTEXT_MIPS64_FULL; |
| 224 #elif _MIPS_SIM == _ABIO32 |
222 out->context_flags = MD_CONTEXT_MIPS_FULL; | 225 out->context_flags = MD_CONTEXT_MIPS_FULL; |
| 226 #else |
| 227 #error "This mips ABI is currently not supported (n32)" |
| 228 #endif |
223 | 229 |
224 for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i) | 230 for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i) |
225 out->iregs[i] = uc->uc_mcontext.gregs[i]; | 231 out->iregs[i] = uc->uc_mcontext.gregs[i]; |
226 | 232 |
227 out->mdhi = uc->uc_mcontext.mdhi; | 233 out->mdhi = uc->uc_mcontext.mdhi; |
228 out->mdlo = uc->uc_mcontext.mdlo; | 234 out->mdlo = uc->uc_mcontext.mdlo; |
229 | 235 |
230 out->hi[0] = uc->uc_mcontext.hi1; | 236 out->hi[0] = uc->uc_mcontext.hi1; |
231 out->hi[1] = uc->uc_mcontext.hi2; | 237 out->hi[1] = uc->uc_mcontext.hi2; |
232 out->hi[2] = uc->uc_mcontext.hi3; | 238 out->hi[2] = uc->uc_mcontext.hi3; |
(...skipping 11 matching lines...) Expand all Loading... |
244 out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i]; | 250 out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i]; |
245 | 251 |
246 out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; | 252 out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; |
247 #if _MIPS_SIM == _ABIO32 | 253 #if _MIPS_SIM == _ABIO32 |
248 out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. | 254 out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. |
249 #endif | 255 #endif |
250 } | 256 } |
251 #endif | 257 #endif |
252 | 258 |
253 } // namespace google_breakpad | 259 } // namespace google_breakpad |
OLD | NEW |