LEFT | RIGHT |
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 MDRawContextMIPS* DumpContext::GetContextMIPS() const { | 127 const MDRawContextMIPS* DumpContext::GetContextMIPS() const { |
128 if (GetContextCPU() != MD_CONTEXT_MIPS) { | 128 if (GetContextCPU() != MD_CONTEXT_MIPS) { |
129 BPLOG(ERROR) << "DumpContext cannot get MIPS context"; | 129 BPLOG(ERROR) << "DumpContext cannot get MIPS context"; |
130 return NULL; | 130 return NULL; |
131 } | 131 } |
132 | 132 |
133 return context_.ctx_mips; | 133 return context_.ctx_mips; |
134 } | 134 } |
135 | 135 |
136 bool DumpContext::GetInstructionPointer(uint64_t* ip) const { | 136 bool DumpContext::GetInstructionPointer(uint64_t* ip) const { |
137 BPLOG_IF(ERROR, !ip) << "MinidumpContext::GetInstructionPointer " | 137 BPLOG_IF(ERROR, !ip) << "DumpContext::GetInstructionPointer requires |ip|"; |
138 "requires |ip|"; | |
139 assert(ip); | 138 assert(ip); |
140 *ip = 0; | 139 *ip = 0; |
141 | 140 |
142 if (!valid_) { | 141 if (!valid_) { |
143 BPLOG(ERROR) << "Invalid MinidumpContext for GetInstructionPointer"; | 142 BPLOG(ERROR) << "Invalid DumpContext for GetInstructionPointer"; |
144 return false; | 143 return false; |
145 } | 144 } |
146 | 145 |
147 switch (GetContextCPU()) { | 146 switch (GetContextCPU()) { |
148 case MD_CONTEXT_AMD64: | 147 case MD_CONTEXT_AMD64: |
149 *ip = GetContextAMD64()->rip; | 148 *ip = GetContextAMD64()->rip; |
150 break; | 149 break; |
151 case MD_CONTEXT_ARM: | 150 case MD_CONTEXT_ARM: |
152 *ip = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC]; | 151 *ip = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC]; |
153 break; | 152 break; |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 break; | 596 break; |
598 } | 597 } |
599 | 598 |
600 default: { | 599 default: { |
601 break; | 600 break; |
602 } | 601 } |
603 } | 602 } |
604 } | 603 } |
605 | 604 |
606 } // namespace google_breakpad | 605 } // namespace google_breakpad |
LEFT | RIGHT |