Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <alves.ped@gmail.com>
To: Stan Shebs <stanshebs@earthlink.net>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH]  Add extra 'info os' information types for Linux (trunk and 7.4)
Date: Mon, 02 Jan 2012 12:08:00 -0000	[thread overview]
Message-ID: <4F019E45.5010906@gmail.com> (raw)
In-Reply-To: <4EFA54FF.1080307@earthlink.net>

On 12/27/2011 11:30 PM, Stan Shebs wrote:
>  On 12/26/11 10:29 PM, Eli Zaretskii wrote:
> >> Date: Mon, 26 Dec 2011 20:28:43 -0800 From: Stan
> >> Shebs<stanshebs@earthlink.net>
> >>
> >> Here is a third revision of the 'info os' additions for Linux;
> >> it rolls up Kwok's original patch plus requested edits, plus a
> >> few more comments and tweaks. I plan to commit this in a day or
> >> so, if there are no objections.
> > I already voiced an objection the first time: I think
> > Linux-specific OS information doesn't belong to "info os", which
> > should be for commands generally available on all supported
> > systems. I would support an "info linux" command for what you
> > want here.
> >
>
>  Yeah, I see that went by without comment at the time, but it's a
>  fair point.
>
>  I think the answer is that there would be few if any "info os"
>  subcommands that would be genuinely common to all operating systems
>  that GDB supports; embedded OSes may not even have a well-defined
>  concept of processes. On the other hand, one could argue that
>  anything that is not totally general should be given a OS-specific
>  subcommand, a la "info dos".
>
>  For my part, I would tend to favor "info os" for those kinds of data
>  that are generic enough to be found on more than one target OS.
>  Things like processes, semaphores, and sockets are found across a
>  broad range of systems large and small, and it seems unduly pedantic
>  to require users to do "info linux semaphores" when targeting Linux,
>  but "info bsd sem" for BSD - or worse, "info freebsd sem" vs "info
>  openbsd sem" - and which flavor of BSD is Darwin most like, again?
>  :-) Putting things under "info os" means less detail for users to
>  remember.

The idea of "info os" is to leave GDB completely agnostic of what is it the
backend decides to present to the user/frontend.  GDB only knows that it is
being given a table with columns and lines.  We should not assume that 
"info os FOO"
means the same thing on different OSs.  FOO in "info os FOO" is 
completely not standardized.
We're already suffering somewhat from one bit in gdb (MI) that is 
assuming it is
(Mentor is working on a target where "info os processes" would make much 
more sense to
display its own concept of "processes", but MI uses "info os processes"
for -list-thread-groups.)  If we want to have standard classes of 
objects, and assume
some concepts and fields are present, we should put those objects in some
namespace, so that GDB can give them special treatment, like with target 
description
features.  E.g., something like "org.gdb.mutex", "org.gdb.sem", etc.

It may be important to this discussion to consider that in its present form,
"info os" is more useful in its MI variant, where the frontend queries
GDB for what tables does the backend expose (with "info os"), and then
presents them in spreadsheet-like format, all without any hardcoding.  
Exposing
more bits in the GNU/Linux backends serves the purpose of being the
reference implementation / proof-of-concept.


  parent reply	other threads:[~2012-01-02 12:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 18:29 [PATCH] Add extra 'info os' information types for Linux Kwok Cheung Yeung
2011-10-21 23:38 ` Tom Tromey
2011-11-23 18:00   ` Kwok Cheung Yeung
2011-12-27  4:56     ` [PATCH] Add extra 'info os' information types for Linux (trunk and 7.4) Stan Shebs
2011-12-27  9:32       ` Eli Zaretskii
2011-12-27 21:30         ` Mark Kettenis
2011-12-27 23:23           ` Eli Zaretskii
2011-12-28 20:48             ` Mark Kettenis
2011-12-28  0:05         ` Stan Shebs
2011-12-28  3:51           ` Joel Brobecker
2011-12-28  6:02           ` Eli Zaretskii
2012-01-02 12:08           ` Pedro Alves [this message]
2012-01-02 12:35             ` Eli Zaretskii
2012-01-02 19:31               ` Pedro Alves
2012-01-03  3:05               ` Joel Brobecker
2012-01-02 18:15             ` Doug Evans
2012-01-02 19:19               ` Pedro Alves
2012-01-02 19:41                 ` Tom Tromey
2011-12-29 20:34       ` Doug Evans

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=4F019E45.5010906@gmail.com \
    --to=alves.ped@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=stanshebs@earthlink.net \
    /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