In bash, I can use the script command, which dumps everything that shows on the shell to a file, including:
- commands typed
- PS1 line
- stdout and stderr of commands
What is the equivalent in gdb?
I tried to run shell script from inside GDB, but after I hit return, I was in the shell and lost the shell prompt and could not run command any more. Moreover I could not use ctrl+c or ctrl+\ to exit. I needed to force kill the /bin/login tty2 to exit.
script, it is a (horribly generically named) executable from linux-util. I've explained what it does a bit.