OLD | NEW |
1 // Copyright (c) 2011 Google Inc. | 1 // Copyright (c) 2011 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 context.context.uc_mcontext.gregs[REG_ESP] = invalid_stack_pointer; | 532 context.context.uc_mcontext.gregs[REG_ESP] = invalid_stack_pointer; |
533 #elif defined(__x86_64) | 533 #elif defined(__x86_64) |
534 context.context.uc_mcontext.gregs[REG_RSP] = invalid_stack_pointer; | 534 context.context.uc_mcontext.gregs[REG_RSP] = invalid_stack_pointer; |
535 #elif defined(__ARM_EABI__) | 535 #elif defined(__ARM_EABI__) |
536 context.context.uc_mcontext.arm_sp = invalid_stack_pointer; | 536 context.context.uc_mcontext.arm_sp = invalid_stack_pointer; |
537 #elif defined(__aarch64__) | 537 #elif defined(__aarch64__) |
538 context.context.uc_mcontext.sp = invalid_stack_pointer; | 538 context.context.uc_mcontext.sp = invalid_stack_pointer; |
539 #elif defined(__mips__) | 539 #elif defined(__mips__) |
540 context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = | 540 context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = |
541 invalid_stack_pointer; | 541 invalid_stack_pointer; |
| 542 #elif defined(__SH4__) |
| 543 context.context.uc_mcontext.gregs[MD_CONTEXT_SH4_REG_SP] = |
| 544 invalid_stack_pointer; |
542 #else | 545 #else |
543 # error "This code has not been ported to your platform yet." | 546 # error "This code has not been ported to your platform yet." |
544 #endif | 547 #endif |
545 | 548 |
546 AutoTempDir temp_dir; | 549 AutoTempDir temp_dir; |
547 string templ = temp_dir.path() + kMDWriterUnitTestFileName; | 550 string templ = temp_dir.path() + kMDWriterUnitTestFileName; |
548 // NOTE: In previous versions of Breakpad, WriteMinidump() would fail if | 551 // NOTE: In previous versions of Breakpad, WriteMinidump() would fail if |
549 // presented with an invalid stack pointer. | 552 // presented with an invalid stack pointer. |
550 ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context))); | 553 ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context))); |
551 | 554 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 kLimitBaseThreadCount) * kMinPerExtraThreadStackReduction; | 750 kLimitBaseThreadCount) * kMinPerExtraThreadStackReduction; |
748 EXPECT_LT(total_limit_stack_size, | 751 EXPECT_LT(total_limit_stack_size, |
749 total_normal_stack_size - min_expected_reduction); | 752 total_normal_stack_size - min_expected_reduction); |
750 } | 753 } |
751 | 754 |
752 // Kill the helper program. | 755 // Kill the helper program. |
753 kill(child_pid, SIGKILL); | 756 kill(child_pid, SIGKILL); |
754 } | 757 } |
755 | 758 |
756 } // namespace | 759 } // namespace |
OLD | NEW |