From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11723 invoked by alias); 13 Apr 2009 18:49:18 -0000 Received: (qmail 11715 invoked by uid 22791); 13 Apr 2009 18:49:14 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Apr 2009 18:49:09 +0000 Received: from spaceape11.eur.corp.google.com (spaceape11.eur.corp.google.com [172.28.16.145]) by smtp-out.google.com with ESMTP id n3DIn6n0013620 for ; Mon, 13 Apr 2009 11:49:07 -0700 Received: from rv-out-0506.google.com (rvbl9.prod.google.com [10.140.88.9]) by spaceape11.eur.corp.google.com with ESMTP id n3DImkG4028791 for ; Mon, 13 Apr 2009 11:49:05 -0700 Received: by rv-out-0506.google.com with SMTP id l9so1907790rvb.7 for ; Mon, 13 Apr 2009 11:49:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.141.162.1 with SMTP id p1mr2856166rvo.277.1239648544536; Mon, 13 Apr 2009 11:49:04 -0700 (PDT) In-Reply-To: <200904111604.05252.pedro@codesourcery.com> References: <20090410231814.40469846AB@localhost> <200904111604.05252.pedro@codesourcery.com> Date: Mon, 13 Apr 2009 18:49:00 -0000 Message-ID: Subject: Re: [RFA] Don't kill inferior if there's a typo in the specified port. From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00238.txt.bz2 On Sat, Apr 11, 2009 at 8:04 AM, Pedro Alves wrote: >> It also moves the status message to the callback; >> it's only called when exiting gdb (and if that changes one can split >> the function into silent/verbose versions). >> An alternative is something like this: >> >> - =A0 =A0 =A0fprintf (stderr, "Killing all inferiors\n"); >> + =A0 =A0 =A0fprintf (stderr, "Detaching or killing all inferiors\n"); >> >> but will that be confusing? > > Perhaps: > > =A0"Detaching from inferiors we had attached to, and killing all others\n" > > dunno, don't want to start a bikeshed-ish discussion on that. > >> OTOH, if gdbserver ever gets used with 10's or 100's of processes, >> exiting with one line per process may be a bit much. >> OTOOH, the user might like to know what got detached and what got killed. >> I don't know, but I can change the patch to do whatever y'all prefer. > > Yeah. =A0If this is a real problem, then we could output something like, > > =A0Killing process(es) PID1, PID2, PID3, PID4, PIDnn. > =A0Detaching process(es) PID1, PID2, PID3, PID4, PIDnn. > > This should mitigate the problem, although if you're really attached to > 100's of processes, it will still print a lot. > > The other thing that crossed my mind was that if you had a bunch > of processes, the real error message that let to gdbserver bailing out > would be buried in the output many lines before all those > "Killing/detaching process X". =A0The only version that doesn't > have this problem is the one that doesn't include any detail, like > the first option. One reason why I like printing which processes were detached from and which were killed is: What happens if the process is gone shortly after gdbserver exits? Did gdbserver kill it, or did the detach screw up, or did the program crash on its own shortly after gdbserver detached? Tracking this down will be a pain without this info. One could add a verbose option to print such info I guess, but it might cut down on support costs if this info was always printed. > > Anyway, I've no real inclination for any of these possible > outputs. > >> Ok to check in? > > This is fine with me. =A0Let's give it a few days in case Daniel or > others want to comment. > > Thanks for documenting detach_or_kill_inferior_callback, btw ;-). > > -- > Pedro Alves >