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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 return sp; | 71 return sp; |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { | 75 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { |
76 return GetCStackPointer(mcontext); | 76 return GetCStackPointer(mcontext); |
77 } | 77 } |
78 | 78 |
79 | 79 |
| 80 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
| 81 uintptr_t lr = 0; |
| 82 |
| 83 #if defined(TARGET_ARCH_IA32) |
| 84 lr = 0; |
| 85 #elif defined(TARGET_ARCH_X64) |
| 86 lr = 0; |
| 87 #elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) |
| 88 lr = 0; |
| 89 #elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) |
| 90 lr = 0; |
| 91 #elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) |
| 92 lr = 0; |
| 93 #elif defined(TARGET_ARCH_ARM) |
| 94 lr = 0; |
| 95 #elif defined(TARGET_ARCH_ARM64) |
| 96 lr = 0; |
| 97 #elif defined(TARGET_ARCH_MIPS) |
| 98 lr = 0; |
| 99 #else |
| 100 UNIMPLEMENTED(); |
| 101 #endif // TARGET_ARCH_... |
| 102 |
| 103 return lr; |
| 104 } |
| 105 |
| 106 |
80 void SignalHandler::Install(SignalAction action) { | 107 void SignalHandler::Install(SignalAction action) { |
81 struct sigaction act; | 108 struct sigaction act; |
82 act.sa_handler = NULL; | 109 act.sa_handler = NULL; |
83 act.sa_sigaction = action; | 110 act.sa_sigaction = action; |
84 sigemptyset(&act.sa_mask); | 111 sigemptyset(&act.sa_mask); |
85 act.sa_flags = SA_RESTART | SA_SIGINFO; | 112 act.sa_flags = SA_RESTART | SA_SIGINFO; |
86 // TODO(johnmccutchan): Do we care about restoring the signal handler? | 113 // TODO(johnmccutchan): Do we care about restoring the signal handler? |
87 struct sigaction old_act; | 114 struct sigaction old_act; |
88 int r = sigaction(SIGPROF, &act, &old_act); | 115 int r = sigaction(SIGPROF, &act, &old_act); |
89 ASSERT(r == 0); | 116 ASSERT(r == 0); |
90 } | 117 } |
91 | 118 |
92 | 119 |
93 } // namespace dart | 120 } // namespace dart |
94 | 121 |
95 #endif // defined(TARGET_OS_MACOS) | 122 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |