After installing Redhat 7 (2.2.16-22) from CD I have tried to use gdb to debug my programs. I have seen the following behavior: a) attach does not work at all: I'm trying to debug a server which creates multiple threads and multiple lightweight processes (LWPs), I am unable to attach to the other newly created existing LWP (I can see the processes on ps) and I get the following error message: [New Thread 1026 (LWP 25643)] ... [stuff deleted] ... (gdb) atta 25643 Attaching to program: /solid/solid-ldap-0.20/servers/slapd/slapd, Pid 25643 ptrace: Operation not permitted. If I attach to another random process (I tried with pine and bash processes), it works fine and 'where' shows me the stack trace of the process I tried to access earlier. b) when tracing simple single-process programs, the stepping through (s) does not print properly where it is at times. it sometimes goes through two function calls and then goes through them again, and sometimes it even seems to skip some function calls.
Can you try the one currently in Rawhide?
a) attach does not work at all: Is slapd running as root? If so, gdb must also be run as root in order to attach to it. (Permissions problem) b) when tracing simple single-process programs, the stepping through (s) does not print properly where it is at times Are you debugging a process that was compiled with optimization turned on (-O...)? Debugging optimized code can cause this. If not, can you supply an example program?a) attach does not work at all: Is slapd running as root? If so, gdb must also be run as root in order to attach to it. (Permissions problem) b) when tracing simple single-process programs, the stepping through (s) does not print properly where it is at times Are you debugging a process that was compiled with optimization turned on (-O...)? Debugging optimized code can cause this. If not, can you supply an example program?