This patch adds a new ASan flag, dump_registers (off by default), which after a SIGSEGV prints out all CPU registers. These are available in the signal handler context. The use case is when you're not running under the debugger, and you end up with a SIGSEGV ASan report, which doesn't contain much information – knowing the register values can be helpful here. Another interesting case is on x86_64, where if you fault on a non-canonical address (e.g. 0xdeaddeaddeaddead), this address is not propagated into siginfo->si_addr and is only located in one of the registers.
I only implemented the Darwin part and left the other functions (Linux, Windows) empty in hopes that some good soul will fill these in :)