Effective debugging: print("got this far") ... print("got this far1") ... ... ... ... print("got this far7")
-
-
Vastauksena käyttäjille @PPathole ja @Peter_shirley
What? There is some other way?
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
A former colleague of mine, who was leader for a UNIX-based mission-critical commercial debugger, told me their biggest competitor was the print statement.
2 vastausta 3 uudelleentwiittausta 13 tykkäystä -
Vastauksena käyttäjille @TFDahl, @Peter_shirley ja
I can well believe it. TBH I do wish you could add print statements using the IDE in the same way you can add breakpoints. Saves having a macro, saves typing, easy to toggle, saves the perf impact of attaching a debugger.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @oconnorkg, @TFDahl ja
Visual Studio has exactly what you're asking for. You can log a message to the output window and not stop execution.https://docs.microsoft.com/en-us/visualstudio/debugger/using-breakpoints?view=vs-2019#BKMK_Print_to_the_Output_window_with_tracepoints …
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Cool, but I’m assuming that requires the debugger to be attached - which I’ve always found slows the process down a fair bit with msvc. That becomes a big problem if you’re tying to debug some large file io bug.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @oconnorkg, @TFDahl ja
You wanted to be able to add print statements "in the same way" you add breakpoints. Of course you need a debugger attached. Yes, the process is slower. Everything has trade offs. Not every problem can be solved with the same tool.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä
But you asked for a thing. The thing exists. Not sure what the issue is here.
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.