4 ms·
good ol’ print statements are still the best tools for the job Apart from breakpoints debuggers (just not lldb if I'm not mistaken) can also support 'tracepoin
by stinos 5y ago
good ol’ print statements are still the best tools for the job
Apart from breakpoints debuggers (just not lldb if I'm not mistaken) can also support 'tracepoints' i.e. register a certain code location for having a custom string being printed. Can be better and more convenient than print statetemnts especially because it doesn't change the program. Also great when you have bugs which disappear after adding print statements.
- victorthehuman 5y agoThe problem with those types of breakpoints is that they slow down the app considerably. Put one of those in a tight loop and the timing related bug you're after could be gone.
- Veserv 5y agoOnly if they are implemented inefficiently or your application is constrained in a way that precludes efficient implementation. As long as you can inject code and steal some memory you can just directly patch in the code snippet and patch in a branch instead of a breakpoint instruction. This is functionally equivalent to a adding a print statement, just at runtime instead of compile time, so should not be significantly slower.