Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: matt rice <ratmice@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 6/7] [python] API for macros: Add docs.
Date: Wed, 24 Aug 2011 20:10:00 -0000	[thread overview]
Message-ID: <83k4a2h8qr.fsf@gnu.org> (raw)
In-Reply-To: <1314198654-9008-7-git-send-email-ratmice@gmail.com>

> From: matt rice <ratmice@gmail.com>
> Cc: matt rice <ratmice@gmail.com>
> Date: Wed, 24 Aug 2011 08:10:53 -0700
> 
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -38,6 +38,13 @@
>  
>    ** Symbols now provide the "type" attribute, the type of the symbol.
>  
> +  ** Objfiles now provide a "symtabs" method.
> +
> +  ** The Macro object is now available for representing preprocessor macros.
> +     The following objects now have methods for obtaining macro objects.
> +     - Symtab_and_line now has a "macro_named" method
> +     - Symtab now has a "macros" method.

This part is okay, but please add a reference to the section in the
manual where these are described.

> +@defmethod Symtab_and_line macro_named @r{[}name@r{]}
> +Returns a @code{gdb.Macro} object, for the macro
> +with the given name.
> +@end defmethod

This should say what happens if "name" is omitted.  It's optional,
right?

> +@defmethod Symtab_and_line macros
> +Returns all of the macros which are defined and not undefined or redefined,

"not redefined"? what exactly does this mean, and how can GDB
distinguish between something that is defined and something that is
defined and then redefined?

> +prior to the the @code{gdb.Symtab_and_line}'s line attribute.
> +Thus, all the macros which would be validly usable at that line.

I would rephrase:

 Returns all of the macros which are in effect for the source line
 given by the @code{gdb.Symtab_and_line}'s @code{line} attribute.

> +@defmethod Symtab macros
> +Return all of the macros contained in the symbol table.
> +@end defmethod

Return what, exactly? only their names? something else?

> +@code{gdb.Macro} class.  For obtaining a @code{gdb.Macro} object see
> +@xref{Symbol Tables In Python}.

You want "see @ref".  @xref produces a capitalized "Note:", which will
look as bad English; use @xref only at the beginning of a sentence.

> +@code{gdb.Macro} methods may produce a lazily created python copy from
                                                         ^^^^^^
"Python".

> +gdb's internal representation possibly returning different copies
   ^^^
@value{GDBN}

> +The @code{gdb.Macro} class should be considered an abstract class,
> +instances possibly being of different types.  Thus, you should always call
> +its functions directly from an instance, And never reference a method
                                            ^^^
"and"

> +@defmethod Macro argv
> +Returns a list of the macros arguments if the macro is function like.
> +If the macro is not function like, returns @code{None}

 Returns the argument list of the macro, or @code{None} if the macro
 does not accept arguments.

> +@defmethod Macro definition
> +Returns a string containing the definition of the macro.
> +@end defmethod

 Returns a string containing the macro body.

> +@defmethod Macro include_trail
> +Returns a list of tuples containing the filenames, and line numbers
                                                    ^
This comma is redundant.

> +of header and source files that correspond to the include directives,
> +and location of definition.  The list is sorted starting with the place
> +of definition, and ending with the first include directive.
> +@end defmethod

An example of this list of tuples would go a long way towards making
this description more clear.

> +@defmethod Macro is_function_like
> +Returns @code{True} If the macro is function like.
> +@end defmethod

  Returns @code{True} if the macro accepts arguments.

> +@defmethod Macro is_valid
> +Returns @code{True} if the macro is valid.

And presumably False otherwise.

> +All other @code{gdb.Macro} methods will throw an exception if the object is

What exception?  Is that important to document?

> +invalid at the time the method is called.
> +A macro which becomes invalid will never be valid again
> +without looking up the macro again to create a new @code{gdb.Macro}
> +object.
> +@end defmethod

Please tell here what does it mean for a macro to be "valid".  Also,
how to "look up the macro again".  Finally, it sounds like this method
should be the first one documented, as it is the only one that is
always usable.

Thanks.


  reply	other threads:[~2011-08-24 20:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 15:11 [PATCH 0/7] [python] API for macros matt rice
2011-08-24 15:11 ` [PATCH 2/7] [python] API for macros: memory management quirks matt rice
2011-08-26 20:40   ` Tom Tromey
2011-08-30 11:47   ` Phil Muldoon
2011-09-01 22:46     ` Matt Rice
2011-08-24 15:11 ` [PATCH 5/7] [python] API for macros: gdb.Objfile symtabs method matt rice
2011-08-30 13:08   ` Phil Muldoon
2011-09-01 23:18     ` Matt Rice
2011-09-02  1:07       ` Paul_Koning
2011-08-30 17:34   ` Tom Tromey
2011-09-02  0:56     ` Matt Rice
2011-08-24 15:11 ` [PATCH 1/7] [python] API for macros: abort or continuing macro iterators matt rice
2011-08-26 20:23   ` Tom Tromey
2011-08-30 11:10   ` Phil Muldoon
2011-09-01 21:48     ` Matt Rice
2011-08-24 15:12 ` [PATCH 3/7] [python] API for macros: Add gdb.Macro class matt rice
2011-08-30 12:45   ` Phil Muldoon
2011-09-01 22:57     ` Matt Rice
2011-08-24 15:12 ` [PATCH 4/7] [python] API for macros: Add methods to get a gdb.Macro matt rice
2011-08-30 13:04   ` Phil Muldoon
2011-08-30 17:41     ` Tom Tromey
2011-08-30 20:28       ` Phil Muldoon
2011-08-30 20:35         ` Phil Muldoon
2011-09-01 23:13           ` Matt Rice
2011-09-02  1:15             ` Paul_Koning
2011-09-02 10:04               ` Paul_Koning
2011-09-02 12:04             ` Phil Muldoon
2011-08-30 20:38         ` Tom Tromey
2011-08-30 20:58           ` Phil Muldoon
2011-08-24 15:12 ` [PATCH 6/7] [python] API for macros: Add docs matt rice
2011-08-24 20:10   ` Eli Zaretskii [this message]
2011-08-25 12:33     ` Matt Rice
2011-08-25 17:36       ` Eli Zaretskii
2011-08-26  8:04         ` Matt Rice
2011-08-26 10:42           ` Eli Zaretskii
2011-08-26 11:17             ` Matt Rice
2011-08-26 12:08               ` Eli Zaretskii
2011-08-26 14:06                 ` Matt Rice
2011-08-26 15:05                   ` Eli Zaretskii
2011-08-24 15:12 ` [PATCH 7/7] [python] API for macros: Add tests matt rice
2011-08-30 13:12   ` Phil Muldoon
2011-08-30 15:54   ` Tom Tromey
2011-08-30  9:44 ` [PATCH 0/7] [python] API for macros Phil Muldoon
2011-09-01 21:33   ` Matt Rice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k4a2h8qr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ratmice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox