This is mostly the same as on_error_query except that we use our own backtrace function, much more complete.
prog_name must be the current program name (argv[0]). It does nothing on Win32.
prog_name
the program to attach to.