From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix linux-ia64 on SIGILL for deleted breakpoint [cleanup]
Date: Sun, 25 Jul 2010 18:55:00 -0000 [thread overview]
Message-ID: <20100725185512.GA29794@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <20100725185217.GA24476@host1.dyn.jankratochvil.net>
Hi Pedro,
add-on patch to make the code less magic a bit.
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
Tested gdb.threads/ia64-sigill.exp on ia64-rhel55-linux-gnu.
Thanks,
Jan
gdb/
2010-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (linux_nat_lp_status_is_event): New function.
(count_events_callback, select_event_lwp_callback)
(cancel_breakpoints_callback, linux_nat_wait_1): Use it.
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2617,6 +2617,20 @@ sigtrap_is_event (int status)
static int (*linux_nat_status_is_event) (int status) = sigtrap_is_event;
+/* Check for SIGTRAP-like events in LP. */
+
+static int
+linux_nat_lp_status_is_event (struct lwp_info *lp)
+{
+ /* We check for lp->waitstatus in addition to lp->status, because we can
+ have pending process exits recorded in lp->status
+ and W_EXITCODE(0,0) == 0. We should probably have an additional
+ lp->status_p flag. */
+
+ return (lp->waitstatus.kind == TARGET_WAITKIND_IGNORE
+ && linux_nat_status_is_event (lp->status));
+}
+
/* Set altarnative SIGTRAP-like events recognizer. If
breakpoint_inserted_here_p there then gdbarch_decr_pc_after_break will be
applied. */
@@ -2823,8 +2837,7 @@ count_events_callback (struct lwp_info *lp, void *data)
gdb_assert (count != NULL);
/* Count only resumed LWPs that have a SIGTRAP event pending. */
- if (lp->status != 0 && lp->resumed
- && linux_nat_status_is_event (lp->status))
+ if (lp->resumed && linux_nat_lp_status_is_event (lp))
(*count)++;
return 0;
@@ -2851,8 +2864,7 @@ select_event_lwp_callback (struct lwp_info *lp, void *data)
gdb_assert (selector != NULL);
/* Select only resumed LWPs that have a SIGTRAP event pending. */
- if (lp->status != 0 && lp->resumed
- && linux_nat_status_is_event (lp->status))
+ if (lp->resumed && linux_nat_lp_status_is_event (lp))
if ((*selector)-- == 0)
return 1;
@@ -2912,9 +2924,7 @@ cancel_breakpoints_callback (struct lwp_info *lp, void *data)
delete or disable the breakpoint, but the LWP will have already
tripped on it. */
- if (lp->waitstatus.kind == TARGET_WAITKIND_IGNORE
- && lp->status != 0
- && linux_nat_status_is_event (lp->status)
+ if (linux_nat_lp_status_is_event (lp)
&& cancel_breakpoint (lp))
/* Throw away the SIGTRAP. */
lp->status = 0;
@@ -3433,8 +3443,7 @@ retry:
always cancels breakpoint hits in all
threads. */
if (non_stop
- && lp->waitstatus.kind == TARGET_WAITKIND_IGNORE
- && linux_nat_status_is_event (lp->status)
+ && linux_nat_lp_status_is_event (lp)
&& cancel_breakpoint (lp))
{
/* Throw away the SIGTRAP. */
next prev parent reply other threads:[~2010-07-25 18:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-19 8:58 [patch] Fix linux-ia64 on SIGILL for deleted breakpoint Jan Kratochvil
2010-07-19 9:04 ` Tristan Gingold
2010-07-19 9:20 ` Jan Kratochvil
2010-07-19 9:50 ` Tristan Gingold
2010-07-20 13:29 ` Pedro Alves
2010-07-23 22:19 ` Jan Kratochvil
2010-07-24 22:26 ` Pedro Alves
2010-07-25 18:52 ` Jan Kratochvil
2010-07-25 18:55 ` Jan Kratochvil [this message]
2010-07-27 11:59 ` [patch] Fix linux-ia64 on SIGILL for deleted breakpoint [cleanup] Pedro Alves
2010-07-27 21:22 ` Jan Kratochvil
2010-07-27 11:43 ` [patch] Fix linux-ia64 on SIGILL for deleted breakpoint Pedro Alves
2010-07-27 20:55 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100725185512.GA29794@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox