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/instructions.h" |
6 #include "vm/simulator.h" | 7 #include "vm/simulator.h" |
7 #include "vm/signal_handler.h" | 8 #include "vm/signal_handler.h" |
8 #if defined(TARGET_OS_MACOS) | 9 #if defined(TARGET_OS_MACOS) |
9 | 10 |
10 namespace dart { | 11 namespace dart { |
11 | 12 |
12 uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) { | 13 uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) { |
13 uintptr_t pc = 0; | 14 uintptr_t pc = 0; |
14 | 15 |
15 #if defined(HOST_ARCH_IA32) | 16 #if defined(HOST_ARCH_IA32) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #else | 62 #else |
62 UNIMPLEMENTED(); | 63 UNIMPLEMENTED(); |
63 #endif // HOST_ARCH_... | 64 #endif // HOST_ARCH_... |
64 | 65 |
65 return sp; | 66 return sp; |
66 } | 67 } |
67 | 68 |
68 | 69 |
69 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { | 70 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { |
70 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) | 71 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) |
71 return static_cast<uintptr_t>(mcontext->__ss.__x[19]); | 72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]); |
72 #else | 73 #else |
73 return GetCStackPointer(mcontext); | 74 return GetCStackPointer(mcontext); |
74 #endif | 75 #endif |
75 } | 76 } |
76 | 77 |
77 | 78 |
78 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { | 79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
79 uintptr_t lr = 0; | 80 uintptr_t lr = 0; |
80 | 81 |
81 #if defined(TARGET_ARCH_IA32) | 82 #if defined(TARGET_ARCH_IA32) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 sigemptyset(&act.sa_mask); | 122 sigemptyset(&act.sa_mask); |
122 act.sa_flags = 0; | 123 act.sa_flags = 0; |
123 int r = sigaction(SIGPROF, &act, NULL); | 124 int r = sigaction(SIGPROF, &act, NULL); |
124 ASSERT(r == 0); | 125 ASSERT(r == 0); |
125 } | 126 } |
126 | 127 |
127 | 128 |
128 } // namespace dart | 129 } // namespace dart |
129 | 130 |
130 #endif // defined(TARGET_OS_MACOS) | 131 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |