[PATCH] Add Guile frame filter interface

Andy Wingo wingo@igalia.com
Mon Feb 16 13:48:00 GMT 2015


Hi,

Thank you for the review, Eli.  I attach an updated patch that fixes the
things you pointed out.  This patch also adds test cases, copied from
the Python tests, and fixes a few things in the scm-frame-filter.c /
frames.scm that allow the tests to work.

A couple of notes.  One, there are no associated GDB commands like "info
frame-filters" and the like, as those are implemented in Python for the
Python interface, so there is no central list of filters in GDB.  That's
probably fine for now, but worth noting.

Another note is that I use a mechanism in which any error or interrupt
causes a Scheme exception to be raised, for example if user code signals
an error or if the user interrupts a backtrace.  The whole frame-filter
interface is wrapped in a gdbscm_safe_call(), which will catch
exceptions and print error messages.  For me this is the natural way to
use the libguile interface.  I arrange to run cleanups when Scheme
exceptions occur, and to turn GDB exceptions into Scheme exceptions.
However I saw that GDB is switching to C++ and plans on using RAII and
C++ exceptions.  The strategy I use in this file will work fine with
this, as there will not be any live RAII data that a Scheme exception
might unwind; there's just one pair of macros that would need to be
redefined.  I'd probably write this code differently if RAII and
exceptions were already in place, but I don't see this new code as being
incompatible with the exception-using refactor.

Regards,

Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-Guile-frame-filter-interface.patch
Type: text/x-diff
Size: 129225 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150216/efa2af24/attachment.bin>


More information about the Gdb-patches mailing list