40 # include <sys/sysctl.h>
41 # include <sys/types.h>
45 using namespace Utils;
51 GetNativeSystemInfo(&info);
52 switch (info.wProcessorArchitecture) {
53 case PROCESSOR_ARCHITECTURE_AMD64:
55 case PROCESSOR_ARCHITECTURE_INTEL:
57 case PROCESSOR_ARCHITECTURE_IA64:
59 case PROCESSOR_ARCHITECTURE_ARM:
76 int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()};
77 struct kinfo_proc info;
78 memset(&info, 0,
sizeof(info));
81 size_t size =
sizeof(info);
82 if (sysctl(mib,
sizeof(mib) /
sizeof(*mib), &info, &size, NULL, 0) != 0) {
83 qWarning() <<
"sysctl failed!";
87 return (info.kp_proc.p_flag & P_TRACED) != 0;
88 #elif defined(Q_OS_WIN)
89 return IsDebuggerPresent();
91 qWarning() <<
"debuggerPresent not implemented!";
static HostArchitecture hostArchitecture()
static bool debuggerPresent()
Is debugger connected to this process?