MCPcopy Create free account
hub / github.com/apache/brpc / WaitForDebugger

Function WaitForDebugger

src/butil/debug/debugger.cc:14–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12static bool is_debug_ui_suppressed = false;
13
14bool WaitForDebugger(int wait_seconds, bool silent) {
15#if defined(OS_ANDROID)
16 // The pid from which we know which process to attach to are not output by
17 // android ddms, so we have to print it out explicitly.
18 DLOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid())
19 << ")";
20#endif
21 for (int i = 0; i < wait_seconds * 10; ++i) {
22 if (BeingDebugged()) {
23 if (!silent)
24 BreakDebugger();
25 return true;
26 }
27 PlatformThread::Sleep(TimeDelta::FromMilliseconds(100));
28 }
29 return false;
30}
31
32void SetSuppressDebugUI(bool suppress) {
33 is_debug_ui_suppressed = suppress;

Callers

nothing calls this directly

Calls 2

BeingDebuggedFunction · 0.85
BreakDebuggerFunction · 0.85

Tested by

no test coverage detected