filename means to discard information on the

 

executable file.

symbol-file [ filename ]

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.

 

symbol-file with no argument clears out GDB

 

information on the symbol table of your program.

 

The symbol-file command causes GDB to forget

 

the contents of its convenience variables, the

 

value history, and all breakpoints and

 

auto-display expressions. This is because they

 

may contain pointers to the internal data

 

recording symbols and data types, which are part

 

of the old symbol table data being discarded

 

inside GDB.

 

symbol-file does not repeat if you press RET

 

again after executing it once. When GDB is

 

configured for a particular environment, it

 

understands debugging information in whatever

 

format is the standard generated for that

 

environment; you may use either a gnu compiler,

 

or other compilers that adhere to the local

 

conventions.

 

For most kinds of object files, the symbol-file

 

command does not normally read the symbol

 

table in full right away. Instead, it scans the

 

symbol table quickly to nd 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. For the most part,

 

it is invisible except for occasional pauses while

 

the symbol table details for a particular source

 

file are being read. (The set verbose command

 

can turn these pauses into messages if desired.

 

See “Optional warnings and messages”

 

(page 284).)

symbol-file filename [

You can override the GDB two-stage strategy for

-readnow ] [ -mapped ], file

reading symbol tables by using the `-readnow'

126 GDB Files