redirecting gdb's stdin doesn't work on Mac... hopefully portable enough