This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. c4d9ceb6473237e614c66be97351109b9f260505
- From: qiyao at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 23 Sep 2014 12:55:11 -0000
- Subject: gdb and binutils branch master updated. c4d9ceb6473237e614c66be97351109b9f260505
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via c4d9ceb6473237e614c66be97351109b9f260505 (commit)
from 302717ccee079c09f7ca436853a5b9229f945b2d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c4d9ceb6473237e614c66be97351109b9f260505
commit c4d9ceb6473237e614c66be97351109b9f260505
Author: Yao Qi <yao@codesourcery.com>
Date: Fri Sep 12 13:35:11 2014 +0800
Honour SIGILL and SIGSEGV in cancel breakpoint and event lwp selection
I see the following fail on arm-none-linux-gnueabi testing,
(gdb) continue^M
Continuing.^M
^M
Program received signal SIGILL, Illegal instruction.^M
[Switching to Thread 1003]^M
handler (signo=10) at
/scratch/yqi/arm-none-linux-gnueabi/src/gdb-trunk/gdb/testsuite/gdb.threads/sigstep-threads.c:33^M
33 tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */^M
(gdb) FAIL: gdb.threads/sigstep-threads.exp: continue
the cause is that GDBserver doesn't cancel the breakpoint if the stop
signal is SIGILL. The kernel used here is a little old, 2.6.x, and
doesn't translate SIGILL to SIGTRAP when program hits breakpoint
instruction (which is an illegal instruction actually). GDB and
GDBserver can translate SIGILL to SIGTRAP under certain circumstance,
so it is not a problem here. See gdbserver/linux-low.c:linux_wait_1
/* If this event was not handled before, and is not a SIGTRAP, we
report it. SIGILL and SIGSEGV are also treated as traps in case
a breakpoint is inserted at the current PC. If this target does
not support internal breakpoints at all, we also report the
SIGTRAP without further processing; it's of no concern to us. */
maybe_internal_trap
= (supports_breakpoints ()
&& (WSTOPSIG (w) == SIGTRAP
|| ((WSTOPSIG (w) == SIGILL
|| WSTOPSIG (w) == SIGSEGV)
&& (*the_low_target.breakpoint_at) (event_child->stop_pc))));
However, SIGILL and SIGSEGV is not considered when cancelling
breakpoint, which causes the fail above. That is, when GDB is doing
software single step on address ADDR, both thread A and thread B hits the
software single step breakpoint, and get SIGILL. GDB selects the event
from thread A, removes the software single step breakpoint, and resume
the program. The event (SIGILL) from thread B is reported to GDB, but
GDB doesn't regard this SIGILL as SIGTRAP, because the breakpoint on
address ADDR was removed, so GDB reports "Program received signal
SIGILL".
The patch is to allow calling cancel_breakpoint if the signal is
SIGILL and SIGSEGV. This patch fixes the fail above. Likewise, event
lwp selection should honour SIGILL and SIGSEGV too.
gdb/gdbserver:
2014-09-23 Yao Qi <yao@codesourcery.com>
* linux-low.c (lp_status_maybe_breakpoint): New function.
(linux_low_filter_event): Call lp_status_maybe_breakpoint.
(count_events_callback): Likewise.
(select_event_lwp_callback): Likewise.
(cancel_breakpoints_callback): Likewise.
-----------------------------------------------------------------------
Summary of changes:
gdb/gdbserver/ChangeLog | 8 ++++++++
gdb/gdbserver/linux-low.c | 28 ++++++++++++++++++----------
2 files changed, 26 insertions(+), 10 deletions(-)
hooks/post-receive
--
gdb and binutils