I'm working on Swift interpreter and the codebase is fairly difficult to debug. There's a lot of reused bits. So if you put a debug point somewhere trying to capture one behavior, odds are that that line will run 10 times for other work before the relevant part uses it.
So I tend to write a LOT of print statements that flush of debug variables right before I where I want to debug. Then I set a conditional breakpoint so that I can have the logs "stop" right where I want the program to.
Example:
// debug print
let someValueICareAbout = variable...
print(someValueICareAbout)
print("") <- conditional debug point here "if someValueICareAbout == 3"
I think it's technically still "print debugging", because I'm only using the debugger to stop the program so I get a chance to read my output.
So I tend to write a LOT of print statements that flush of debug variables right before I where I want to debug. Then I set a conditional breakpoint so that I can have the logs "stop" right where I want the program to.
Example:
// debug print
let someValueICareAbout = variable...
print(someValueICareAbout)
print("") <- conditional debug point here "if someValueICareAbout == 3"
I think it's technically still "print debugging", because I'm only using the debugger to stop the program so I get a chance to read my output.