Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] doc: Improve documentation about MI thread output
Date: Wed, 12 Apr 2017 20:34:00 -0000	[thread overview]
Message-ID: <83o9w1icug.fsf@gnu.org> (raw)
In-Reply-To: <f0988689-6be8-18ad-cd66-886c337b4bc1@ericsson.com> (message from	Simon Marchi on Wed, 12 Apr 2017 16:09:35 -0400)

> CC: <gdb-patches@sourceware.org>
> From: Simon Marchi <simon.marchi@ericsson.com>
> Date: Wed, 12 Apr 2017 16:09:35 -0400
> 
> > I think we need to describe at least the most "popular" situations
> > where this happens.  The initial state of GDB is not an interesting
> > case, but others are.  In particular, IMO it would be good to state
> > that when there's only one inferior being debugged that has been run
> > already, there will always be a selected thread.
> 
> I agree that we could give an example of situation where there _isn't_
> a selected thread.  Readers may, like you did, find that it's an odd
> claim and wonder how it's possible that there isn't a selected thread.
> But I don't think it's useful (and maybe even counterproductive) to try
> to define some situation where the field will always be present.
> 
> The important thing that users of this API need to know is that the field
> may not be there.  This will encourage them to program defensively and check
> whether the field is present before trying to use it.  If we try to define a
> green zone where the field is supposedly always be present, it will incite some
> people to skip the check, which will potentially come back and bite them if the
> behavior of GDB changes or there's a situation we haven't thought of where it
> can happen.

IME, defensive programming aside, knowing that some field could or
could not appear is not always enough, sometimes you also need to
understand the semantics and the significance of whether it does or
doesn't, because you might need to interpret that in some way, e.g. to
present some meaningful message to a human user.

That said, I'm not going to argue.  It's up to you.


  reply	other threads:[~2017-04-12 20:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 18:06 [PATCH 1/2] Remove dead code and "current" field from MI thread output doc Simon Marchi
2017-04-12 18:07 ` [PATCH 2/2] doc: Improve documentation about MI thread output Simon Marchi
2017-04-12 18:17   ` Simon Marchi
2017-04-12 19:18   ` Eli Zaretskii
2017-04-12 19:26     ` Simon Marchi
2017-04-12 19:32       ` Eli Zaretskii
2017-04-12 20:10         ` Simon Marchi
2017-04-12 20:34           ` Eli Zaretskii [this message]
2017-04-12 21:13             ` Simon Marchi
2017-04-13  6:02               ` Eli Zaretskii
2017-04-22  1:57                 ` Simon Marchi
2017-04-12 19:14 ` [PATCH 1/2] Remove dead code and "current" field from MI thread output doc Eli Zaretskii

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=83o9w1icug.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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