| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug/stack_trace.h" | 5 #include "base/debug/stack_trace.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 { " cr2: ", context->uc_mcontext.gregs[REG_CR2] }, | 336 { " cr2: ", context->uc_mcontext.gregs[REG_CR2] }, |
| 337 #endif | 337 #endif |
| 338 }; | 338 }; |
| 339 | 339 |
| 340 #if ARCH_CPU_32_BITS | 340 #if ARCH_CPU_32_BITS |
| 341 const int kRegisterPadding = 8; | 341 const int kRegisterPadding = 8; |
| 342 #elif ARCH_CPU_64_BITS | 342 #elif ARCH_CPU_64_BITS |
| 343 const int kRegisterPadding = 16; | 343 const int kRegisterPadding = 16; |
| 344 #endif | 344 #endif |
| 345 | 345 |
| 346 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(registers); i++) { | 346 for (size_t i = 0; i < arraysize(registers); i++) { |
| 347 PrintToStderr(registers[i].label); | 347 PrintToStderr(registers[i].label); |
| 348 internal::itoa_r(registers[i].value, buf, sizeof(buf), | 348 internal::itoa_r(registers[i].value, buf, sizeof(buf), |
| 349 16, kRegisterPadding); | 349 16, kRegisterPadding); |
| 350 PrintToStderr(buf); | 350 PrintToStderr(buf); |
| 351 | 351 |
| 352 if ((i + 1) % 4 == 0) | 352 if ((i + 1) % 4 == 0) |
| 353 PrintToStderr("\n"); | 353 PrintToStderr("\n"); |
| 354 } | 354 } |
| 355 PrintToStderr("\n"); | 355 PrintToStderr("\n"); |
| 356 #endif | 356 #endif |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 *ptr = *start; | 826 *ptr = *start; |
| 827 *start++ = ch; | 827 *start++ = ch; |
| 828 } | 828 } |
| 829 return buf; | 829 return buf; |
| 830 } | 830 } |
| 831 | 831 |
| 832 } // namespace internal | 832 } // namespace internal |
| 833 | 833 |
| 834 } // namespace debug | 834 } // namespace debug |
| 835 } // namespace base | 835 } // namespace base |
| OLD | NEW |