Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [gdbserver] Fix attaching notices
Date: Fri, 11 Jul 2008 17:12:00 -0000	[thread overview]
Message-ID: <200807111812.02067.pedro@codesourcery.com> (raw)
In-Reply-To: <20080711141326.GA5455@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

A Friday 11 July 2008 15:13:26, Daniel Jacobowitz wrote:
> On Tue, Jul 08, 2008 at 02:58:33AM +0100, Pedro Alves wrote:

> > 2) change the test to:
> >
> >       if (stop_soon == STOP_QUIETLY_NO_SIGSTOP
> > 	  && stop_signal == TARGET_SIGNAL_STOP
> > 	  && stop_signal == TARGET_SIGNAL_TRAP)
>
> Ought to be some || in there :-)
>

No kidding!  No more posting at 3AM for me.  :-)

> > 	{
> > 	  stop_stepping (ecs);
> > 	  stop_signal = TARGET_SIGNAL_0;
> > 	  return;
> > 	}
> >
> >    Or even add a `&& stop_signal == TARGET_SIGNAL_0', and merge
> >    this stop_soon with STOP_QUIETLY_REMOTE.
>
> I don't think I understand.
>

I think this is the same insanity as above :-)

> Allowing both stop and trap sounds reasonable to me.  We already rely
> on there not being other sources of SIGTRAP.

Here a patch for that.  I confirmed that the SIGTRAP notice is gone against
gdbserver, and ran the the attaching into signals tests, and the
attach.exp test nativelly, and all pass cleanly.

-- 
Pedro Alves

[-- Attachment #2: stop_soon_no_sigstop.diff --]
[-- Type: text/x-diff, Size: 1691 bytes --]

2008-07-11  Pedro Alves  <pedro@codesourcery.com>

	* infrun.c (handle_inferior_event): Also ignore a
	TARGET_SIGNAL_TRAP on a STOP_QUIETLY_NO_SIGSTOP.

---
 gdb/infrun.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c	2008-07-11 16:33:00.000000000 +0100
+++ src/gdb/infrun.c	2008-07-11 16:41:51.000000000 +0100
@@ -2543,13 +2543,20 @@ targets should add new threads to the th
 	}
 
       /* This originates from attach_command().  We need to overwrite
-         the stop_signal here, because some kernels don't ignore a
-         SIGSTOP in a subsequent ptrace(PTRACE_CONT,SIGSTOP) call.
-         See more comments in inferior.h.  On the other hand, if we
+	 the stop_signal here, because some kernels don't ignore a
+	 SIGSTOP in a subsequent ptrace(PTRACE_CONT,SIGSTOP) call.
+	 See more comments in inferior.h.  On the other hand, if we
 	 get a non-SIGSTOP, report it to the user - assume the backend
-	 will handle the SIGSTOP if it should show up later.  */
+	 will handle the SIGSTOP if it should show up later.
+
+	 Also consider that the attach is complete when we see a
+	 SIGTRAP.  Some systems (e.g. Windows), and stubs supporting
+	 target extended-remote report it instead of a SIGSTOP
+	 (e.g. gdbserver).  We already rely on SIGTRAP being our
+	 signal, so this is no exception.  */
       if (stop_soon == STOP_QUIETLY_NO_SIGSTOP
-	  && stop_signal == TARGET_SIGNAL_STOP)
+	  && (stop_signal == TARGET_SIGNAL_STOP
+	      || stop_signal == TARGET_SIGNAL_TRAP))
 	{
 	  stop_stepping (ecs);
 	  stop_signal = TARGET_SIGNAL_0;

  reply	other threads:[~2008-07-11 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 23:26 Pedro Alves
2008-07-07 17:55 ` Daniel Jacobowitz
2008-07-07 23:52   ` Pedro Alves
2008-07-08  1:59     ` Pedro Alves
2008-07-11 14:13       ` Daniel Jacobowitz
2008-07-11 17:12         ` Pedro Alves [this message]
2008-07-11 17:37           ` Daniel Jacobowitz

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=200807111812.02067.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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