This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/8] gdb: Add $_cimag and $_creal internal functions


> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Cc: Richard Bunt <Richard.Bunt@arm.com>,	Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Mon, 18 Mar 2019 12:52:16 +0000
> 
> gdb/ChangeLog:
> 
> 	* NEWS: Mention new internal functions.
> 	* dwarf2read.c (dwarf2_init_complex_target_type): New function.
> 	(read_base_type): Use dwarf2_init_complex_target_type.
> 	* value.c (creal_internal_fn): New function.
> 	(cimag_internal_fn): New function.
> 	(_initialize_values): Register new internal functions.
> 
> gdb/doc/ChangeLog:
> 
> 	* gdb.texinfo (Convenience Funs): Document '$_creal' and
> 	'$_cimag'.

The documentation parts are okay, with a couple of comments:

> +@item $_cimag(@var{value})
> +@findex $_cimag@r{, convenience function}
> +Return the imaginary part of a complex number @var{value}.
> +
> +The type of the imaginary part depends on the type of the complex
> +number, a @code{float complex} will return an imaginary part of type
> +@code{float}.
> +
> +@item $_creal(@var{value})
> +@findex $_creal@r{, convenience function}
> +Return the real part of a complex number @var{value}.
> +
> +The type of the real part depends on the type of the complex number, a
> +@code{float complex} will return an real part of type @code{float}.

There's no need to repeat the sentence about the type being dependent
on the original type; you can say that just once for both.

Also, the "a @code{float complex} will return ..." part is better
preceded by "e.g.", as this is an example, right?

And finally, "a real part", not "an real part".

> +Return the real part of a complex number, the type depends on the\n\
> +type of a complex number."),
           ^
"the", not "a".

> +Return the imaginary part of a complex number, the type depends on the\n\
> +type of a complex number."),

Likewise.

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]