This is the mail archive of the 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 v2 02/36] Guile extension language: doc additions

Doug Evans <> skribis:

> On Mon, Jan 20, 2014 at 7:37 PM, Eli Zaretskii <> wrote:
>>> Date: Mon, 20 Jan 2014 14:00:03 -0800
>>> From: Doug Evans <>
>>> Cc: "" <>
>>> On Mon, Jan 20, 2014 at 1:52 PM, Doug Evans <> wrote:
>>> > This patch has the doc additions.
>>> > There's still some to be written, but I think it's in good enough shape
>>> > to get feedback on.
>>> >
>>> > Changes from v1:
>>> > - NEWS file added
>>> > - guile.texi updated based on feedback
>>> > - new section on gdb smobs
>>> > - add more text to "Iterators In Guile" node
>>> >
>>> > 2014-01-20  Doug Evans  <>
>>> >
>>> >         * NEWS: Mention Guile scripting.
>>> >
>>> >         doc/
>>> >         * (GDB_DOC_FILES): Add guile.texi.
>>> >         * gdb.texinfo
>>> >         * guile.texi: New file.

Overall looks good to me.

> ++The implementation uses Guile's @dfn{smob} (small object)
> ++data type for all @value{GDBN} objects
> ++(@pxref{Defining New Types (Smobs),,, guile, GNU Guile Reference Manual}).
> ++This allows gluing Guile into @value{GDBN} very easily.

SMOBs are a mechanism to define new Scheme data types, rather than a
data type in itself.

More importantly, Iâm not sure whether itâs worth mentioning it here.
What about replacing these two sentence with something like
â@value{GDBN} defines several Scheme data types.â?

> ++@node GDB Smobs
> ++@subsubsection GDB Smobs
> ++@cindex gdb smobs

And definitely, the heading should be âGDB Scheme Data Typesâ or
similar, IMO.

> ++@value{GDBN} uses Guile's @dfn{smob} (small object)
> ++data type for all @value{GDBN} objects
> ++(@pxref{Defining New Types (Smobs),,, guile, GNU Guile Reference Manual}).
> ++The smobs that @value{GDBN} provides are called @dfn{gmobs}.

That one is OK since it helps introduce âgmobâ.  ;-)

> ++Every @code{gsmob} provides a common set of functions for extending
> ++them in simple ways.  Each @code{gsmob} has a list of properties,
> ++initially empty.  These properties are akin to Guile's object properties,
> ++but are stored with the @code{gsmob}

Perhaps add âfor improved efficiencyâ (I assume thatâs the reason,

>  +(define iter (make-iterator my-list my-list
>  +  (lambda (iter)

The indentation is wrong here (put â(make-iteratorâ on the next line.)

>  +@smallexample
> -+(use-modules (gdb experimental))
> ++(use-modules (gdb iterator))
>  +(define this-sal (find-pc-line (frame-pc (selected-frame))))
>  +(define this-symtab (sal-symtab this-sal))
>  +(define this-global-block (symtab-global-block this-symtab))
>  +(define syms-iter (make-block-symbols-iterator this-global-block))
> -+(define functions (iterator-filter symbol-function? syms-iter #f))
> ++(define functions (iterator-filter symbol-function? syms-iter))

(The obvious âiterator->listâ procedure would be nice.)

> ++@deffn {Scheme Procedure} iterator-map proc iterator
> ++Return a list of @var{proc} applied to each element of @var{iterator}.

What about:

  Return the list of objects obtained by applying @var{proc} to the object
  pointed to by @var{iterator} and to each subsequent object.

> ++@deffn {Scheme Procedure} iterator-filter pred iterator
> ++Return as a list the elements of @var{iterator} that satisfy @var{pred}.

  Return the list of elements pointed to by @var{iterator} that satisfy



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