public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Always print "Detaching after fork from child..."
Date: Wed, 24 Jan 2018 20:56:00 -0000	[thread overview]
Message-ID: <87mv13x9g1.fsf@redhat.com> (raw)
In-Reply-To: <20180124204339.GA16117@host1.jankratochvil.net> (Jan	Kratochvil's message of "Wed, 24 Jan 2018 21:43:39 +0100")

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 <<EOH
> #include <unistd.h>
> #include <stdio.h>
> 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 believe the right fix would be to make "set detach-on-fork off" the default.
> But that is sure a new can of worms I do not want to speculate about.

Yeah, I can see the rationale for this, and I think it's an idea worth
discussing.  Not sure what others think, but I also don't want deviate
much from what the current patch is proposing.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

  reply	other threads:[~2018-01-24 20:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 19:47 Sergio Durigan Junior
2018-01-24 20:43 ` Jan Kratochvil
2018-01-24 20:56   ` Sergio Durigan Junior [this message]
2018-01-25 15:59     ` Pedro Alves
2018-01-25 20:21       ` Sergio Durigan Junior
2018-01-25 22:39         ` Pedro Alves
2018-01-31 16:57 ` [PATCH v2] Enable 'set print inferior-events' and cleanup attach/detach messages Sergio Durigan Junior
2018-02-01 17:17   ` Pedro Alves
2018-03-06  1:44     ` Sergio Durigan Junior
2018-03-09 21:56 ` [PATCH v3] Enable 'set print inferior-events' and improve detach/fork/kill/exit messages Sergio Durigan Junior
2018-03-20 19:24   ` Sergio Durigan Junior
2018-03-26 10:58   ` Pedro Alves
2018-03-26 11:43     ` Pedro Alves
2018-04-03  0:15       ` Sergio Durigan Junior
2018-04-02 21:51     ` Sergio Durigan Junior
2018-04-05 18:47 ` [PATCH v4] " Sergio Durigan Junior
2018-04-05 21:32   ` Sergio Durigan Junior
2018-04-06 15:39   ` Pedro Alves
2018-04-06 15:56     ` Sergio Durigan Junior
2018-04-06 16:41       ` Pedro Alves
2018-04-10 16:22         ` Sergio Durigan Junior
2018-04-11 18:46 ` [PATCH v5] " Sergio Durigan Junior
2018-04-11 19:05   ` Pedro Alves
2018-04-11 19:08     ` Sergio Durigan Junior
2018-04-16 20:04 ` [PATCH v6] " Sergio Durigan Junior
2018-04-17 15:57   ` Pedro Alves
2018-04-17 20:07     ` Sergio Durigan Junior
2018-04-19 19:54 ` [PATCH v7] " Sergio Durigan Junior
2018-04-24 13:33   ` Pedro Alves
2018-04-24 19:49     ` Sergio Durigan Junior
2018-04-25 17:41       ` [PATCH] Fix new inferior events output (Re: [PATCH v7] Enable 'set print inferior-events' and improve detach/fork/kill/exit messages) Pedro Alves
2018-04-25 17:53         ` Sergio Durigan Junior
2018-04-25 18:07           ` Pedro Alves

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=87mv13x9g1.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).