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

Fix debugger quit for http handler functions #695

Merged
merged 1 commit into from
Apr 11, 2021

Conversation

Cartmanishere
Copy link
Contributor

Fixes #689

In the break function, we reset the :skip in STATE when the debuggable function is called again.
This is checked using the coor as follows --

(if-let [first-coor @(:session-id STATE__)]
    (when (= first-coor coor)
      (reset! (:skip STATE__) false)
    (reset! (:session-id STATE__) coor))

But in case of functions called via HTTP --

  • We skip breakpoints not using the STATE__ but by setting *skip-breaks* atom as {:mode :all}.
  • Hence along with resetting STATE__ on function being called again, we also need to reset the *skip-breaks* atom.

This fixes the behavior of :continue-all and :quit commands for functions being called via HTTP.

@@ -502,7 +502,8 @@ this map (identified by a key), and will `dissoc` it afterwards."}
[coor val locals STATE__]
(if-let [first-coor @(:session-id STATE__)]
(when (= first-coor coor)
(reset! (:skip STATE__) false))
(reset! (:skip STATE__) false)
(skip-breaks! false))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add some explanatory comments here, so this part of the code is easier to understand for future readers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add comment.

@bbatsov
Copy link
Member

bbatsov commented Apr 11, 2021

Great catch! I'm sure that a lot of people will be thrilled by this fix.

@bbatsov bbatsov merged commit fd55e5f into clojure-emacs:master Apr 11, 2021
@bbatsov
Copy link
Member

bbatsov commented Apr 11, 2021

Thanks!

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

Successfully merging this pull request may close these issues.

Debugger breaks on quit when debugging function called via http
2 participants