A programmer doesn't need help from the library to stop the program just
before the abort: put the breakpoint on the aborting function ("free" in your
example) and skip the first non-aborting hits of the breakpoint (using gdb
'ignore' and 'info breakpoints' commands).
Alexander