Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebind invoke-debugger instead of this whole library? #7

Open
aartaka opened this issue May 25, 2023 · 2 comments
Open

Rebind invoke-debugger instead of this whole library? #7

aartaka opened this issue May 25, 2023 · 2 comments

Comments

@aartaka
Copy link
Contributor

aartaka commented May 25, 2023

So it seems that invoke-debugger is a function being the sole entry point into toplevel debugger. Redefining invoke-debugger should be a simple way to allow any debugger, including a GUI one. Which kind of makes this library useless, because we can set Nyxt-internal (not internal really, it's image-global) invoke-debugger to invoke GUI. Will be much cleaner too, I believe...

CC @Shinmera (because I remember you expressing the need in custom debuggers, tell me if that's not relevant anymore.)

@Shinmera
Copy link

Shinmera commented May 25, 2023

It seems like you want https://github.com/phoe/trivial-custom-debugger

E: disregard, you already linked it in the readme. I don't really know what I would want here, so I'm kinda lost on this.

@aartaka
Copy link
Contributor Author

aartaka commented May 25, 2023

It seems like you want https://github.com/phoe/trivial-custom-debugger

Yeah, ndebug is already using it :)

But the problem with both trivial-custom-debugger and ndebug here is that both rely on *debugger-hook* and implementation-specific debugger hooks, which are often too restrictive to make custom debuggers. So there are nasty hacks to make it work.

While invoke-debugger is the ultimate resort for custom debugger, because there are only three requirements for it:

  • Debugger hooks are already exhausted (easy—bind them to NIL).
  • It accepts a single argument—the condition to debug (easy—it happens automatically, because invoke-debugger is mostly called by Lisp image).
  • It should not return normally—only via restarts.

Nothing about *query-io* (which is required for *debugger-hook*) etc. So it's absolutely friendly to GUI or any other alternative debugging approach imaginable.

I don't really know what I would want here, so I'm kinda lost on this.

Well, now you know that if debugger hooks are not enough or are clumsy to use, just bind them to NIL and rebind invoke-debugger to something you want :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants