gdb thread apply all bt to a file. (gdb) set logging on Copying outpu