From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86377 invoked by alias); 25 Jan 2018 20:21:02 -0000 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 Received: (qmail 86364 invoked by uid 89); 25 Jan 2018 20:21:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=ground X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jan 2018 20:21:00 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D5D7C05972B for ; Thu, 25 Jan 2018 20:20:59 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 019A85D960; Thu, 25 Jan 2018 20:20:55 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: Jan Kratochvil , GDB Patches Subject: Re: [PATCH] Always print "Detaching after fork from child..." References: <20180124194714.26222-1-sergiodj@redhat.com> <20180124204339.GA16117@host1.jankratochvil.net> <87mv13x9g1.fsf@redhat.com> <93ffe8e4-ad56-01b1-c0b5-f9d9c5fb71ec@redhat.com> Date: Thu, 25 Jan 2018 20:21:00 -0000 In-Reply-To: <93ffe8e4-ad56-01b1-c0b5-f9d9c5fb71ec@redhat.com> (Pedro Alves's message of "Thu, 25 Jan 2018 15:58:56 +0000") Message-ID: <87lgglwuzc.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00541.txt.bz2 On Thursday, January 25 2018, Pedro Alves wrote: > On 01/24/2018 08:56 PM, Sergio Durigan Junior wrote: >> On Wednesday, January 24 2018, Jan Kratochvil wrote: >> >>> On Wed, 24 Jan 2018 20:47:14 +0100, Sergio Durigan Junior wrote: >>>> https://bugzilla.redhat.com/show_bug.cgi?id=235197 >>> >>> As a justification for this patch: >>> >>> ------------------------------------------------------------------------------ >>> cat >fork2.c <>> #include >>> #include >>> static void printit(void) { >>> puts("printed"); >>> } >>> int main(void) { >>> if (!fork()) printit(); >>> return 0; >>> } >>> EOH >>> gcc -o fork2 fork2.c -Wall -g >>> gdb -q ./fork2 >>> (gdb) b printit >>> Breakpoint 1 at 0x40052b: file fork2.c, line 4. >>> (gdb) r >>> Starting program: /quad/home/jkratoch/t/fork2 >>> printed >>> [Inferior 1 (process 15812) exited normally] >>> (gdb) q >>> ------------------------------------------------------------------------------ >>> >>> As the GDB user does not expect the program could do any forks s/he is >>> confused the breakpoint did not get hit and assumes GDB is just broken. >> >> Thanks for the extra justification and the useful example. >> >>> But then I cannot say this patch is too great, it produces many uninteresting >>> Detaching after fork from child process 24905. >>> messages rather just annoying in most cases. So nowadays I feel the message >>> is more an excuse how to show it is user's fault s/he did not read it. >>> But I think nobody reads them as there are too many such messages. >> >> I understand where you're coming from, but I still think this is a good >> patch because I read the messages, and as I said, they even helped me in >> one occasion. > > I'm of two minds here. On the one hand, "help, GDB doesn't stop at > my breakpoint!" is a FAQ on IRC. OTOH, I also worry a bit about > printing too many messages. > > Maybe the middle ground is having a way to toggle this output on/off > other than the over-broad "set verbose". An idea would be to make it > conditional on the existing "set print inferior-events" instead, and > flip "set print inferior-events" on by default, like > "set print thread-events" is on by default. One trouble with the > "set print inferior-events" setting is that currently it prints > redundant info, like: > > ~~ > [Inferior 1 (process 2629) exited normally] > [Inferior 2629 exited] > ~~ > > But we can fix that, I think. See a quick straw-man patch below. > (Really just a a straw-man; there's more redundancy if you do "follow-fork child", > for example.) Thanks for the reply and the patch. It is my understanding that you would like it to be extended in order to avoid redundancy in other cases. I will take a look at it. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/