GDB Manual 15 1 15.1 Commands to specify files 指定文件的命令 You may want to specify executable and core dump file names. The usual way to do this is at start-up time, using the arguments to GDB's start-up commands (see section Getting In and Out of GDB). 你可以指定可执行文件和 core dump 文件的名称。通常的做法是在启动的时候,传递参数给启动 GDB 的命令(请看段“进入与退出 GDB” ) Occasionally it is necessary to change to a different file during a GDB session. Or you may run GDB and forget to specify a file you want to use. Or you are debugging a remote target via gdbserver (see section file). In these situations the GDB commands to specify new files are useful. 有时候需要在 GDB 的会话过程中改变为一个不同的文件。或者你可能在运行 GDB 后,忘记指定你想要的文件。或者你是在通过 gdbserver 调试一个远程目标(请看段“文件”)。 在这些情况下,用于指定新文件的 GDB 命令就变得很有用了。 file filename Use filename as the program to be debugged. It is read for its symbols and for the contents of pure memory. It is also the program executed when you use the run command. 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. 使用 filename 作为要调试的程序。它的符号表被读取,或者是单一的内存的内容。它也是你运行run 命令时执行的程序。如果没有指定目录,这一文件也没有在 GDB 的工作目录中找到, GDB 将使用环境变量 PATH 作为要搜索的目录列表,就像 shell 查找要运行的程序一样。你可以改变这一变量的值,用于 GDB 和你的程序,请使用 path 命令。 You can load unlinked object `.o' files into GDB using the fi...