To run inside MacOS under gdb you need:
set dont-handle-bad-access 1
handle SIGBUS nostop noprint

To run in Linux under gdb, use:
handle SIGSEGV nostop noprint