Integrated debuggers


#1

Yes - the debugger :slight_smile: Use the debugger … get the stack trace when in crashes, inspect the local variables the cause is usually staring you in the face*

Except when it isn’t and you spend 2 days hunting*

**I’ve noticed that with a bit of experience the 2 days is now more like 2 minutes for a difficult one… but it definitely used to be two days.


#2

Break points before everything is screwed up usually helps more!


#3

Last occasion of the thing you mention, it was a memory corruption copying a small negative number of bytes casted to unsigned int for memcpy. No way to find that by staring at the debugger. It was even in a different thread!

I go with DBG() and starting from a terminal…


#4

AAA (Almost Always Asan)
(and coming in Xcode 9 Undefined Behaviour Sanitizer!!!)


#5

Asan?

https://www.google.co.uk/search?q=asan


#6

AddressSanitizer. Sixth result: https://www.chromium.org/developers/testing/addresssanitizer

More details about it here: https://clang.llvm.org/docs/AddressSanitizer.html