Chromium Code Reviews| 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 = context->GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC]; | |
| 111 break; | |
| 112 case MD_CONTEXT_ARM64: | |
| 113 instruction_ptr = context->GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_P C]; | |
|
ivanpe
2015/06/30 01:05:08
Please, keep lines shorter than 80 characters.
liuandrew
2015/06/30 16:14:17
Done.
| |
| 114 break; | |
| 109 default: | 115 default: |
| 110 // TODO(liuandrew): Add support ARM and arm64 architectures. | |
| 111 BPLOG(INFO) << "Unsupported architecture."; | 116 BPLOG(INFO) << "Unsupported architecture."; |
| 112 return EXPLOITABILITY_ERR_PROCESSING; | 117 return EXPLOITABILITY_ERR_PROCESSING; |
| 113 } | 118 } |
| 114 | 119 |
| 115 if (!this->InstructionPointerInCode(instruction_ptr)) { | 120 if (!this->InstructionPointerInCode(instruction_ptr)) { |
| 116 return EXPLOITABILITY_HIGH; | 121 return EXPLOITABILITY_HIGH; |
| 117 } | 122 } |
| 118 | 123 |
| 119 return EXPLOITABILITY_NONE; | 124 return EXPLOITABILITY_NONE; |
| 120 } | 125 } |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 136 // If the memory mapping retrieval fails, we will check the modules | 141 // If the memory mapping retrieval fails, we will check the modules |
| 137 // to see if the instruction pointer is inside a module. | 142 // to see if the instruction pointer is inside a module. |
| 138 // TODO(liuandrew): Check if the instruction pointer lies in an executable | 143 // TODO(liuandrew): Check if the instruction pointer lies in an executable |
| 139 // region within the module. | 144 // region within the module. |
| 140 MinidumpModuleList *minidump_module_list = dump_->GetModuleList(); | 145 MinidumpModuleList *minidump_module_list = dump_->GetModuleList(); |
| 141 return !minidump_module_list || | 146 return !minidump_module_list || |
| 142 minidump_module_list->GetModuleForAddress(instruction_ptr); | 147 minidump_module_list->GetModuleForAddress(instruction_ptr); |
| 143 } | 148 } |
| 144 | 149 |
| 145 } // namespace google_breakpad | 150 } // namespace google_breakpad |
| OLD | NEW |