| 56 | } |
| 57 | |
| 58 | bool 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 | |
| 76 | int breakpointMiLine(const Breakpoint* breakpoint) |
| 77 | { |