Re:Ask HN: Do You Use a Debugger?
by juangacovas on Sunday August 22, 2021 @10:34AM
(#28265792)
Well, a debugger on a breakpoint should allow you to inspect any local scope variables along the globals, go through the call stack.. And you can watch vars, execute immediate commands and more in others. If that's not "print" on breakpoint...
Re:Ask HN: Do You Use a Debugger?
by sirwhinesalot on Sunday August 22, 2021 @02:28PM
(#28268090)
I don't want to print on a breakpoint, that is again useless, the cause of the problem might be far removed from the location of the exception. I want multiple breakpoints, each of which prints data, so I get a log of the behaviour of the relevant parts of the program overtime.
Being able to stop the program at a single point does not help, not unless I can actively move backwards in time (not in the stack!) like in the Elm debugger (actually useful).
Re:Ask HN: Do You Use a Debugger?
by 369548684892826 on Sunday August 22, 2021 @02:10PM
(#28267925)
> Your Java program throws some random NullPointerException? Prints, and lots of them.
Or just tell your debugger to break on exception.
Re:Ask HN: Do You Use a Debugger?
by sirwhinesalot on Sunday August 22, 2021 @02:23PM
(#28268045)
That's useless, debugging a NPE is about figuring out where the null originated. Breaking on the exception is too late.
Re:Ask HN: Do You Use a Debugger?
by marcolinux on Tuesday August 24, 2021 @04:21AM
(#28286280)
java 14, helpful NullPointerExceptions? https://openjdk.java.net/jeps/358
For low level code where you really want to see all the program/function state evolving over time, they can be useful.
Your Java program throws some random NullPointerException? Prints, and lots of them. The experience with the debugger is miserable. I set a breakpoint somewhere, then do I jump or step or whatever? Who knows, all I know is whichever I pick is the wrong one everytime.
I saw another poster mention a debugger that lets you put breakpoints that print stuff. Now that would make me use a debugger all the time. Maybe the debuggers I have used already support that, I certainly wouldn't know if they do, they didn't make it discoverable.