OLD | NEW |
1 // Copyright (c) 2013 Google Inc. | 1 // Copyright (c) 2013 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Getting instruction pointer based off architecture. | 100 // Getting instruction pointer based off architecture. |
101 uint32_t architecture = context->GetContextCPU(); | 101 uint32_t architecture = context->GetContextCPU(); |
102 switch (architecture) { | 102 switch (architecture) { |
103 case MD_CONTEXT_X86: | 103 case MD_CONTEXT_X86: |
104 instruction_ptr = context->GetContextX86()->eip; | 104 instruction_ptr = context->GetContextX86()->eip; |
105 break; | 105 break; |
106 case MD_CONTEXT_AMD64: | 106 case MD_CONTEXT_AMD64: |
107 instruction_ptr = context->GetContextAMD64()->rip; | 107 instruction_ptr = context->GetContextAMD64()->rip; |
108 break; | 108 break; |
| 109 case MD_CONTEXT_ARM: |
| 110 instruction_ptr = |
| 111 context->GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC]; |
| 112 break; |
| 113 case MD_CONTEXT_ARM64: |
| 114 instruction_ptr = |
| 115 context->GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_PC]; |
| 116 break; |
109 default: | 117 default: |
110 // TODO(liuandrew): Add support ARM and arm64 architectures. | |
111 BPLOG(INFO) << "Unsupported architecture."; | 118 BPLOG(INFO) << "Unsupported architecture."; |
112 return EXPLOITABILITY_ERR_PROCESSING; | 119 return EXPLOITABILITY_ERR_PROCESSING; |
113 } | 120 } |
114 | 121 |
115 if (!this->InstructionPointerInCode(instruction_ptr)) { | 122 if (!this->InstructionPointerInCode(instruction_ptr)) { |
116 return EXPLOITABILITY_HIGH; | 123 return EXPLOITABILITY_HIGH; |
117 } | 124 } |
118 | 125 |
119 return EXPLOITABILITY_NONE; | 126 return EXPLOITABILITY_NONE; |
120 } | 127 } |
(...skipping 15 matching lines...) Expand all Loading... |
136 // If the memory mapping retrieval fails, we will check the modules | 143 // If the memory mapping retrieval fails, we will check the modules |
137 // to see if the instruction pointer is inside a module. | 144 // to see if the instruction pointer is inside a module. |
138 // TODO(liuandrew): Check if the instruction pointer lies in an executable | 145 // TODO(liuandrew): Check if the instruction pointer lies in an executable |
139 // region within the module. | 146 // region within the module. |
140 MinidumpModuleList *minidump_module_list = dump_->GetModuleList(); | 147 MinidumpModuleList *minidump_module_list = dump_->GetModuleList(); |
141 return !minidump_module_list || | 148 return !minidump_module_list || |
142 minidump_module_list->GetModuleForAddress(instruction_ptr); | 149 minidump_module_list->GetModuleForAddress(instruction_ptr); |
143 } | 150 } |
144 | 151 |
145 } // namespace google_breakpad | 152 } // namespace google_breakpad |
OLD | NEW |