Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ashley Pittman <ashley@quadrics.com>
To: gdb-patches@sources.redhat.com
Subject: patch: Clean shutdown if still attached at exit in batch mode
Date: Thu, 29 Apr 2004 13:15:00 -0000	[thread overview]
Message-ID: <1083244544.10141.209.camel@ashley> (raw)


Hi,

I've been hitting some problems running gdb against live processes on
ia64 nodes, often stack traces are incomplete due to signal handler
issues or such like.  If running gdb interactively then gdb drops back
to the prompt and everything is fine but if run in batch mode it stops
parsing the batch file and exits.

The problem here is that it does not detach before quiting so the
process becomes a zombie.  Attached is a patch to prevent this.

I'm not cc'd to this list so please include me on any replies.

Ashley,

*** gdb-6.1/gdb/main.c  2004-02-18 00:21:00.000000000 +0000
--- gdb-6.1-modified/gdb/main.c 2004-04-29 14:10:17.000000000 +0100
***************
*** 736,742 ****
    init_history ();
  
    if (batch)
!     {
        /* We have hit the end of the batch file.  */
        exit (0);
      }
--- 736,752 ----
    init_history ();
  
    if (batch)
!   {
!       if ( attach_flag) {
!         /* If there is a problem executing the command in the batch file
!          * then we might not have parsed all of it and might be attached.
!          * Simply calling exit() would leave zombies so be nice and detach
!          * but let the user know that there was a problem.
!          */
!         target_detach(NULL,0);
!         exit(1);
!       }
!       
        /* We have hit the end of the batch file.  */
        exit (0);
      }



             reply	other threads:[~2004-04-29 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-29 13:15 Ashley Pittman [this message]
2004-07-26 19:13 ` [commit/6.2] Detach when in batch mode; Was: " Andrew Cagney
2004-07-26 19:30 ` patch: " Daniel Jacobowitz
2004-07-27  9:40   ` Ashley Pittman

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=1083244544.10141.209.camel@ashley \
    --to=ashley@quadrics.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