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. We have not implemented the two-stage strategy for COFF yet. When the symbol table is stored in COFF format, symbol-file reads the symbol table data in full right away. See --readnever. Traditionally, core files contain only some parts of the address space of the process that generated them; GDB can access the executable file itself for other parts.
Note that the core file is ignored when your program is actually running under GDB. So, if you have been running your program and you wish to debug a core file instead, you must kill the subprocess in which the program is running. To do this, use the kill command see Killing the Child Process. The add-symbol-file command reads additional symbol table information from the file filename.
You would use this command when filename has been dynamically loaded by some other means into the program that is running. If a section is omitted, GDB will use its default addresses as found in filename. Any address or textaddress can be given as an expression.
If an optional offset is specified, it is added to the start address of each section, except those for which the address was specified explicitly. The symbol table of the file filename is added to the symbol table originally read with the symbol-file command.
You can use the add-symbol-file command any number of times; the new symbol data thus read is kept in addition to the old. Although filename is typically a shared library file, an executable file, or some other object file which has been fully relocated for loading into a process, you can also load symbolic information from relocatable. Some embedded operating systems, like Sun Chorus and VxWorks, can load relocatable files into an already running program; such systems typically make the requirements above easy to meet.
Remove a symbol file added via the add-symbol-file command. The file to remove can be identified by its filename or by an address that lies within the boundaries of this symbol file in memory. For this command to work, you must have used symbol-file or exec-file commands in advance. The section command changes the base address of the named section of the exec file to addr.
This can be used if the exec file does not contain section addresses, such as in the a. Each section must be changed separately. The info files command, described below, lists all the sections and their addresses. The command help target lists all possible targets rather than current ones. Another command that can give you extra information about program sections is maint info sections. In addition to the section information displayed by info files , this command displays the flags and file offset of each section in the executable and core dump files.
The optional filter-list is a space separated list of filter keywords. Sections that match any one of the filter criteria will be printed. There are two types of filter:.
Before you issue the run command, GDB does not understand references to a function in a shared library, however--unless you are debugging a core file. While reading a symbol file, GDB occasionally encounters problems, such as symbol types it does not recognize, or known bugs in compiler output. By default, GDB does not notify you of such problems, since they are relatively common and primarily of interest to people debugging compilers.
Since debugging information can be very large—sometimes larger than the executable code itself—some systems distribute debugging information for their executables in separate files, which users can install only when they need to debug a problem. Depending on the way the debug info file is specified, GDB uses two different methods of looking for the debug file:. Global debugging info directories default to what is set by GDB configure option --with-separate-debug-dir.
Set the directories which GDB searches for separate debugging information files to directory. Multiple path components can be set concatenating them by a path separator.
You may want to specify executable and core dump file names. 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 Using the gdbserver program. In these situations the GDB commands to specify new files are useful.
All file-specifying commands allow both absolute and relative file names as arguments. GDB always converts the file name to an absolute file name and remembers it that way.
GDB automatically loads symbol definitions from shared libraries when you use the run command, or when you examine a core file.
0コメント