Skip to content
Browse files

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.
  • Loading branch information...
1 parent 393301c commit 08d7492cf0eab3165ca260b8aa060de8ae508e1c @wingo wingo committed
Showing with 5 additions and 0 deletions.
  1. +4 −0 gdbinit
  2. +1 −0 module/system/vm/program.scm
View
4 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
View
1 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))

0 comments on commit 08d7492

Please sign in to comment.
Something went wrong with that request. Please try again.