OLD | NEW |
1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 switch (cpu_type_) { | 781 switch (cpu_type_) { |
782 #ifdef HAS_ARM_SUPPORT | 782 #ifdef HAS_ARM_SUPPORT |
783 case CPU_TYPE_ARM: { | 783 case CPU_TYPE_ARM: { |
784 size_t final_size = | 784 size_t final_size = |
785 std::min(static_cast<size_t>(*count), sizeof(arm_thread_state_t)); | 785 std::min(static_cast<size_t>(*count), sizeof(arm_thread_state_t)); |
786 memcpy(state, &task_context_->uc_mcontext->__ss, final_size); | 786 memcpy(state, &task_context_->uc_mcontext->__ss, final_size); |
787 *count = final_size; | 787 *count = final_size; |
788 return true; | 788 return true; |
789 } | 789 } |
790 #endif | 790 #endif |
| 791 #ifdef HAS_X86_SUPPORT |
| 792 case CPU_TYPE_I386: |
| 793 case CPU_TYPE_X86_64: { |
| 794 size_t state_size = cpu_type_ == CPU_TYPE_I386 ? |
| 795 sizeof(i386_thread_state_t) : sizeof(x86_thread_state64_t); |
| 796 size_t final_size = |
| 797 std::min(static_cast<size_t>(*count), state_size); |
| 798 memcpy(state, &task_context_->uc_mcontext->__ss, final_size); |
| 799 *count = final_size; |
| 800 return true; |
| 801 } |
| 802 #endif |
791 } | 803 } |
792 } | 804 } |
| 805 |
793 thread_state_flavor_t flavor; | 806 thread_state_flavor_t flavor; |
794 switch (cpu_type_) { | 807 switch (cpu_type_) { |
795 #ifdef HAS_ARM_SUPPORT | 808 #ifdef HAS_ARM_SUPPORT |
796 case CPU_TYPE_ARM: | 809 case CPU_TYPE_ARM: |
797 flavor = ARM_THREAD_STATE; | 810 flavor = ARM_THREAD_STATE; |
798 break; | 811 break; |
799 #endif | 812 #endif |
800 #ifdef HAS_PPC_SUPPORT | 813 #ifdef HAS_PPC_SUPPORT |
801 case CPU_TYPE_POWERPC: | 814 case CPU_TYPE_POWERPC: |
802 flavor = PPC_THREAD_STATE; | 815 flavor = PPC_THREAD_STATE; |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 } else { | 1461 } else { |
1449 info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID; | 1462 info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID; |
1450 info_ptr->dump_thread_id = handler_thread_; | 1463 info_ptr->dump_thread_id = handler_thread_; |
1451 info_ptr->requesting_thread_id = 0; | 1464 info_ptr->requesting_thread_id = 0; |
1452 } | 1465 } |
1453 | 1466 |
1454 return true; | 1467 return true; |
1455 } | 1468 } |
1456 | 1469 |
1457 } // namespace google_breakpad | 1470 } // namespace google_breakpad |
OLD | NEW |