Comment 1 for bug 615978

Revision history for this message
Yao Qi (yao-codesourcery) wrote : Re: Debug info for arguments of varargs routines

Here are the minimal steps to reproduce two failures in annota3.exp,

1. Fire gdb, and set breakpoints on main, handle_USR1 and printf,
$ ./gdb testsuite/gdb.base/annota3
(gdb) b main
(gdb) b handle_USR1
(gdb) b printf

2. Run and continue to breakpoint on printf. Now signal handler (handle_USR1) has been installed.
(gdb) run
Starting program: /home/yao/maverick/home/yao/git/build/gdb/testsuite/gdb.base/annota3
Breakpoint 1, main () at ../../../gdb/gdb/testsuite/gdb.base/annota3.c:32
32 int my_array[3] = { 1, 2, 3 };
(gdb) c
Continuing.
Breakpoint 3, 0x400d4516 in printf () from /lib/libc.so.6

3. Sent signal SIGUSR1 to child, and the expected behavior of GDB stops at function handle_USR1. Unfortunately, GDB stops at printf.
(gdb) signal SIGUSR1
Breakpoint 3, 0x400d4516 in printf () from /lib/libc.so.6

Some debug message is shown below,

infrun: clear_proceed_status_thread (process 16469)
infrun: proceed (addr=0xffffffff, signal=30, step=0)
infrun: resume (step=1, signal=30), trap_expected=1 // <-- [1]
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
infrun: target_wait (-1, status) =
infrun: 16469 [process 16469],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400d4518
infrun: software single step trap for process 16469
infrun: no stepping, continue
infrun: resume (step=0, signal=0), trap_expected=0
value is 7
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 16469 [process 16469],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400d4516
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping

GDB does a software single step on [1] with signal 30, but seems kernel doesn't deliver this signal to child, so that breakpoint on signal handler is not hit. This is same as LP:649121.