My test case is so simple that I must be doing something very stupid. I wrote a simple source file test.c
:
#include
int main(int
(curated from comments)
You do not appear do be doing anything wrong; It appears to be GDB's fault.
The message During startup program exited normally.
is anomalous, the correct one being Program exited normally.
. It suggests GDB failed to insert a breakpoint in main()
or the traced program's call to ptrace(PT_TRACE_ME, 0, 0, 0)
failed. The program thus ran without being stopped, and it exited while GDB was only expecting it to start up and stop at exec()
. Can you run gdb
under strace
while doing your example and grep
strace
's log for any failed ptrace
calls?
You would do so with strace -f -o syscall.txt gdb ./a.out
.
As of right now a stop-gap measure appears to be to run GDB as root.