MCPcopy Create free account
hub / github.com/KDE/kdevelop / isAttachForbidden

Function isAttachForbidden

plugins/debuggercommon/tests/testhelper.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool isAttachForbidden(const char *file, int line)
59{
60 // if on linux, ensure we can actually attach
61 QFile canRun(QStringLiteral("/proc/sys/kernel/yama/ptrace_scope"));
62 if (canRun.exists()) {
63 if (!canRun.open(QIODevice::ReadOnly)) {
64 QTest::qFail("Something is wrong: /proc/sys/kernel/yama/ptrace_scope exists but cannot be read", file, line);
65 return true;
66 }
67 if (canRun.read(1).toInt() != 0) {
68 QTest::qSkip("ptrace attaching not allowed, skipping test. To enable it, set /proc/sys/kernel/yama/ptrace_scope to 0.", file, line);
69 return true;
70 }
71 }
72
73 return false;
74}
75
76int breakpointMiLine(const Breakpoint* breakpoint)
77{

Callers

nothing calls this directly

Calls 4

existsMethod · 0.80
toIntMethod · 0.80
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected