MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / isDebuggerAttached

Function isDebuggerAttached

Tests/Libraries/Await/AwaitTest.cpp:26–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24{
25#if SC_PLATFORM_APPLE
26static bool isDebuggerAttached()
27{
28 int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, static_cast<int>(::getpid())};
29 struct kinfo_proc info = {};
30 size_t size = sizeof(info);
31 if (::sysctl(mib, 4, &info, &size, nullptr, 0) != 0)
32 {
33 return false;
34 }
35 return (info.kp_proc.p_flag & P_TRACED) != 0;
36}
37#endif
38} // namespace
39

Callers 1

signalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected