| 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_LINUX) | 9 #if defined(TARGET_OS_LINUX) |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 sp = static_cast<uintptr_t>(mcontext.gregs[29]); | 66 sp = static_cast<uintptr_t>(mcontext.gregs[29]); |
| 66 #else | 67 #else |
| 67 #error Unsupported architecture. | 68 #error Unsupported architecture. |
| 68 #endif // HOST_ARCH_... | 69 #endif // HOST_ARCH_... |
| 69 return sp; | 70 return sp; |
| 70 } | 71 } |
| 71 | 72 |
| 72 | 73 |
| 73 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { | 74 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { |
| 74 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) | 75 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) |
| 75 return static_cast<uintptr_t>(mcontext.regs[19]); | 76 return static_cast<uintptr_t>(mcontext.regs[SPREG]); |
| 76 #else | 77 #else |
| 77 return GetCStackPointer(mcontext); | 78 return GetCStackPointer(mcontext); |
| 78 #endif | 79 #endif |
| 79 } | 80 } |
| 80 | 81 |
| 81 | 82 |
| 82 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { | 83 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
| 83 uintptr_t lr = 0; | 84 uintptr_t lr = 0; |
| 84 | 85 |
| 85 #if defined(HOST_ARCH_IA32) | 86 #if defined(HOST_ARCH_IA32) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 sigemptyset(&act.sa_mask); | 119 sigemptyset(&act.sa_mask); |
| 119 act.sa_flags = 0; | 120 act.sa_flags = 0; |
| 120 int r = sigaction(SIGPROF, &act, NULL); | 121 int r = sigaction(SIGPROF, &act, NULL); |
| 121 ASSERT(r == 0); | 122 ASSERT(r == 0); |
| 122 } | 123 } |
| 123 | 124 |
| 124 | 125 |
| 125 } // namespace dart | 126 } // namespace dart |
| 126 | 127 |
| 127 #endif // defined(TARGET_OS_LINUX) | 128 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |