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