OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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) | 7 #if defined(OS_POSIX) |
8 #include <signal.h> // For SigUSR1Handler below. | 8 #include <signal.h> // For SigUSR1Handler below. |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 title += label; // makes attaching to process easier | 89 title += label; // makes attaching to process easier |
90 std::string message = label; | 90 std::string message = label; |
91 message += " starting with pid: "; | 91 message += " starting with pid: "; |
92 message += base::IntToString(base::GetCurrentProcId()); | 92 message += base::IntToString(base::GetCurrentProcId()); |
93 ::MessageBox(NULL, UTF8ToWide(message).c_str(), UTF8ToWide(title).c_str(), | 93 ::MessageBox(NULL, UTF8ToWide(message).c_str(), UTF8ToWide(title).c_str(), |
94 MB_OK | MB_SETFOREGROUND); | 94 MB_OK | MB_SETFOREGROUND); |
95 #elif defined(OS_POSIX) | 95 #elif defined(OS_POSIX) |
96 // TODO(playmobil): In the long term, overriding this flag doesn't seem | 96 // TODO(playmobil): In the long term, overriding this flag doesn't seem |
97 // right, either use our own flag or open a dialog we can use. | 97 // right, either use our own flag or open a dialog we can use. |
98 // This is just to ease debugging in the interim. | 98 // This is just to ease debugging in the interim. |
99 LOG(ERROR) << label | 99 DLOG(ERROR) << label |
100 << " (" | 100 << " (" |
101 << getpid() | 101 << getpid() |
102 << ") paused waiting for debugger to attach @ pid"; | 102 << ") paused waiting for debugger to attach @ pid"; |
103 // Install a signal handler so that pause can be woken. | 103 // Install a signal handler so that pause can be woken. |
104 struct sigaction sa; | 104 struct sigaction sa; |
105 memset(&sa, 0, sizeof(sa)); | 105 memset(&sa, 0, sizeof(sa)); |
106 sa.sa_handler = SigUSR1Handler; | 106 sa.sa_handler = SigUSR1Handler; |
107 sigaction(SIGUSR1, &sa, NULL); | 107 sigaction(SIGUSR1, &sa, NULL); |
108 | 108 |
109 pause(); | 109 pause(); |
110 #endif // defined(OS_POSIX) | 110 #endif // defined(OS_POSIX) |
111 } | 111 } |
OLD | NEW |