OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #include "vm/simulator.h" | 6 #include "vm/simulator.h" |
7 #include "vm/signal_handler.h" | 7 #include "vm/signal_handler.h" |
8 #if defined(TARGET_OS_MACOS) | 8 #if defined(TARGET_OS_MACOS) |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 | 30 |
31 uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) { | 31 uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) { |
32 uintptr_t fp = 0; | 32 uintptr_t fp = 0; |
33 | 33 |
34 #if defined(HOST_ARCH_IA32) | 34 #if defined(HOST_ARCH_IA32) |
35 fp = static_cast<uintptr_t>(mcontext->__ss.__ebp); | 35 fp = static_cast<uintptr_t>(mcontext->__ss.__ebp); |
36 #elif defined(HOST_ARCH_X64) | 36 #elif defined(HOST_ARCH_X64) |
37 fp = static_cast<uintptr_t>(mcontext->__ss.__rbp); | 37 fp = static_cast<uintptr_t>(mcontext->__ss.__rbp); |
38 #elif defined(HOST_ARCH_ARM) | 38 #elif defined(HOST_ARCH_ARM) |
39 fp = static_cast<uintptr_t>(mcontext->__ss.__r[11]); | 39 fp = static_cast<uintptr_t>(mcontext->__ss.__r[7]); |
40 #elif defined(HOST_ARCH_ARM64) | 40 #elif defined(HOST_ARCH_ARM64) |
41 fp = static_cast<uintptr_t>(mcontext->__ss.__fp); | 41 fp = static_cast<uintptr_t>(mcontext->__ss.__fp); |
42 #else | 42 #else |
43 #error Unsuported architecture. | 43 #error Unsuported architecture. |
44 #endif // HOST_ARCH_... | 44 #endif // HOST_ARCH_... |
45 | 45 |
46 return fp; | 46 return fp; |
47 } | 47 } |
48 | 48 |
49 | 49 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 sigemptyset(&act.sa_mask); | 117 sigemptyset(&act.sa_mask); |
118 act.sa_flags = 0; | 118 act.sa_flags = 0; |
119 int r = sigaction(SIGPROF, &act, NULL); | 119 int r = sigaction(SIGPROF, &act, NULL); |
120 ASSERT(r == 0); | 120 ASSERT(r == 0); |
121 } | 121 } |
122 | 122 |
123 | 123 |
124 } // namespace dart | 124 } // namespace dart |
125 | 125 |
126 #endif // defined(TARGET_OS_MACOS) | 126 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |