Failure to software single-step into signal handler
Bug #615978 reported by
Ulrich Weigand
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GDB |
Fix Released
|
Medium
|
Ulrich Weigand |
Bug Description
GDB is unable to correctly find the location of fixed argument in routines having variable argument lists. This seems to be related to an issue with correctly accounting for the vararg save area in the stack frame when computing stack offsets. At this point, I'm not sure whether this is a GCC or GDB bug.
GDB testsuite failures related to this bug include:
FAIL: gdb.base/
FAIL: gdb.base/
FAIL: gdb.base/
FAIL: gdb.base/
Related branches
lp:gdb-linaro/7.2
(Merged)
Changed in gdb-linaro: | |
importance: | Undecided → Medium |
tags: | added: testsuite |
Changed in gdb-linaro: | |
assignee: | nobody → Ulrich Weigand (uweigand) |
status: | Confirmed → In Progress |
Changed in gdb-linaro: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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.base/ annota3
$ ./gdb testsuite/
(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. maverick/ home/yao/ git/build/ gdb/testsuite/ gdb.base/ annota3 ./gdb/gdb/ testsuite/ gdb.base/ annota3. c:32
(gdb) run
Starting program: /home/yao/
Breakpoint 1, main () at ../../.
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) exec_as_ sigtrap= 0) normal_ state WAITKIND_ STOPPED normal_ state WAITKIND_ STOPPED WHAT_STOP_ NOISY
infrun: proceed (addr=0xffffffff, signal=30, step=0)
infrun: resume (step=1, signal=30), trap_expected=1 // <-- [1]
infrun: wait_for_inferior (treat_
infrun: target_wait (-1, status) =
infrun: 16469 [process 16469],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_
infrun: TARGET_
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_
infrun: TARGET_
infrun: stop_pc = 0x400d4516
infrun: BPSTAT_
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.