Check if the system have restrictions to attach to other processes or other hardening measures, check sysctl settings such as; kernel.yama.ptrace_scope;
Before debug;
# echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # sysctl -w kernel.yama.ptrace_scope=0
After debug;
# echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope # sysctl -w kernel.yama.ptrace_scope=1
If the program needs arguments you can set it;
(gdb)set args -parameter1 -parameter2
To start gdb in TUI mode press;
(gdb) info win (gdb) fs next (gdb) fs SRC
b - backtrace info locals display print x catch syscall open
When new thread is created you receive a notification. To get information about threads;
info threads
To select thread;
thread 1
break linespec thread threadno
$ strace -c ./program -o ~/program.strace
$ strace -p 1337 -o ~/program.strace
C program with autotools GDB Quick Start, Learning C with GDB and Memory Layout and the Stack are great sources of introductory information. Stopping and Starting multi-thread programs
C IndexThis is part of the Hive System Documentation. Copyright (C) 2019 Hive Team. See the file Gnu Free Documentation License for copying conditions.