I am trying to debug a guile scheme codebase. The codebase has the following files:
/home/user/Documents/takurtukur/tekuti:
base64.scm
boot.scm
cache.scm
classifier.scm
comment.scm
config.scm
filters.scm
git.scm
index.scm
marxdown.scm
match-bind.scm
mod-lisp.scm
page.scm
page-helpers.scm
post.scm
request.scm
tags.scm
template.scm
util.scm
web.scm
I also have a rough idea about the entry point and the which functions from which files get called:
boot function from boot.scm → ensure-git-repo from git.scm → call-with-temp-file from util.scm
I am trying to use guile repl inside emacs to insert a breakpoint in the boot function in the boot.scm file. I think I can use ,bp boot or ,bp ensure-git-repo commands in the repl for that. But before doing that I need to make sure that repl has loaded all these files and somehow starts executing the flow I descrubed above. I know how to add this directory to the load-path, and I do that. But after that, I don’t know how I can move on. I don’t wnt to write my own guile functions or edit the existing ones. I just want to juse repl to see the flow and check local variables. Where do I begin with this? I took hands on guile scheme for beginners course from @daviwil but that course showed me how to debug in the repl for a single code file loaded into the repl. In the case of this codebase, how does one begin?
I add the directory to the load-path:
scheme@(guile-user)> (display %load-path) (newline)
(~/Documents/takurtukur/ /usr/share/emacs/site-lisp/elpa/geiser-0.10/scheme/guile/ /usr/share/guile/3.0 /usr/share/guile/3.0 /usr/share/guile/site/3.0 /usr/share/guile/site /usr/share/guile)
scheme@(guile-user)>
Now I try to add a breakpoint to the boot
function in boot.scm file
scheme@(guile-user)> ,bp boot
Trap 0: Breakpoint at #<procedure boot (args)>.
scheme@(guile-user)> (boot)
;;; <stdin>:904:0: warning: possibly wrong number of arguments to `boot'
Trap 0: Breakpoint at #<procedure boot (args)>
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In current input:
86:0 0 (boot)
scheme@(guile-user) [1]> ,locals
No local variables.
scheme@(guile-user) [1]> ,step
Step into #<frame 73e1f1030100 boot>
scheme@(guile-user) [1]> ,bt
In current input:
86:0 1 (boot _)
In ice-9/boot-9.scm:
1754:4 0 (throw wrong-number-of-args #f "Wrong number of arguments to ~A" (#<proced…>) …)
scheme@(guile-user) [1]>
But this is the wrong boot funcction? It seems like it has put a breakpoint to the boot function in ice-9 library?