Aja alla oleva komento ennen debuggausta, niin debuggeri toimii
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
A PTRACE scope of "0" is the more permissive mode. A scope of "1" limits
PTRACE only to direct child processes (e.g. "gdb name-of-program" and
"strace -f name-of-program" work, but gdb's "attach" and "strace -fp $PID"
do not). The PTRACE scope is ignored when a user has CAP_SYS_PTRACE, so
"sudo strace -fp $PID" will work as before. For more details see:
https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace
#projektitiedosto TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt SOURCES += main.cpp #lähdekoodi #include <iostream> using namespace std; /* * * Aja alla oleva komento ennen debuggausta, niin debuggeri toimii echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope A PTRACE scope of "0" is the more permissive mode. A scope of "1" limits PTRACE only to direct child processes (e.g. "gdb name-of-program" and "strace -f name-of-program" work, but gdb's "attach" and "strace -fp $PID" do not). The PTRACE scope is ignored when a user has CAP_SYS_PTRACE, so "sudo strace -fp $PID" will work as before. For more details see: https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace */ int main() { int a=0; cin >> a; cout << "Hello World!" << endl; return 0; }