* RFA: "maint print type" should print all the flag bits
@ 2001-12-09 11:14 Fred Fish
2001-12-09 19:08 ` Jim Blandy
2001-12-10 1:03 ` Eli Zaretskii
0 siblings, 2 replies; 14+ messages in thread
From: Fred Fish @ 2001-12-09 11:14 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
The "maint print type" command does not print all the flag
bits. It also should to use the defined macros to test for
the bits.
-Fred
2001-12-09 Fred Fish <fnf@redhat.com>
* gdbtypes.c (TYPE_FLAG_UNSIGNED, TYPE_FLAG_STUB): Use
TYPE_UNSIGNED and TYPE_NOSIGN to determine when to print these
rather than testing the bits directly.
(TYPE_FLAG_NOSIGN, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC,
TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_PROTOTYPED,
TYPE_FLAG_INCOMPLETE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE,
TYPE_FLAG_VARARGS): Test for and print these bits as well.
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.29
diff -u -p -r1.29 gdbtypes.c
--- gdbtypes.c 2001/12/07 22:11:51 1.29
+++ gdbtypes.c 2001/12/09 19:08:25
@@ -2846,14 +2844,54 @@ recursive_dump_type (struct type *type,
gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
- if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
+ if (TYPE_UNSIGNED (type))
{
puts_filtered (" TYPE_FLAG_UNSIGNED");
}
- if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
+ if (TYPE_NOSIGN (type))
{
+ puts_filtered (" TYPE_FLAG_NOSIGN");
+ }
+ if (TYPE_STUB (type))
+ {
puts_filtered (" TYPE_FLAG_STUB");
}
+ if (TYPE_TARGET_STUB (type))
+ {
+ puts_filtered (" TYPE_FLAG_TARGET_STUB");
+ }
+ if (TYPE_STATIC (type))
+ {
+ puts_filtered (" TYPE_FLAG_STATIC");
+ }
+ if (TYPE_CONST (type))
+ {
+ puts_filtered (" TYPE_FLAG_CONST");
+ }
+ if (TYPE_VOLATILE (type))
+ {
+ puts_filtered (" TYPE_FLAG_VOLATILE");
+ }
+ if (TYPE_PROTOTYPED (type))
+ {
+ puts_filtered (" TYPE_FLAG_PROTOTYPED");
+ }
+ if (TYPE_INCOMPLETE (type))
+ {
+ puts_filtered (" TYPE_FLAG_INCOMPLETE");
+ }
+ if (TYPE_CODE_SPACE (type))
+ {
+ puts_filtered (" TYPE_FLAG_CODE_SPACE");
+ }
+ if (TYPE_DATA_SPACE (type))
+ {
+ puts_filtered (" TYPE_FLAG_DATA_SPACE");
+ }
+ if (TYPE_VARARGS (type))
+ {
+ puts_filtered (" TYPE_FLAG_VARARGS");
+ }
puts_filtered ("\n");
printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: RFA: "maint print type" should print all the flag bits
2001-12-09 11:14 RFA: "maint print type" should print all the flag bits Fred Fish
@ 2001-12-09 19:08 ` Jim Blandy
2001-12-10 1:03 ` Eli Zaretskii
1 sibling, 0 replies; 14+ messages in thread
From: Jim Blandy @ 2001-12-09 19:08 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
Approved.
Fred Fish <fnf@ns1.ninemoons.com> writes:
>
> The "maint print type" command does not print all the flag
> bits. It also should to use the defined macros to test for
> the bits.
>
> -Fred
>
> 2001-12-09 Fred Fish <fnf@redhat.com>
>
> * gdbtypes.c (TYPE_FLAG_UNSIGNED, TYPE_FLAG_STUB): Use
> TYPE_UNSIGNED and TYPE_NOSIGN to determine when to print these
> rather than testing the bits directly.
> (TYPE_FLAG_NOSIGN, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC,
> TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_PROTOTYPED,
> TYPE_FLAG_INCOMPLETE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE,
> TYPE_FLAG_VARARGS): Test for and print these bits as well.
>
> Index: gdbtypes.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtypes.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 gdbtypes.c
> --- gdbtypes.c 2001/12/07 22:11:51 1.29
> +++ gdbtypes.c 2001/12/09 19:08:25
> @@ -2846,14 +2844,54 @@ recursive_dump_type (struct type *type,
> gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
> printf_filtered ("\n");
> printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
> - if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
> + if (TYPE_UNSIGNED (type))
> {
> puts_filtered (" TYPE_FLAG_UNSIGNED");
> }
> - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
> + if (TYPE_NOSIGN (type))
> {
> + puts_filtered (" TYPE_FLAG_NOSIGN");
> + }
> + if (TYPE_STUB (type))
> + {
> puts_filtered (" TYPE_FLAG_STUB");
> }
> + if (TYPE_TARGET_STUB (type))
> + {
> + puts_filtered (" TYPE_FLAG_TARGET_STUB");
> + }
> + if (TYPE_STATIC (type))
> + {
> + puts_filtered (" TYPE_FLAG_STATIC");
> + }
> + if (TYPE_CONST (type))
> + {
> + puts_filtered (" TYPE_FLAG_CONST");
> + }
> + if (TYPE_VOLATILE (type))
> + {
> + puts_filtered (" TYPE_FLAG_VOLATILE");
> + }
> + if (TYPE_PROTOTYPED (type))
> + {
> + puts_filtered (" TYPE_FLAG_PROTOTYPED");
> + }
> + if (TYPE_INCOMPLETE (type))
> + {
> + puts_filtered (" TYPE_FLAG_INCOMPLETE");
> + }
> + if (TYPE_CODE_SPACE (type))
> + {
> + puts_filtered (" TYPE_FLAG_CODE_SPACE");
> + }
> + if (TYPE_DATA_SPACE (type))
> + {
> + puts_filtered (" TYPE_FLAG_DATA_SPACE");
> + }
> + if (TYPE_VARARGS (type))
> + {
> + puts_filtered (" TYPE_FLAG_VARARGS");
> + }
> puts_filtered ("\n");
> printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
> gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: RFA: "maint print type" should print all the flag bits
2001-12-09 11:14 RFA: "maint print type" should print all the flag bits Fred Fish
2001-12-09 19:08 ` Jim Blandy
@ 2001-12-10 1:03 ` Eli Zaretskii
2001-12-10 12:44 ` Jim Blandy
1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2001-12-10 1:03 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches, fnf
On Sun, 9 Dec 2001, Fred Fish wrote:
> The "maint print type" command does not print all the flag
> bits.
This command is not documented in the manual. Could someone please
fill that void?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-10 1:03 ` Eli Zaretskii
@ 2001-12-10 12:44 ` Jim Blandy
2001-12-11 0:18 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Jim Blandy @ 2001-12-10 12:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: fnf, gdb-patches
Eli Zaretskii <eliz@is.elta.co.il> writes:
> On Sun, 9 Dec 2001, Fred Fish wrote:
> > The "maint print type" command does not print all the flag
> > bits.
>
> This command is not documented in the manual. Could someone please
> fill that void?
Are the other `maint' commands documented in the manual? They're only
meant for use by GDB developers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-10 12:44 ` Jim Blandy
@ 2001-12-11 0:18 ` Eli Zaretskii
[not found] ` <3C162900.288B@redhat.com>
2001-12-11 10:55 ` Jim Blandy
0 siblings, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2001-12-11 0:18 UTC (permalink / raw)
To: Jim Blandy; +Cc: fnf, gdb-patches
On 10 Dec 2001, Jim Blandy wrote:
> > > The "maint print type" command does not print all the flag
> > > bits.
> >
> > This command is not documented in the manual. Could someone please
> > fill that void?
>
> Are the other `maint' commands documented in the manual?
At least some of them are. Try "i maint TAB" in Info, and you will
see which ones are there.
> They're only meant for use by GDB developers.
How do you expect the GDB developers to discover their existence if
they aren't documented? Even if they do discover their existence, how
would a developer who never used a particular command know what it
does? The built-in doc strings are terse and don't explain much. For
example, suppose i use "maint print type" and see it print
TYPE_FLAG_TARGET_STUB--how do I figure out what that means? (If you
think that GDB's sources explain that clearly, think again ;-)
I think every command should be documented in the manual.
^ permalink raw reply [flat|nested] 14+ messages in thread[parent not found: <3C162900.288B@redhat.com>]
* Re: RFA: "maint print type" should print all the flag bits
[not found] ` <3C162900.288B@redhat.com>
@ 2001-12-11 9:21 ` Eli Zaretskii
2001-12-11 10:59 ` Andrew Cagney
2001-12-11 11:44 ` Daniel Jacobowitz
0 siblings, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2001-12-11 9:21 UTC (permalink / raw)
To: msnyder; +Cc: jimb, fnf, gdb-patches
> Date: Tue, 11 Dec 2001 07:40:48 -0800
> From: Michael Snyder <msnyder@redhat.com>
>
> Perhaps there needs to be a developers manual?
That's a possibility. However, the number of maint commands is quite
small, and hardly warrants a separate manual.
How about having an Appendix where all maint commands would be
documented?
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 9:21 ` Eli Zaretskii
@ 2001-12-11 10:59 ` Andrew Cagney
2001-12-11 11:44 ` Daniel Jacobowitz
1 sibling, 0 replies; 14+ messages in thread
From: Andrew Cagney @ 2001-12-11 10:59 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: msnyder, jimb, fnf, gdb-patches
> Date: Tue, 11 Dec 2001 07:40:48 -0800
>> From: Michael Snyder <msnyder@redhat.com>
>>
>> Perhaps there needs to be a developers manual?
>
>
> That's a possibility. However, the number of maint commands is quite
> small, and hardly warrants a separate manual.
I'm about to add another one (``maint print regcache'') :-)
> How about having an Appendix where all maint commands would be
> documented?
That I don't know.
Andrew
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 9:21 ` Eli Zaretskii
2001-12-11 10:59 ` Andrew Cagney
@ 2001-12-11 11:44 ` Daniel Jacobowitz
2001-12-11 17:47 ` Andrew Cagney
2001-12-12 0:29 ` Eli Zaretskii
1 sibling, 2 replies; 14+ messages in thread
From: Daniel Jacobowitz @ 2001-12-11 11:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: msnyder, jimb, fnf, gdb-patches
On Tue, Dec 11, 2001 at 07:20:06PM +0200, Eli Zaretskii wrote:
> > Date: Tue, 11 Dec 2001 07:40:48 -0800
> > From: Michael Snyder <msnyder@redhat.com>
> >
> > Perhaps there needs to be a developers manual?
>
> That's a possibility. However, the number of maint commands is quite
> small, and hardly warrants a separate manual.
>
> How about having an Appendix where all maint commands would be
> documented?
We have an internals manual, don't we? The maint commands are only
useful if you're wandering around in the internals. So why not say as
much in the user manual, and document them in the internals manual?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 11:44 ` Daniel Jacobowitz
@ 2001-12-11 17:47 ` Andrew Cagney
2001-12-11 19:14 ` Daniel Jacobowitz
2001-12-12 0:29 ` Eli Zaretskii
1 sibling, 1 reply; 14+ messages in thread
From: Andrew Cagney @ 2001-12-11 17:47 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Eli Zaretskii, msnyder, jimb, fnf, gdb-patches
> On Tue, Dec 11, 2001 at 07:20:06PM +0200, Eli Zaretskii wrote:
>
>> > Date: Tue, 11 Dec 2001 07:40:48 -0800
>> > From: Michael Snyder <msnyder@redhat.com>
>> >
>> > Perhaps there needs to be a developers manual?
>
>>
>> That's a possibility. However, the number of maint commands is quite
>> small, and hardly warrants a separate manual.
>>
>> How about having an Appendix where all maint commands would be
>> documented?
>
>
> We have an internals manual, don't we? The maint commands are only
> useful if you're wandering around in the internals. So why not say as
> much in the user manual, and document them in the internals manual?
I think the ``maint'' commands are like the ``remote protocol spec'' and
the MI interface. While not for the average user, they do define
external user accessable interfaces to GDB.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 17:47 ` Andrew Cagney
@ 2001-12-11 19:14 ` Daniel Jacobowitz
2001-12-12 0:29 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Daniel Jacobowitz @ 2001-12-11 19:14 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Eli Zaretskii, msnyder, jimb, fnf, gdb-patches
On Tue, Dec 11, 2001 at 05:47:26PM -0800, Andrew Cagney wrote:
> >On Tue, Dec 11, 2001 at 07:20:06PM +0200, Eli Zaretskii wrote:
> >
> >>> Date: Tue, 11 Dec 2001 07:40:48 -0800
> >>> From: Michael Snyder <msnyder@redhat.com>
> >>>
> >>> Perhaps there needs to be a developers manual?
> >
> >>
> >>That's a possibility. However, the number of maint commands is quite
> >>small, and hardly warrants a separate manual.
> >>
> >>How about having an Appendix where all maint commands would be
> >>documented?
> >
> >
> >We have an internals manual, don't we? The maint commands are only
> >useful if you're wandering around in the internals. So why not say as
> >much in the user manual, and document them in the internals manual?
>
>
> I think the ``maint'' commands are like the ``remote protocol spec'' and
> the MI interface. While not for the average user, they do define
> external user accessable interfaces to GDB.
In that case, I'd almost rather rename the Internals manual to a
Developers manual - for development involving, rather than using but
not necessarily directly on, GDB.
I don't consider that fit for the User's manual.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 19:14 ` Daniel Jacobowitz
@ 2001-12-12 0:29 ` Eli Zaretskii
0 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2001-12-12 0:29 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Andrew Cagney, msnyder, jimb, fnf, gdb-patches
On Tue, 11 Dec 2001, Daniel Jacobowitz wrote:
> I don't consider that fit for the User's manual.
I don't see why we should conceal the maint commands from users: what
damage can that possibly cause?
We also shouldn't second-guess what they need: it's perfectly possible
that some maint command could be useful to some user, somewhere. If
those commands aren't in the user manual, users will never find them.
OTOH, having these commands in the user's manual doesn't present any
disadvantage to the GDB developers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 11:44 ` Daniel Jacobowitz
2001-12-11 17:47 ` Andrew Cagney
@ 2001-12-12 0:29 ` Eli Zaretskii
1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2001-12-12 0:29 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: msnyder, jimb, fnf, gdb-patches
On Tue, 11 Dec 2001, Daniel Jacobowitz wrote:
> The maint commands are only useful if you're wandering around in the
> internals.
I don't necessarily agree, but anyway, it doesn't really matter, IMHO.
What does matter is that someone who wants to find a description of a
command--any command--should know in what manual to look. Working
with more than a single manual at a time is not very convenient in
most Info readers.
Since the internals manual omits more than it describes, I expect
someone who messes with the internals to read the code more than the
manual. So having all the commands in one manual is more convenient
even for a GDB developer.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 0:18 ` Eli Zaretskii
[not found] ` <3C162900.288B@redhat.com>
@ 2001-12-11 10:55 ` Jim Blandy
2001-12-11 11:16 ` Stan Shebs
1 sibling, 1 reply; 14+ messages in thread
From: Jim Blandy @ 2001-12-11 10:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: fnf, gdb-patches
Eli Zaretskii <eliz@is.elta.co.il> writes:
> > They're only meant for use by GDB developers.
>
> How do you expect the GDB developers to discover their existence if
> they aren't documented? Even if they do discover their existence, how
> would a developer who never used a particular command know what it
> does? The built-in doc strings are terse and don't explain much. For
> example, suppose i use "maint print type" and see it print
> TYPE_FLAG_TARGET_STUB--how do I figure out what that means? (If you
> think that GDB's sources explain that clearly, think again ;-)
>
> I think every command should be documented in the manual.
Well, you're right, of course. There's no good reason *not* to
document them, other than laziness.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: RFA: "maint print type" should print all the flag bits
2001-12-11 10:55 ` Jim Blandy
@ 2001-12-11 11:16 ` Stan Shebs
0 siblings, 0 replies; 14+ messages in thread
From: Stan Shebs @ 2001-12-11 11:16 UTC (permalink / raw)
To: Jim Blandy; +Cc: Eli Zaretskii, fnf, gdb-patches
Jim Blandy wrote:
>
> Eli Zaretskii <eliz@is.elta.co.il> writes:
> > > They're only meant for use by GDB developers.
> >
> > How do you expect the GDB developers to discover their existence if
> > they aren't documented? Even if they do discover their existence, how
> > would a developer who never used a particular command know what it
> > does? The built-in doc strings are terse and don't explain much. For
> > example, suppose i use "maint print type" and see it print
> > TYPE_FLAG_TARGET_STUB--how do I figure out what that means? (If you
> > think that GDB's sources explain that clearly, think again ;-)
> >
> > I think every command should be documented in the manual.
>
> Well, you're right, of course. There's no good reason *not* to
> document them, other than laziness.
I'll mention again a script that I had Jason write one time (that's
probably lost to posterity), which was to collect all the
commands in the sources, and all the commands documented in the
manual, and diff the two. Very handy, because it shows commands
that are not documented, and encourages both manual and source to
be written in a fashion that makes it easy for the script to find
them.
(And yes, the followup suggestion will be to generate both source
and doc from a single file, but that's a big project. The comparison
script would only take an hour or two to get to the point of bein
useful.)
On the location of maint command docs, I don't think it matters
much whether it is in appendix or regular chapter. Readers will
be smart enough to realize that they don't need to use the commands
unless a GDB maintainer asks them to run one.
Stan
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2001-12-12 8:29 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-09 11:14 RFA: "maint print type" should print all the flag bits Fred Fish
2001-12-09 19:08 ` Jim Blandy
2001-12-10 1:03 ` Eli Zaretskii
2001-12-10 12:44 ` Jim Blandy
2001-12-11 0:18 ` Eli Zaretskii
[not found] ` <3C162900.288B@redhat.com>
2001-12-11 9:21 ` Eli Zaretskii
2001-12-11 10:59 ` Andrew Cagney
2001-12-11 11:44 ` Daniel Jacobowitz
2001-12-11 17:47 ` Andrew Cagney
2001-12-11 19:14 ` Daniel Jacobowitz
2001-12-12 0:29 ` Eli Zaretskii
2001-12-12 0:29 ` Eli Zaretskii
2001-12-11 10:55 ` Jim Blandy
2001-12-11 11:16 ` Stan Shebs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox