| OLD | NEW |
| 1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const MDRawContextARM64* DumpContext::GetContextARM64() const { | 127 const MDRawContextARM64* DumpContext::GetContextARM64() const { |
| 128 if (GetContextCPU() != MD_CONTEXT_ARM64) { | 128 if (GetContextCPU() != MD_CONTEXT_ARM64) { |
| 129 BPLOG(ERROR) << "DumpContext cannot get arm64 context"; | 129 BPLOG(ERROR) << "DumpContext cannot get arm64 context"; |
| 130 return NULL; | 130 return NULL; |
| 131 } | 131 } |
| 132 | 132 |
| 133 return context_.arm64; | 133 return context_.arm64; |
| 134 } | 134 } |
| 135 | 135 |
| 136 const MDRawContextMIPS* DumpContext::GetContextMIPS() const { | 136 const MDRawContextMIPS* DumpContext::GetContextMIPS() const { |
| 137 if (GetContextCPU() != MD_CONTEXT_MIPS) { | 137 if ((GetContextCPU() != MD_CONTEXT_MIPS) && |
| 138 (GetContextCPU() != MD_CONTEXT_MIPS64)) { |
| 138 BPLOG(ERROR) << "DumpContext cannot get MIPS context"; | 139 BPLOG(ERROR) << "DumpContext cannot get MIPS context"; |
| 139 return NULL; | 140 return NULL; |
| 140 } | 141 } |
| 141 | 142 |
| 142 return context_.ctx_mips; | 143 return context_.ctx_mips; |
| 143 } | 144 } |
| 144 | 145 |
| 145 bool DumpContext::GetInstructionPointer(uint64_t* ip) const { | 146 bool DumpContext::GetInstructionPointer(uint64_t* ip) const { |
| 146 BPLOG_IF(ERROR, !ip) << "DumpContext::GetInstructionPointer requires |ip|"; | 147 BPLOG_IF(ERROR, !ip) << "DumpContext::GetInstructionPointer requires |ip|"; |
| 147 assert(ip); | 148 assert(ip); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 168 case MD_CONTEXT_PPC64: | 169 case MD_CONTEXT_PPC64: |
| 169 *ip = GetContextPPC64()->srr0; | 170 *ip = GetContextPPC64()->srr0; |
| 170 break; | 171 break; |
| 171 case MD_CONTEXT_SPARC: | 172 case MD_CONTEXT_SPARC: |
| 172 *ip = GetContextSPARC()->pc; | 173 *ip = GetContextSPARC()->pc; |
| 173 break; | 174 break; |
| 174 case MD_CONTEXT_X86: | 175 case MD_CONTEXT_X86: |
| 175 *ip = GetContextX86()->eip; | 176 *ip = GetContextX86()->eip; |
| 176 break; | 177 break; |
| 177 case MD_CONTEXT_MIPS: | 178 case MD_CONTEXT_MIPS: |
| 179 case MD_CONTEXT_MIPS64: |
| 178 *ip = GetContextMIPS()->epc; | 180 *ip = GetContextMIPS()->epc; |
| 179 break; | 181 break; |
| 180 default: | 182 default: |
| 181 // This should never happen. | 183 // This should never happen. |
| 182 BPLOG(ERROR) << "Unknown CPU architecture in GetInstructionPointer"; | 184 BPLOG(ERROR) << "Unknown CPU architecture in GetInstructionPointer"; |
| 183 return false; | 185 return false; |
| 184 } | 186 } |
| 185 return true; | 187 return true; |
| 186 } | 188 } |
| 187 | 189 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 211 case MD_CONTEXT_PPC64: | 213 case MD_CONTEXT_PPC64: |
| 212 *sp = GetContextPPC64()->gpr[MD_CONTEXT_PPC64_REG_SP]; | 214 *sp = GetContextPPC64()->gpr[MD_CONTEXT_PPC64_REG_SP]; |
| 213 break; | 215 break; |
| 214 case MD_CONTEXT_SPARC: | 216 case MD_CONTEXT_SPARC: |
| 215 *sp = GetContextSPARC()->g_r[MD_CONTEXT_SPARC_REG_SP]; | 217 *sp = GetContextSPARC()->g_r[MD_CONTEXT_SPARC_REG_SP]; |
| 216 break; | 218 break; |
| 217 case MD_CONTEXT_X86: | 219 case MD_CONTEXT_X86: |
| 218 *sp = GetContextX86()->esp; | 220 *sp = GetContextX86()->esp; |
| 219 break; | 221 break; |
| 220 case MD_CONTEXT_MIPS: | 222 case MD_CONTEXT_MIPS: |
| 223 case MD_CONTEXT_MIPS64: |
| 221 *sp = GetContextMIPS()->iregs[MD_CONTEXT_MIPS_REG_SP]; | 224 *sp = GetContextMIPS()->iregs[MD_CONTEXT_MIPS_REG_SP]; |
| 222 break; | 225 break; |
| 223 default: | 226 default: |
| 224 // This should never happen. | 227 // This should never happen. |
| 225 BPLOG(ERROR) << "Unknown CPU architecture in GetStackPointer"; | 228 BPLOG(ERROR) << "Unknown CPU architecture in GetStackPointer"; |
| 226 return false; | 229 return false; |
| 227 } | 230 } |
| 228 return true; | 231 return true; |
| 229 } | 232 } |
| 230 | 233 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 291 |
| 289 case MD_CONTEXT_ARM: | 292 case MD_CONTEXT_ARM: |
| 290 delete context_.arm; | 293 delete context_.arm; |
| 291 break; | 294 break; |
| 292 | 295 |
| 293 case MD_CONTEXT_ARM64: | 296 case MD_CONTEXT_ARM64: |
| 294 delete context_.arm64; | 297 delete context_.arm64; |
| 295 break; | 298 break; |
| 296 | 299 |
| 297 case MD_CONTEXT_MIPS: | 300 case MD_CONTEXT_MIPS: |
| 301 case MD_CONTEXT_MIPS64: |
| 298 delete context_.ctx_mips; | 302 delete context_.ctx_mips; |
| 299 break; | 303 break; |
| 300 | 304 |
| 301 default: | 305 default: |
| 302 // There is no context record (valid_ is false) or there's a | 306 // There is no context record (valid_ is false) or there's a |
| 303 // context record for an unknown CPU (shouldn't happen, only known | 307 // context record for an unknown CPU (shouldn't happen, only known |
| 304 // records are stored by Read). | 308 // records are stored by Read). |
| 305 break; | 309 break; |
| 306 } | 310 } |
| 307 | 311 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 for (unsigned int freg_index = 0; | 598 for (unsigned int freg_index = 0; |
| 595 freg_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT; | 599 freg_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT; |
| 596 ++freg_index) { | 600 ++freg_index) { |
| 597 uint128_struct fp_value = context_arm64->float_save.regs[freg_index]; | 601 uint128_struct fp_value = context_arm64->float_save.regs[freg_index]; |
| 598 printf(" float_save.regs[%2d] = 0x%" PRIx64 "%" PRIx64 "\n", | 602 printf(" float_save.regs[%2d] = 0x%" PRIx64 "%" PRIx64 "\n", |
| 599 freg_index, fp_value.high, fp_value.low); | 603 freg_index, fp_value.high, fp_value.low); |
| 600 } | 604 } |
| 601 break; | 605 break; |
| 602 } | 606 } |
| 603 | 607 |
| 604 case MD_CONTEXT_MIPS: { | 608 case MD_CONTEXT_MIPS: |
| 609 case MD_CONTEXT_MIPS64: { |
| 605 const MDRawContextMIPS* context_mips = GetContextMIPS(); | 610 const MDRawContextMIPS* context_mips = GetContextMIPS(); |
| 606 printf("MDRawContextMIPS\n"); | 611 printf("MDRawContextMIPS\n"); |
| 607 printf(" context_flags = 0x%x\n", | 612 printf(" context_flags = 0x%x\n", |
| 608 context_mips->context_flags); | 613 context_mips->context_flags); |
| 609 for (int ireg_index = 0; | 614 for (int ireg_index = 0; |
| 610 ireg_index < MD_CONTEXT_MIPS_GPR_COUNT; | 615 ireg_index < MD_CONTEXT_MIPS_GPR_COUNT; |
| 611 ++ireg_index) { | 616 ++ireg_index) { |
| 612 printf(" iregs[%2d] = 0x%" PRIx64 "\n", | 617 printf(" iregs[%2d] = 0x%" PRIx64 "\n", |
| 613 ireg_index, context_mips->iregs[ireg_index]); | 618 ireg_index, context_mips->iregs[ireg_index]); |
| 614 } | 619 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 break; | 653 break; |
| 649 } | 654 } |
| 650 | 655 |
| 651 default: { | 656 default: { |
| 652 break; | 657 break; |
| 653 } | 658 } |
| 654 } | 659 } |
| 655 } | 660 } |
| 656 | 661 |
| 657 } // namespace google_breakpad | 662 } // namespace google_breakpad |
| OLD | NEW |