libGDB architecture - Guile interface #2

Martin Baulig
Mon Aug 30 15:02:00 GMT 1999


after my previos mail with a general introduction about the current
state of my guile interface here comes some kind of real proposal ...

Rather than some kind of abstract structure like

>      (breakpoint
>       ((number 1)
>        (type "breakpoint")
>        (disp "keep")
>        (enabled "y")
>        (addr "0x0000003d")
>        (func "main")
>        (file "hello.c" 3)))

we should IMHO use record types for this - for instance

(define-public gdb-frame-record
  (make-record-type "gdb-frame-record"
    '(type level file line mid pc function language)))

(define-public gdb-breakpoint-record
  (make-record-type "gdb-breakpoint-record"
    '(number type disp enabled addr func file line)))

Internally (in the builder routine) this can be accessed very efficiently
via scm_struct_ref () and scm_struct_set_x () - the code'll look up the
positions once via (list-index) in (record-fields (gdb-xxx-record)), so
this will work fine when new fields are added (and even when some are

Aditionally, we should define some set of exceptions and symbols for all
error conditions so the error handling code on the client's side doesn't
need to parse strings (and that it can also easily convert an exception
from the gdb-guile code to something like a CORBA exception).

For instance, the code should raise a `gdb-error' (with "gdb-error" interned
as a symbol) with `no-stack' as the argument (and "no-stack" again interned
as a symbol).

This is just a first proposal and of cause subject of discussion, but it
should be a good starting point.

Martin Baulig - -

More information about the Gdb mailing list