| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | 43 uintptr_t UContextReader::GetStackPointer(const struct ucontext* 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 struct ucontext* 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 *uc, |
| 52 const struct _libc_fpstate* fp) { | 52 const struct _fpstate* fp) { |
| 53 const greg_t* regs = uc->uc_mcontext.gregs; | 53 const greg_t* regs = uc->uc_mcontext.gregs; |
| 54 | 54 |
| 55 out->context_flags = MD_CONTEXT_X86_FULL | | 55 out->context_flags = MD_CONTEXT_X86_FULL | |
| 56 MD_CONTEXT_X86_FLOATING_POINT; | 56 MD_CONTEXT_X86_FLOATING_POINT; |
| 57 | 57 |
| 58 out->gs = regs[REG_GS]; | 58 out->gs = regs[REG_GS]; |
| 59 out->fs = regs[REG_FS]; | 59 out->fs = regs[REG_FS]; |
| 60 out->es = regs[REG_ES]; | 60 out->es = regs[REG_ES]; |
| 61 out->ds = regs[REG_DS]; | 61 out->ds = regs[REG_DS]; |
| 62 | 62 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | 91 uintptr_t UContextReader::GetStackPointer(const struct ucontext* 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 struct ucontext* 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 *uc, |
| 100 const struct _libc_fpstate* fpregs) { | 100 const struct _fpstate* fpregs) { |
| 101 const greg_t* regs = uc->uc_mcontext.gregs; | 101 const greg_t* regs = uc->uc_mcontext.gregs; |
| 102 | 102 |
| 103 out->context_flags = MD_CONTEXT_AMD64_FULL; | 103 out->context_flags = MD_CONTEXT_AMD64_FULL; |
| 104 | 104 |
| 105 out->cs = regs[REG_CSGSFS] & 0xffff; | 105 out->cs = regs[REG_CSGSFS] & 0xffff; |
| 106 | 106 |
| 107 out->fs = (regs[REG_CSGSFS] >> 32) & 0xffff; | 107 out->fs = (regs[REG_CSGSFS] >> 32) & 0xffff; |
| 108 out->gs = (regs[REG_CSGSFS] >> 16) & 0xffff; | 108 out->gs = (regs[REG_CSGSFS] >> 16) & 0xffff; |
| 109 | 109 |
| 110 out->eflags = regs[REG_EFL]; | 110 out->eflags = regs[REG_EFL]; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 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]; |
| 251 | 251 |
| 252 out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; | 252 out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; |
| 253 #if _MIPS_SIM == _ABIO32 | 253 #if _MIPS_SIM == _ABIO32 |
| 254 out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. | 254 out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. |
| 255 #endif | 255 #endif |
| 256 } | 256 } |
| 257 #endif | 257 #endif |
| 258 | 258 |
| 259 } // namespace google_breakpad | 259 } // namespace google_breakpad |
| OLD | NEW |