6.5. Your program's working directory
Each time you start your program with run, it inherits its
working directory from the current working directory of gdb.
The gdb working directory is initially whatever it inherited
from its parent process (typically the shell), but you can specify a new
working directory in gdb with the cd command.
The gdb working directory also serves as a default for the commands
that specify files for gdb to operate on.
Refer to Section 17.1 Commands to specify files.
- cd directory
Set the gdb working directory to directory.
- pwd
Print the gdb working directory.