A few useful Xcode debugging tricks
pixel_tracing 2021-08-17 15:31:20 +0000 UTC [ - ]
I thought this would be for analyzing assembly with LLDB in Xcode :( left disappointed. Most of these are well known to advanced iOS engineers.
ElFitz 2021-08-17 11:29:08 +0000 UTC [ - ]
My biggest issue with Xcode breakpoints, especially with the conditional "Automatically continue after evaluating actions" ones, is how much they can slow down the app.
3grdlurker 2021-08-17 10:51:39 +0000 UTC [ - ]
For tracking gesture and scrolling events, though, breakpoint debugging is outright impossible to work with, and good ol’ print statements are still the best tools for the job.
Veserv 2021-08-17 19:52:17 +0000 UTC [ - ]
stinos 2021-08-17 11:04:11 +0000 UTC [ - ]
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 2021-08-17 11:15:44 +0000 UTC [ - ]
Veserv 2021-08-17 19:31:50 +0000 UTC [ - ]
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.