Elliott Hughes | 2faa5f1 | 2012-01-30 14:42:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 16 | |
| 17 | #include "runtime.h" |
| 18 | |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 19 | #include <signal.h> |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 20 | #include <string.h> |
Elliott Hughes | 058a6de | 2012-05-24 19:13:02 -0700 | [diff] [blame] | 21 | #include <sys/utsname.h> |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 22 | |
Elliott Hughes | 07ed66b | 2012-12-12 18:34:25 -0800 | [diff] [blame^] | 23 | #include "base/logging.h" |
Elliott Hughes | 76b6167 | 2012-12-12 17:47:30 -0800 | [diff] [blame] | 24 | #include "base/mutex.h" |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 25 | #include "stringprintf.h" |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 26 | #include "thread.h" |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 27 | #include "utils.h" |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 28 | |
| 29 | namespace art { |
| 30 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 31 | struct Backtrace { |
| 32 | void Dump(std::ostream& os) { |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 33 | DumpNativeStack(os, GetTid(), "\t", true); |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 34 | } |
| 35 | }; |
| 36 | |
Elliott Hughes | 7616005 | 2012-12-12 16:31:20 -0800 | [diff] [blame] | 37 | struct OsInfo { |
Elliott Hughes | 058a6de | 2012-05-24 19:13:02 -0700 | [diff] [blame] | 38 | void Dump(std::ostream& os) { |
| 39 | utsname info; |
| 40 | uname(&info); |
| 41 | // Linux 2.6.38.8-gg784 (x86_64) |
| 42 | // Darwin 11.4.0 (x86_64) |
| 43 | os << info.sysname << " " << info.release << " (" << info.machine << ")"; |
| 44 | } |
| 45 | }; |
| 46 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 47 | static const char* GetSignalName(int signal_number) { |
| 48 | switch (signal_number) { |
| 49 | case SIGABRT: return "SIGABRT"; |
| 50 | case SIGBUS: return "SIGBUS"; |
| 51 | case SIGFPE: return "SIGFPE"; |
| 52 | case SIGILL: return "SIGILL"; |
| 53 | case SIGPIPE: return "SIGPIPE"; |
| 54 | case SIGSEGV: return "SIGSEGV"; |
Elliott Hughes | 833770b | 2012-05-01 15:41:03 -0700 | [diff] [blame] | 55 | #if defined(SIGSTKFLT) |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 56 | case SIGSTKFLT: return "SIGSTKFLT"; |
| 57 | #endif |
| 58 | case SIGTRAP: return "SIGTRAP"; |
| 59 | } |
| 60 | return "??"; |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 61 | } |
| 62 | |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 63 | static const char* GetSignalCodeName(int signal_number, int signal_code) { |
| 64 | // Try the signal-specific codes... |
| 65 | switch (signal_number) { |
| 66 | case SIGILL: |
| 67 | switch (signal_code) { |
| 68 | case ILL_ILLOPC: return "ILL_ILLOPC"; |
| 69 | case ILL_ILLOPN: return "ILL_ILLOPN"; |
| 70 | case ILL_ILLADR: return "ILL_ILLADR"; |
| 71 | case ILL_ILLTRP: return "ILL_ILLTRP"; |
| 72 | case ILL_PRVOPC: return "ILL_PRVOPC"; |
| 73 | case ILL_PRVREG: return "ILL_PRVREG"; |
| 74 | case ILL_COPROC: return "ILL_COPROC"; |
| 75 | case ILL_BADSTK: return "ILL_BADSTK"; |
| 76 | } |
| 77 | break; |
| 78 | case SIGBUS: |
| 79 | switch (signal_code) { |
| 80 | case BUS_ADRALN: return "BUS_ADRALN"; |
| 81 | case BUS_ADRERR: return "BUS_ADRERR"; |
| 82 | case BUS_OBJERR: return "BUS_OBJERR"; |
| 83 | } |
| 84 | break; |
| 85 | case SIGFPE: |
| 86 | switch (signal_code) { |
| 87 | case FPE_INTDIV: return "FPE_INTDIV"; |
| 88 | case FPE_INTOVF: return "FPE_INTOVF"; |
| 89 | case FPE_FLTDIV: return "FPE_FLTDIV"; |
| 90 | case FPE_FLTOVF: return "FPE_FLTOVF"; |
| 91 | case FPE_FLTUND: return "FPE_FLTUND"; |
| 92 | case FPE_FLTRES: return "FPE_FLTRES"; |
| 93 | case FPE_FLTINV: return "FPE_FLTINV"; |
| 94 | case FPE_FLTSUB: return "FPE_FLTSUB"; |
| 95 | } |
| 96 | break; |
| 97 | case SIGSEGV: |
| 98 | switch (signal_code) { |
| 99 | case SEGV_MAPERR: return "SEGV_MAPERR"; |
| 100 | case SEGV_ACCERR: return "SEGV_ACCERR"; |
| 101 | } |
| 102 | break; |
| 103 | case SIGTRAP: |
| 104 | switch (signal_code) { |
| 105 | case TRAP_BRKPT: return "TRAP_BRKPT"; |
| 106 | case TRAP_TRACE: return "TRAP_TRACE"; |
| 107 | } |
| 108 | break; |
| 109 | } |
| 110 | // Then the other codes... |
| 111 | switch (signal_code) { |
| 112 | case SI_USER: return "SI_USER"; |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 113 | #if defined(SI_KERNEL) |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 114 | case SI_KERNEL: return "SI_KERNEL"; |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 115 | #endif |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 116 | case SI_QUEUE: return "SI_QUEUE"; |
| 117 | case SI_TIMER: return "SI_TIMER"; |
| 118 | case SI_MESGQ: return "SI_MESGQ"; |
| 119 | case SI_ASYNCIO: return "SI_ASYNCIO"; |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 120 | #if defined(SI_SIGIO) |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 121 | case SI_SIGIO: return "SI_SIGIO"; |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 122 | #endif |
| 123 | #if defined(SI_TKILL) |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 124 | case SI_TKILL: return "SI_TKILL"; |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 125 | #endif |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 126 | } |
| 127 | // Then give up... |
| 128 | return "?"; |
| 129 | } |
| 130 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 131 | struct UContext { |
Elliott Hughes | 7484741 | 2012-06-20 18:10:21 -0700 | [diff] [blame] | 132 | explicit UContext(void* raw_context) : context(reinterpret_cast<ucontext_t*>(raw_context)->uc_mcontext) {} |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 133 | |
| 134 | void Dump(std::ostream& os) { |
| 135 | // TODO: support non-x86 hosts (not urgent because this code doesn't run on targets). |
| 136 | #if defined(__APPLE__) |
| 137 | DumpRegister32(os, "eax", context->__ss.__eax); |
| 138 | DumpRegister32(os, "ebx", context->__ss.__ebx); |
| 139 | DumpRegister32(os, "ecx", context->__ss.__ecx); |
| 140 | DumpRegister32(os, "edx", context->__ss.__edx); |
| 141 | os << '\n'; |
| 142 | |
| 143 | DumpRegister32(os, "edi", context->__ss.__edi); |
| 144 | DumpRegister32(os, "esi", context->__ss.__esi); |
| 145 | DumpRegister32(os, "ebp", context->__ss.__ebp); |
| 146 | DumpRegister32(os, "esp", context->__ss.__esp); |
| 147 | os << '\n'; |
| 148 | |
| 149 | DumpRegister32(os, "eip", context->__ss.__eip); |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 150 | os << " "; |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 151 | DumpRegister32(os, "eflags", context->__ss.__eflags); |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 152 | DumpX86Flags(os, context->__ss.__eflags); |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 153 | os << '\n'; |
| 154 | |
| 155 | DumpRegister32(os, "cs", context->__ss.__cs); |
| 156 | DumpRegister32(os, "ds", context->__ss.__ds); |
| 157 | DumpRegister32(os, "es", context->__ss.__es); |
| 158 | DumpRegister32(os, "fs", context->__ss.__fs); |
| 159 | os << '\n'; |
| 160 | DumpRegister32(os, "gs", context->__ss.__gs); |
| 161 | DumpRegister32(os, "ss", context->__ss.__ss); |
| 162 | #else |
| 163 | DumpRegister32(os, "eax", context.gregs[REG_EAX]); |
| 164 | DumpRegister32(os, "ebx", context.gregs[REG_EBX]); |
| 165 | DumpRegister32(os, "ecx", context.gregs[REG_ECX]); |
| 166 | DumpRegister32(os, "edx", context.gregs[REG_EDX]); |
| 167 | os << '\n'; |
| 168 | |
| 169 | DumpRegister32(os, "edi", context.gregs[REG_EDI]); |
| 170 | DumpRegister32(os, "esi", context.gregs[REG_ESI]); |
| 171 | DumpRegister32(os, "ebp", context.gregs[REG_EBP]); |
| 172 | DumpRegister32(os, "esp", context.gregs[REG_ESP]); |
| 173 | os << '\n'; |
| 174 | |
| 175 | DumpRegister32(os, "eip", context.gregs[REG_EIP]); |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 176 | os << " "; |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 177 | DumpRegister32(os, "eflags", context.gregs[REG_EFL]); |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 178 | DumpX86Flags(os, context.gregs[REG_EFL]); |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 179 | os << '\n'; |
| 180 | |
| 181 | DumpRegister32(os, "cs", context.gregs[REG_CS]); |
| 182 | DumpRegister32(os, "ds", context.gregs[REG_DS]); |
| 183 | DumpRegister32(os, "es", context.gregs[REG_ES]); |
| 184 | DumpRegister32(os, "fs", context.gregs[REG_FS]); |
| 185 | os << '\n'; |
| 186 | DumpRegister32(os, "gs", context.gregs[REG_GS]); |
| 187 | DumpRegister32(os, "ss", context.gregs[REG_SS]); |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 188 | #endif |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 189 | } |
| 190 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 191 | void DumpRegister32(std::ostream& os, const char* name, uint32_t value) { |
| 192 | os << StringPrintf(" %6s: 0x%08x", name, value); |
| 193 | } |
| 194 | |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 195 | void DumpX86Flags(std::ostream& os, uint32_t flags) { |
| 196 | os << " ["; |
| 197 | if ((flags & (1 << 0)) != 0) { |
| 198 | os << " CF"; |
| 199 | } |
| 200 | if ((flags & (1 << 2)) != 0) { |
| 201 | os << " PF"; |
| 202 | } |
| 203 | if ((flags & (1 << 4)) != 0) { |
| 204 | os << " AF"; |
| 205 | } |
| 206 | if ((flags & (1 << 6)) != 0) { |
| 207 | os << " ZF"; |
| 208 | } |
| 209 | if ((flags & (1 << 7)) != 0) { |
| 210 | os << " SF"; |
| 211 | } |
| 212 | if ((flags & (1 << 8)) != 0) { |
| 213 | os << " TF"; |
| 214 | } |
| 215 | if ((flags & (1 << 9)) != 0) { |
| 216 | os << " IF"; |
| 217 | } |
| 218 | if ((flags & (1 << 10)) != 0) { |
| 219 | os << " DF"; |
| 220 | } |
| 221 | if ((flags & (1 << 11)) != 0) { |
| 222 | os << " OF"; |
| 223 | } |
| 224 | os << " ]"; |
| 225 | } |
| 226 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 227 | mcontext_t& context; |
| 228 | }; |
| 229 | |
Brian Carlstrom | af1b892 | 2012-11-27 15:19:57 -0800 | [diff] [blame] | 230 | void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_context) { |
| 231 | static bool handlingUnexpectedSignal = false; |
| 232 | if (handlingUnexpectedSignal) { |
| 233 | LogMessageData data(__FILE__, __LINE__, INTERNAL_FATAL, -1); |
| 234 | LogMessage::LogLine(data, "HandleUnexpectedSignal reentered\n"); |
| 235 | _exit(1); |
| 236 | } |
| 237 | handlingUnexpectedSignal = true; |
| 238 | |
Brian Carlstrom | 81b8871 | 2012-11-05 19:21:30 -0800 | [diff] [blame] | 239 | gAborting = true; // set before taking any locks |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 240 | MutexLock mu(Thread::Current(), *Locks::unexpected_signal_lock_); |
Elliott Hughes | d06a6c7 | 2012-05-30 17:59:06 -0700 | [diff] [blame] | 241 | |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 242 | bool has_address = (signal_number == SIGILL || signal_number == SIGBUS || |
| 243 | signal_number == SIGFPE || signal_number == SIGSEGV); |
| 244 | |
Elliott Hughes | 7616005 | 2012-12-12 16:31:20 -0800 | [diff] [blame] | 245 | OsInfo os_info; |
Elliott Hughes | 98eedd8 | 2012-06-11 17:52:56 -0700 | [diff] [blame] | 246 | const char* cmd_line = GetCmdLine(); |
| 247 | if (cmd_line == NULL) { |
Elliott Hughes | 289be85 | 2012-06-12 13:57:20 -0700 | [diff] [blame] | 248 | cmd_line = "<unset>"; // Because no-one called InitLogging. |
Elliott Hughes | 98eedd8 | 2012-06-11 17:52:56 -0700 | [diff] [blame] | 249 | } |
Elliott Hughes | 289be85 | 2012-06-12 13:57:20 -0700 | [diff] [blame] | 250 | pid_t tid = GetTid(); |
| 251 | std::string thread_name(GetThreadName(tid)); |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 252 | UContext thread_context(raw_context); |
| 253 | Backtrace thread_backtrace; |
Elliott Hughes | 8593fdb | 2012-04-21 20:53:44 -0700 | [diff] [blame] | 254 | |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 255 | LOG(INTERNAL_FATAL) << "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n" |
| 256 | << StringPrintf("Fatal signal %d (%s), code %d (%s)", |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 257 | signal_number, GetSignalName(signal_number), |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 258 | info->si_code, |
| 259 | GetSignalCodeName(signal_number, info->si_code)) |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 260 | << (has_address ? StringPrintf(" fault addr %p", info->si_addr) : "") << "\n" |
Elliott Hughes | 7616005 | 2012-12-12 16:31:20 -0800 | [diff] [blame] | 261 | << "OS: " << Dumpable<OsInfo>(os_info) << "\n" |
Elliott Hughes | 98eedd8 | 2012-06-11 17:52:56 -0700 | [diff] [blame] | 262 | << "Cmdline: " << cmd_line << "\n" |
Elliott Hughes | 289be85 | 2012-06-12 13:57:20 -0700 | [diff] [blame] | 263 | << "Thread: " << tid << " \"" << thread_name << "\"\n" |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 264 | << "Registers:\n" << Dumpable<UContext>(thread_context) << "\n" |
| 265 | << "Backtrace:\n" << Dumpable<Backtrace>(thread_backtrace); |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 266 | |
Elliott Hughes | 4909ba4 | 2012-06-14 13:33:49 -0700 | [diff] [blame] | 267 | if (getenv("debug_db_uid") != NULL || getenv("art_wait_for_gdb_on_crash") != NULL) { |
Elliott Hughes | 2554cb9 | 2012-04-18 17:19:26 -0700 | [diff] [blame] | 268 | LOG(INTERNAL_FATAL) << "********************************************************\n" |
Elliott Hughes | 289be85 | 2012-06-12 13:57:20 -0700 | [diff] [blame] | 269 | << "* Process " << getpid() << " thread " << tid << " \"" << thread_name << "\"" |
| 270 | << " has been suspended while crashing.\n" |
| 271 | << "* Attach gdb:\n" |
| 272 | << "* gdb -p " << tid << "\n" |
Elliott Hughes | 2554cb9 | 2012-04-18 17:19:26 -0700 | [diff] [blame] | 273 | << "********************************************************\n"; |
| 274 | // Wait for debugger to attach. |
| 275 | while (true) { |
| 276 | } |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 277 | } |
Elliott Hughes | d06a6c7 | 2012-05-30 17:59:06 -0700 | [diff] [blame] | 278 | |
| 279 | // Remove our signal handler for this signal... |
| 280 | struct sigaction action; |
| 281 | memset(&action, 0, sizeof(action)); |
| 282 | sigemptyset(&action.sa_mask); |
| 283 | action.sa_handler = SIG_DFL; |
| 284 | sigaction(signal_number, &action, NULL); |
| 285 | // ...and re-raise so we die with the appropriate status. |
| 286 | kill(getpid(), signal_number); |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 289 | void Runtime::InitPlatformSignalHandlers() { |
| 290 | // On the host, we don't have debuggerd to dump a stack for us when something unexpected happens. |
| 291 | struct sigaction action; |
| 292 | memset(&action, 0, sizeof(action)); |
| 293 | sigemptyset(&action.sa_mask); |
| 294 | action.sa_sigaction = HandleUnexpectedSignal; |
Elliott Hughes | 6c1c69e | 2012-04-23 16:12:51 -0700 | [diff] [blame] | 295 | // Use the three-argument sa_sigaction handler. |
| 296 | action.sa_flags |= SA_SIGINFO; |
Elliott Hughes | d06a6c7 | 2012-05-30 17:59:06 -0700 | [diff] [blame] | 297 | // Use the alternate signal stack so we can catch stack overflows. |
| 298 | action.sa_flags |= SA_ONSTACK; |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 299 | |
| 300 | int rc = 0; |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 301 | rc += sigaction(SIGABRT, &action, NULL); |
| 302 | rc += sigaction(SIGBUS, &action, NULL); |
| 303 | rc += sigaction(SIGFPE, &action, NULL); |
Elliott Hughes | 058a6de | 2012-05-24 19:13:02 -0700 | [diff] [blame] | 304 | rc += sigaction(SIGILL, &action, NULL); |
| 305 | rc += sigaction(SIGPIPE, &action, NULL); |
| 306 | rc += sigaction(SIGSEGV, &action, NULL); |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 307 | #if defined(SIGSTKFLT) |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 308 | rc += sigaction(SIGSTKFLT, &action, NULL); |
Elliott Hughes | ac8097f | 2012-04-16 14:59:44 -0700 | [diff] [blame] | 309 | #endif |
Elliott Hughes | 058a6de | 2012-05-24 19:13:02 -0700 | [diff] [blame] | 310 | rc += sigaction(SIGTRAP, &action, NULL); |
Elliott Hughes | 457005c | 2012-04-16 13:54:25 -0700 | [diff] [blame] | 311 | CHECK_EQ(rc, 0); |
| 312 | } |
| 313 | |
Elliott Hughes | ffe6736 | 2011-07-17 12:09:27 -0700 | [diff] [blame] | 314 | } // namespace art |