This section describes the GDB/MI commands to specify executable file names and to read in and obtain symbol table information.
-file-exec-and-symbols
Command-file-exec-and-symbols file
Specify the executable file to be debugged. This file is the one from which the symbol table is also read. If no file is specified, the command clears the executable and symbol information. If breakpoints are set when using this command with no arguments, gdb will produce error messages. Otherwise, no output is produced, except a completion notification.
The corresponding gdb command is ‘file’.
(gdb) -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx ^done (gdb)
-file-exec-file
Command-file-exec-file file
Specify the executable file to be debugged. Unlike ‘-file-exec-and-symbols’, the symbol table is not read from this file. If used without argument, gdb clears the information about the executable file. No output is produced, except a completion notification.
The corresponding gdb command is ‘exec-file’.
(gdb) -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx ^done (gdb)
-file-list-exec-source-file
Command-file-list-exec-source-file
List the line number, the current source file, and the absolute path to the current source file for the current executable. The macro information field has a value of ‘1’ or ‘0’ depending on whether or not the file includes preprocessor macro information.
The gdb equivalent is ‘info source’
(gdb) 123-file-list-exec-source-file 123^done,line="1",file="foo.c",fullname="/home/bar/foo.c,macro-info="1" (gdb)
-file-list-exec-source-files
Command-file-list-exec-source-files
List the source files for the current executable.
It will always output both the filename and fullname (absolute file name) of a source file.
The gdb equivalent is ‘info sources’.
gdbtk
has an analogous command ‘gdb_listfiles’.
(gdb) -file-list-exec-source-files ^done,files=[ {file=foo.c,fullname=/home/foo.c}, {file=/home/bar.c,fullname=/home/bar.c}, {file=gdb_could_not_find_fullpath.c}] (gdb)
-file-list-shared-libraries
Command-file-list-shared-libraries [ regexp ]
List the shared libraries in the program. With a regular expression regexp, only those libraries whose names match regexp are listed.
The corresponding gdb command is ‘info shared’. The fields
have a similar meaning to the =library-loaded
notification.
The ranges
field specifies the multiple segments belonging to this
library. Each range has the following fields:
(gdb) -file-list-exec-source-files ^done,shared-libraries=[ {id="/lib/libfoo.so",target-name="/lib/libfoo.so",host-name="/lib/libfoo.so",symbols-loaded="1",thread-group="i1",ranges=[{from="0x72815989",to="0x728162c0"}]}, {id="/lib/libbar.so",target-name="/lib/libbar.so",host-name="/lib/libbar.so",symbols-loaded="1",thread-group="i1",ranges=[{from="0x76ee48c0",to="0x76ee9160"}]}] (gdb)
-file-symbol-file
Command-file-symbol-file file
Read symbol table info from the specified file argument. When used without arguments, clears gdb's symbol table info. No output is produced, except for a completion notification.
The corresponding gdb command is ‘symbol-file’.
(gdb) -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx ^done (gdb)