From 08d7492cf0eab3165ca260b8aa060de8ae508e1c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 10 Dec 2009 16:03:23 +0100 Subject: [PATCH] add gbt macro to gdbinit, and fix a bug in program-arity * gdbinit: Add gbt macro, to make a Guile backtrace whenever you want. * module/system/vm/program.scm (program-arity): If ip is #f, just take the first arity. --- gdbinit | 4 ++++ module/system/vm/program.scm | 1 + 2 files changed, 5 insertions(+) diff --git a/gdbinit b/gdbinit index 812f04b59..fdc9c759b 100644 --- a/gdbinit +++ b/gdbinit @@ -198,3 +198,7 @@ end define inst p scm_instruction_table[$arg0] end + +define gbt + call scm_display_backtrace (scm_make_stack(0x404,0x304), scm_current_error_port (), 0x704, 0x704, 0x704) +end diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm index 99f9a3cb9..31b667bb0 100644 --- a/module/system/vm/program.scm +++ b/module/system/vm/program.scm @@ -121,6 +121,7 @@ (and arities (let lp ((arities arities)) (cond ((null? arities) #f) + ((not ip) (car arities)) ; take the first one ((and (< (arity:start (car arities)) ip) (<= ip (arity:end (car arities)))) (car arities))