reloadware / reloadium

Hot Reloading and Profiling for Python
https://reloadium.io
Apache License 2.0
2.74k stars 56 forks source link

why automatically jumps to some breakpoint far away from X #149

Closed sajsxj closed 1 year ago

sajsxj commented 1 year ago

In debug, when I add a comment on line x, and there is a breakpoint above and below line x, after saving, the program automatically jumps to some breakpoint far away from X. I would like to know how to solve it, thank you very much

dkrystki commented 1 year ago

Hi @sajsxj Could you provide more details? I can't reproduce it. Which version of the plugin are you using? Does it always happen or only sometimes?

dkrystki commented 1 year ago

Also is the breakpoint it jumps to in the same function or a different one?

sajsxj commented 1 year ago

@dkrystki Ok, let me redescribe the problem I encountered, and the rest of the description is in the debug case.

I have attached some pictures below. When the program reaches the last breakpoint, modify the comment two. After the hot load file is executed, the program will automatically jump to the first breakpoint So how do you get it to jump to the point closest to comment two

Also, I would like to know if there is an option to set up a hot reload file manually or automatically

thanks!!!

image image
sajsxj commented 1 year ago

Sorry, I forgot to tell you the version, reloadium1.1.1 emmm, maybe it is my improper use. I just started using it yesterday, and I hope you can give me some help

sajsxj commented 1 year ago

The jump also goes to the current function

dkrystki commented 1 year ago

Oh I see. It's not really a bug. When debugging a function Reloadium restarts the whole body of the function on a change. That is why your first breakpoint is hit. Back in the days Reloadium would disable breakpoints before the current one to prevent that. I removed that behavior since it can be beneficial to step through a function once the code is changed.

sajsxj commented 1 year ago

ok, I see! Thank you very very very much!!!!

dkrystki commented 1 year ago

You're welcome!