OLD | NEW |
---|---|
1 // Copyright (c) 2012, Google Inc. | 1 // Copyright (c) 2012, 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) { | 199 if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) { |
200 return false; | 200 return false; |
201 } | 201 } |
202 #else // PTRACE_GETREGSET | 202 #else // PTRACE_GETREGSET |
203 void* gp_addr; | 203 void* gp_addr; |
204 info->GetGeneralPurposeRegisters(&gp_addr, NULL); | 204 info->GetGeneralPurposeRegisters(&gp_addr, NULL); |
205 if (sys_ptrace(PTRACE_GETREGS, tid, NULL, gp_addr) == -1) { | 205 if (sys_ptrace(PTRACE_GETREGS, tid, NULL, gp_addr) == -1) { |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 #if !(defined(__ANDROID__) && defined(__ARM_EABI__)) | |
210 // When running an arm build on an arm64 device, attempting to get the | |
211 // floating point registers fails. On Android, the floating point registers | |
212 // aren't written to the cpu context anyway, so just don't get them here. | |
213 // See http://crbug.com/508324 | |
209 void* fp_addr; | 214 void* fp_addr; |
210 info->GetFloatingPointRegisters(&fp_addr, NULL); | 215 info->GetFloatingPointRegisters(&fp_addr, NULL); |
211 if (sys_ptrace(PTRACE_GETFPREGS, tid, NULL, fp_addr) == -1) { | 216 if (sys_ptrace(PTRACE_GETFPREGS, tid, NULL, fp_addr) == -1) { |
212 return false; | 217 return false; |
213 } | 218 } |
214 #endif | 219 #endif |
220 #endif | |
Lei Zhang
2015/08/04 23:39:34
nit: add // PTRACE_GETREGSET so it's more obvious
| |
215 | 221 |
216 #if defined(__i386) | 222 #if defined(__i386) |
217 #if !defined(bit_FXSAVE) // e.g. Clang | 223 #if !defined(bit_FXSAVE) // e.g. Clang |
218 #define bit_FXSAVE bit_FXSR | 224 #define bit_FXSAVE bit_FXSR |
219 #endif | 225 #endif |
220 // Detect if the CPU supports the FXSAVE/FXRSTOR instructions | 226 // Detect if the CPU supports the FXSAVE/FXRSTOR instructions |
221 int eax, ebx, ecx, edx; | 227 int eax, ebx, ecx, edx; |
222 __cpuid(1, eax, ebx, ecx, edx); | 228 __cpuid(1, eax, ebx, ecx, edx); |
223 if (edx & bit_FXSAVE) { | 229 if (edx & bit_FXSAVE) { |
224 if (sys_ptrace(PTRACE_GETFPXREGS, tid, NULL, &info->fpxregs) == -1) { | 230 if (sys_ptrace(PTRACE_GETFPXREGS, tid, NULL, &info->fpxregs) == -1) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 } | 346 } |
341 } | 347 } |
342 dir_reader->PopEntry(); | 348 dir_reader->PopEntry(); |
343 } | 349 } |
344 | 350 |
345 sys_close(fd); | 351 sys_close(fd); |
346 return true; | 352 return true; |
347 } | 353 } |
348 | 354 |
349 } // namespace google_breakpad | 355 } // namespace google_breakpad |
OLD | NEW |