This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] gdb/doc/python.texi: documented gdb.SYMBOL_LOC_LABEL. Added notion on possible exception thrown from symbol object .value() method
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Maxim Bublis <satori at yandex-team dot ru>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 04 Mar 2014 18:52:44 +0200
- Subject: Re: [PATCH 3/3] gdb/doc/python.texi: documented gdb.SYMBOL_LOC_LABEL. Added notion on possible exception thrown from symbol object .value() method
- Authentication-results: sourceware.org; auth=none
- References: <1393929360-31299-1-git-send-email-satori at yandex-team dot ru> <1393929360-31299-4-git-send-email-satori at yandex-team dot ru>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Maxim Bublis <satori@yandex-team.ru>
> Cc: Maxim Bublis <satori@yandex-team.ru>
> Date: Tue, 4 Mar 2014 14:36:00 +0400
>
> +2014-03-04 Maxim Bublis <satori@yandex-team.ru>
> +
> + * gdb/doc/python.texi (Symbols In Python): Document gdb.SYMBOL_LOC_LABEL
> + address class. Added notion on possible exception thrown from .value()
^^
Two spaces between sentences, please. Also, please don't attach "()"
to function and method name to signal they are function, that's
against GNU Coding Standards (it looks like a call to a function with
no arguments, which is not what you want to say).
> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -3544,7 +3544,10 @@ functions, this computes the address of the function, cast to the
> appropriate type. If the symbol requires a frame in order to compute
> its value, then @var{frame} must be given. If @var{frame} is not
> given, or if @var{frame} is invalid, then this method will throw an
> -exception.
> +exception. For symbols with some address classes it is not possible
> +to compute value (eg. @code{gdb.SYMBOL_LOC_TYPEDEF} or
> +@code{gdb.SYMBOL_LOC_LABEL}), in this case exception will
> +be thrown.
Please try to minimize the use of passive tense, it makes the text
longer and slightly less clear. In this case, I suggest to rephrase:
This method will also throw an exception for symbols for which it is
not possible to compute the value, such as
@code{gdb.SYMBOL_LOC_TYPEDEF} or @code{gdb.SYMBOL_LOC_LABEL}.
The documentation patch is OK with those changes.
I have a question regarding the last part: is it wise to throw an
exception when a symbol has no value? how about returning None
instead?