This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix ptype problem printing typedefs defined differently in different compilation units
- From: Eli Zaretskii <eliz at gnu dot org>
- To: fnf at diveadx dot com
- Cc: jimb at red-bean dot com, gdb-patches at sourceware dot org, fnf at specifix dot com
- Date: Sat, 18 Feb 2006 11:26:57 +0200
- Subject: Re: [PATCH] Fix ptype problem printing typedefs defined differently in different compilation units
- References: <200601031517.50309.fnf@specifix.com> <200602161916.00761.fnf@diveadx.com> <uaccqibxk.fsf@gnu.org> <200602171531.27812.fnf@diveadx.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Fred Fish <fnf@diveadx.com>
> Date: Fri, 17 Feb 2006 15:31:27 -0500
> Cc: drow@false.org, jimb@red-bean.com, gdb-patches@sourceware.org,
> fnf@specifix.com
>
> On Friday 17 February 2006 04:15, Eli Zaretskii wrote:
> > Will the manual's description of the differences between these two
> > commands be still valid after this change?
>
> Here is a patch for the doc change.
Thanks. The doc patch is approved, but please take care of this minor
issue:
> @kindex whatis
> @item whatis @var{expr}
> ! @itemx whatis @var{typename}
> ! @itemx whatis
> ! Print the data type of expression @var{expr} or type @var{typename}.
> ! @var{expr} is not actually evaluated, and any side-effecting operations
> ! (such as assignments or function calls) inside it do not take place.
> ! @var{typename} may be the name of a type or typedef, or for C code it may
> ! have the form @samp{class @var{class-name}}, @samp{struct @var{struct-tag}},
> ! @samp{union @var{union-tag}} or @samp{enum @var{enum-tag}}.
> ! Without any arguments, print the data type of @code{$}, the last value
> ! in the value history.
Now that you've unified the descriptions, there's no need to have a
separate "@itemx whatis" without arguments, you can simply put the
argument in the other two @item's in [], to show that they are
optional. I would even leave only one @item, and modify the
description slightly, like this:
@item whatis [@var{arg}]
Print the data type of expression @var{arg}, either an expression or
a data type. With no argument, print the data type of @code{$}, ...
If @var{arg} is an expression, it is not actually evaluated, ... If
@var{arg} is a type name, it may be the name of a type or typedef, ...
> @item ptype @var{expr}
> + @itemx ptype @var{typename}
> @itemx ptype
> ! @code{ptype} accepts the same arguments as @code{whatis}, but prints a
> ! detailed description of the type, instead of just the name of the type.
> ! @xref{Expressions, ,Expressions}.
Same here.