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/instructions.h" |
7 #include "vm/simulator.h" | 7 #include "vm/simulator.h" |
8 #include "vm/signal_handler.h" | 8 #include "vm/signal_handler.h" |
9 #if defined(TARGET_OS_MACOS) | 9 #if defined(TARGET_OS_MACOS) |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]); | 72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]); |
73 #else | 73 #else |
74 return GetCStackPointer(mcontext); | 74 return GetCStackPointer(mcontext); |
75 #endif | 75 #endif |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { | 79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
80 uintptr_t lr = 0; | 80 uintptr_t lr = 0; |
81 | 81 |
82 #if defined(TARGET_ARCH_IA32) | 82 #if defined(HOST_ARCH_IA32) |
83 lr = 0; | 83 lr = 0; |
84 #elif defined(TARGET_ARCH_X64) | 84 #elif defined(HOST_ARCH_X64) |
85 lr = 0; | 85 lr = 0; |
86 #elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) | 86 #elif defined(HOST_ARCH_ARM) |
87 lr = 0; | 87 lr = static_cast<uintptr_t>(mcontext->__ss.__lr); |
88 #elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) | 88 #elif defined(HOST_ARCH_ARM64) |
89 lr = 0; | 89 lr = static_cast<uintptr_t>(mcontext->__ss.__lr); |
90 #elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) | |
91 lr = 0; | |
92 #elif defined(TARGET_ARCH_ARM) | |
93 lr = 0; | |
94 #elif defined(TARGET_ARCH_ARM64) | |
95 lr = 0; | |
96 #elif defined(TARGET_ARCH_MIPS) | |
97 lr = 0; | |
98 #else | 90 #else |
99 UNIMPLEMENTED(); | 91 #error Unsupported architecture. |
100 #endif // TARGET_ARCH_... | 92 #endif // HOST_ARCH_... |
101 | 93 |
102 return lr; | 94 return lr; |
103 } | 95 } |
104 | 96 |
105 | 97 |
106 void SignalHandler::InstallImpl(SignalAction action) { | 98 void SignalHandler::InstallImpl(SignalAction action) { |
107 struct sigaction act; | 99 struct sigaction act; |
108 act.sa_handler = NULL; | 100 act.sa_handler = NULL; |
109 act.sa_sigaction = action; | 101 act.sa_sigaction = action; |
110 sigemptyset(&act.sa_mask); | 102 sigemptyset(&act.sa_mask); |
(...skipping 11 matching lines...) Expand all Loading... |
122 sigemptyset(&act.sa_mask); | 114 sigemptyset(&act.sa_mask); |
123 act.sa_flags = 0; | 115 act.sa_flags = 0; |
124 int r = sigaction(SIGPROF, &act, NULL); | 116 int r = sigaction(SIGPROF, &act, NULL); |
125 ASSERT(r == 0); | 117 ASSERT(r == 0); |
126 } | 118 } |
127 | 119 |
128 | 120 |
129 } // namespace dart | 121 } // namespace dart |
130 | 122 |
131 #endif // defined(TARGET_OS_MACOS) | 123 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |