Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] testsuite/gdb.base/bang.exp:  Allow trailing text after "Program exited normally"
Date: Mon, 08 Sep 2003 20:14:00 -0000	[thread overview]
Message-ID: <20030908201448.GA30147@nevyn.them.org> (raw)
In-Reply-To: <3F5CCFEC.4090007@redhat.com>

On Mon, Sep 08, 2003 at 02:52:28PM -0400, Andrew Cagney wrote:
> >On Mon, Sep 08, 2003 at 01:42:01PM +0200, Corinna Vinschen wrote:
> >
> >>Hi,
> >>
> >>while testing I found that a test for ending the program in
> >>gdb.base/bang.exp failed, even though the target had actually
> >>exited normally.  The cause of the FAIL is that bang.exp doesn't
> >>expect anything after the string "Program exited normally.".
> >>On the sh target at least, the output after exiting contains a
> >>bit more text:
> >>
> >>  Program exited normally.
> >>  [Switching to process 0] 
> >>
> >>Since that trailing output after a normal exit doesn't change
> >>anything with respect to the testresult, I propose to allow
> >>trailing characters:
> >
> >
> >But isn't the [Switching to process 0] a bug?  We aren't switching
> >processes, the inferior is dead.
> 
> Yes.  The message is both a bug and a very long standing regression.
> 
> Andrew
> 
> PS: Suggest a reminder comment that SIGNALED is really "terminated with 
> signal" :-)

Good idea.  WIFSIGNALLED confuses me every time.  Checked in to HEAD.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-09-08  Daniel Jacobowitz  <drow@mvista.com>

	* infrun.c (normal_stop): Don't print a message if the inferior
	has exited.

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.111
diff -u -p -r1.111 infrun.c
--- infrun.c	7 Sep 2003 15:15:01 -0000	1.111
+++ infrun.c	8 Sep 2003 20:12:29 -0000
@@ -3054,14 +3054,22 @@ print_stop_reason (enum inferior_stop_re
 void
 normal_stop (void)
 {
+  struct target_waitstatus last;
+  ptid_t last_ptid;
+
+  get_last_target_status (&last_ptid, &last);
+
   /* As with the notification of thread events, we want to delay
      notifying the user that we've switched thread context until
      the inferior actually stops.
 
-     (Note that there's no point in saying anything if the inferior
-     has exited!) */
+     There's no point in saying anything if the inferior has exited.
+     Note that SIGNALLED here means "exited with a signal", not
+     "received a signal".  */
   if (!ptid_equal (previous_inferior_ptid, inferior_ptid)
-      && target_has_execution)
+      && target_has_execution
+      && last.kind != TARGET_WAITKIND_SIGNALLED
+      && last.kind != TARGET_WAITKIND_EXITED)
     {
       target_terminal_ours_for_output ();
       printf_filtered ("[Switching to %s]\n",


      reply	other threads:[~2003-09-08 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-08 11:42 Corinna Vinschen
2003-09-08 13:27 ` Daniel Jacobowitz
2003-09-08 14:30   ` Corinna Vinschen
2003-09-08 14:52     ` Daniel Jacobowitz
2003-09-08 15:39       ` Corinna Vinschen
2003-09-08 18:52   ` Andrew Cagney
2003-09-08 20:14     ` Daniel Jacobowitz [this message]

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=20030908201448.GA30147@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.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