From: Eli Zaretskii <eliz@gnu.org>
To: Andy Wingo <wingo@igalia.com>
Cc: gdb-patches@sourceware.org, xdje42@gmail.com
Subject: Re: [PATCH] Add Guile frame filter interface
Date: Sun, 15 Feb 2015 16:50:00 -0000 [thread overview]
Message-ID: <83vbj3unk0.fsf@gnu.org> (raw)
In-Reply-To: <87oaov5s98.fsf@igalia.com>
> From: Andy Wingo <wingo@igalia.com>
> Cc: Andy Wingo <wingo@igalia.com>, Doug Evans <xdje42@gmail.com>
> Date: Sun, 15 Feb 2015 12:27:47 +0100
>
> The attached patch exposes the frame filter interface to Guile. It's
> mostly modelled on the Python interface, but has a more functional
> flavor. No test cases yet, but I figure there will be a round of
> comments so it's probably worth getting this out early.
>
> Thoughts?
A few comments regarding the documentation part:
First, I think this warrants a NEWS entry.
> +@node Guile Frame Filter API
> +@subsubsection Filtering Frames in Guile
> +@cindex frame filters api
I would add ", guile" to the index entry, to make it more specific.
> +are affected. The commands that work with frame filters are:
> +
> +@code{backtrace} (@pxref{backtrace-command,, The backtrace command}),
> +@code{-stack-list-frames}
> +(@pxref{-stack-list-frames,, The -stack-list-frames command}),
> +@code{-stack-list-variables} (@pxref{-stack-list-variables,, The
> +-stack-list-variables command}), @code{-stack-list-arguments}
> +@pxref{-stack-list-arguments,, The -stack-list-arguments command}) and
> +@code{-stack-list-locals} (@pxref{-stack-list-locals,, The
> +-stack-list-locals command}).
I don't really like this style of "itemized list with
cross-references", IMO it looks ugly. Please consider using some more
traditional format, like a @table maybe. But if you like the results
of this, I won't argue more.
> +reorganize, insert, and remove frames. @value{GDBN} also provides a
> +more simple @dfn{frame annotator} API that works on individual frames,
In general, any thing you put inside @dfn should have a @cindex entry.
> +There can be multiple frame filters registered with @value{GDBN}, and
> +each one may be individually enabled or disabled at will. Multiple
> +frame filters can be enabled at the same time. Frame filters have an
> +associated @dfn{priority} which determines the order in which they are
Here, I question the need for having "priority" in @dfn: it's not new
terminology.
> +should be a number, and which defaults to 20 if not given. By
> +default, the filter is @dfn{global}, meaning that it is associated
Likewise here for "global".
> +annotated frame is always associated with a GDB frame object. To
^^^
@value{GDBN}
> +object that inherits all fields from @var{x}, but whose function name
> +has been set to @code{"foo"}.
I find the results of @code{"foo"} to be awkward, at least in the Info
manual. I suggest to use @samp{foo} instead. (I understand that you
wanted to make it clear this is a string, but I think these double
quotes are not really necessary, as everybody understands that it's a
string from what the text says.)
> +@deffn {Scheme Procedure} annotated-frame-arguments ann
> +Return a list of the function arguments associated with the annotated
> +frame @var{ann}. Each item of the list should either be a GDB symbol
> +(@pxref{Symbols In Guile}), a pair of a GDB symbol and a GDB value
> +(@pxref{Values From Inferior In Guile}, or a pair of a string and a
> +GDB value. In the first case, the value will be loaded from the frame
> +if needed.
@value{GDBN}, 4 times
> +Annotated frames may also have @dfn{child frames}. By default, no
> +frame has a child frame, but filters may reorganize the frame stream
> +into a stream of frame trees, by populating the child list. Of
> +course, such a reorganization is ultimately cosmetic, as it doesn't
> +alter the stack of frames seen by @value{GDBN} and navigable by the
> +user, for example by using the @code{frame} command. Still, nesting
> +frames may lead to a more understandable presentation of a backtrace.
> +
> +@deffn {Scheme Procedure} annotated-frame-children ann
> +Return a list of the @dfn{child frames} function name associated with
Even the first instance of @dfn{child frames} is questionable, IMO;
having 2 of them is way too much.
> +While frame filters can both reorganize and reannotate the frame
> +stream, it is often the case that one only wants to reannotate the
> +frames in a stream, without reorganizing then. In that case there is
> +a simpler API for @dfn{frame annotators} that simply maps annotated
> +frames to annotated frames.
You already introduced "frame annotators" earlier, so no need to use
@dfn here.
> +@value{GDBN}. @var{annotator} should be a function of one argument,
> +takingn annotated frame object and returning a possibily modified
^^^^^^^
A typo.
> +@node Writing a Frame Filter in Guile
> +@subsubsection Writing a Frame Filter in Guile
> +@cindex writing a frame filter
This @cindex entry should be qualified with "in guile" or some such.
> +the case, because unlike normal Scheme procedures, @code{stream-cons}
> +is @dfn{lazy} in its arguments, which is to say that its arguments are
Again, @dfn is wrong here.
In all the cases where I commented on incorrect @dfn usage, if what
you wanted was to have the text in italics, just use @emph instead.
Thanks.
next prev parent reply other threads:[~2015-02-15 16:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-15 11:28 Andy Wingo
2015-02-15 16:50 ` Eli Zaretskii [this message]
2015-02-16 13:48 ` Andy Wingo
2015-02-22 21:54 ` Doug Evans
2015-03-04 13:07 ` Andy Wingo
2015-03-17 16:29 ` Doug Evans
2015-02-27 15:40 ` Ludovic Courtès
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=83vbj3unk0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=wingo@igalia.com \
--cc=xdje42@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).