freenode/#sbcl - IRC Chatlog
Search
10:37:28
lukego
Hey when I do `C-c C-k' in SLIME and hit a compile-time error during compilation - sldb debugger pops up - is there an easy way to see how that relates to the source code that's being compiled? I'm finding the backtrace from the sbcl compiler pretty opaque
10:48:26
phoe
lukego: sldb does not pop up during read errors or macroexpansion errors, I get *slime-compilation* pop up instead
10:49:17
phoe
load-time errors, like a file containing (defun foo () (error "asdfsfsdf")) (foo), cause SLDB to pop up but then you should get a decent stack trace - in my case (foo) is on the stack
11:01:25
lukego
thanks, I'll pay more attention next time, I was just fishing in case there was an answer like "yeah press C-a C-b C-c to highlight the current source form being compiled"
11:04:03
phoe
lukego: I mean, it likely won't be able to give you this data, because it has already compiled everything that it could
11:05:34
lukego
okay here's a concrete example. I compile a file containing the form (defclass foo (foo) ()). This brings up a debugger telling me that a class cannot be its own superclass. In this context can I call up the source code where this line occurs?
11:07:13
phoe
the question is whether there is a link between the FASL command that is currently being loaded and the concrete source location
11:07:31
lukego
ah! but that should almost make it easier right, since source locations will exist for the compiled code?
11:08:44
lukego
yeah and I guess whether that source information is preserved when putting the values into a fasl. okay cool, I'll add this to my list of issues that I could dive into to better understand sbcl internals
11:08:46
phoe
we have a form that is sorta-not-yet-loaded so it is not yet put in the internal xref databases, but there should be source location in the FASL
11:09:19
phoe
I think that it would be a nice improvement to make it usable, or if it already exists, then document and publish this information somehow
11:10:02
phoe
because I don't know if it doesn't already exist in some form, it's just not in plain sight
11:11:15
lukego
yeah that's okay I'd rather consult the source anyway, I need to get into that habit
11:18:29
luis
lukego: in your example, pressing v on the ((sb-c::top-level-form ...)) frame jumps to the defclass form. Does that help?
11:21:43
lukego
oh now I see it. that line even appears in green to stand out from the noisy internals. thanks!
11:22:46
lukego
yeah. what else do you set? I actually have the form (declaim (optimize (speed 1) (safety 3) (debug 3))) lying around but evidently it's not loaded by my asdf system def
11:24:24
lukego
hm I evaluated that form but `C-c C-k' didn't change behaviour. works if I put it into the same source file, but I thought declaim was side-effecting on the global env?
11:27:32
lukego
anyone have some .sbclrc type examples I can crib from? I'm surely missing more good stuff than just this
11:29:17
lukego
hm but would restricting to minimum 3 mean that I can't override that locally e.g. (defun x (declare (optimize (debug 0))) ...) ? I'd want to be able to do that e.g. just when playing with the compiler