Take_cheeze Wiki
Advertisement

Address Sanitizer[]

  • Memory error detector that can be used in clang and gcc.
    • In Xcode clang it's disabled so you need to use MacPorts clang or other non-Apple clang to enable it.
  • Algorithm
    • basically overwrites memory access operation generated by compiler
    • though the important part is how to speed up the overwrited operation
  • debugger setting
    • to stop before report set breakpoint to __asan_report_error which will be called by __asan_report_{load,store}{1,2,4,8,16}
    • to stop after report set env "ASAN_OPTIONS=abort_on_error=1" or set a breakpoint to AsanDie

Instruments[]

  • Profiling tool installed with Xcode

gdb[]

command short
backtrace bt print backtrace in current state
run r restart executable
break b set break point

addr2line[]

Demangle[]

Backtrace[]

tracef[]

  • example
  • command to trace all function calls.
Advertisement