If you do not specify a directory and the file is not found in the GDB working directory, GDB uses the environment variable PATH as a list of directories to search, just as the shell does when looking for a program to run. You can change the value of this variable, for both GDB and your program, using the path command. GDB searches the environment variable PATH if necessary to locate your program. Omitting filename means to discard information on the executable file. Read symbol table information from file filename .
PATH is searched when necessary.
Use the file command to get both symbol table and program to run from the same file. For most kinds of object files, with the exception of old SVR3 systems using COFF, the symbol-file command does not normally read the symbol table in full right away. Instead, it scans the symbol table quickly to find which source files and which symbols are present. The details are read later, one source file at a time, as they are needed. The purpose of this two-stage reading strategy is to make GDB start up faster.