OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/child_process.h" | 5 #include "content/common/child_process.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 7 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
8 #include <signal.h> // For SigUSR1Handler below. | 8 #include <signal.h> // For SigUSR1Handler below. |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 LOG(ERROR) << label << " waiting for GDB."; | 126 LOG(ERROR) << label << " waiting for GDB."; |
127 // Wait 24 hours for a debugger to be attached to the current process. | 127 // Wait 24 hours for a debugger to be attached to the current process. |
128 base::debug::WaitForDebugger(24 * 60 * 60, false); | 128 base::debug::WaitForDebugger(24 * 60 * 60, false); |
129 #else | 129 #else |
130 // TODO(playmobil): In the long term, overriding this flag doesn't seem | 130 // TODO(playmobil): In the long term, overriding this flag doesn't seem |
131 // right, either use our own flag or open a dialog we can use. | 131 // right, either use our own flag or open a dialog we can use. |
132 // This is just to ease debugging in the interim. | 132 // This is just to ease debugging in the interim. |
133 LOG(ERROR) << label | 133 LOG(ERROR) << label |
134 << " (" | 134 << " (" |
135 << getpid() | 135 << getpid() |
136 << ") paused waiting for debugger to attach @ pid"; | 136 << ") paused waiting for debugger to attach. " |
| 137 << "Send SIGUSR1 to unpause."; |
137 // Install a signal handler so that pause can be woken. | 138 // Install a signal handler so that pause can be woken. |
138 struct sigaction sa; | 139 struct sigaction sa; |
139 memset(&sa, 0, sizeof(sa)); | 140 memset(&sa, 0, sizeof(sa)); |
140 sa.sa_handler = SigUSR1Handler; | 141 sa.sa_handler = SigUSR1Handler; |
141 sigaction(SIGUSR1, &sa, NULL); | 142 sigaction(SIGUSR1, &sa, NULL); |
142 | 143 |
143 pause(); | 144 pause(); |
144 #endif // defined(OS_ANDROID) | 145 #endif // defined(OS_ANDROID) |
145 #endif // defined(OS_POSIX) | 146 #endif // defined(OS_POSIX) |
146 } | 147 } |
147 | 148 |
148 } // namespace content | 149 } // namespace content |
OLD | NEW |