Re: [PATCH] Add extra 'info os' information types for Linux (trunk and 7.4)

Stan Shebs
2011-12-27T23:30:23Z

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.

And although the patch at hand consists of implementations for Linux, I
don't think any of the types of data are truly Linux-only; the IPC types
are common to all System V inheritors for instance, and even the
seemingly-Linux concept of loadable kernel modules now has a BSD
equivalent. By comparison, "info dos" has subcommands like "gdt"
(global descriptor table) that are not meaningful for any other kind of OS.

Stan