What is a symbol file gdb


















Contrary to whatis , ptype always unrolls any typedef s in its argument declaration, whether the argument is a variable, expression, or a data type. This means that ptype of a variable or an expression will not print literally its type as present in the source code—use whatis for that. Only typedef s of fields, methods and inner class typedef s of struct s, class es and union s are not unrolled even with ptype. Sometimes, programs use opaque data types or incomplete specifications of complex data structure.

For example, given these declarations:. This most often happens when the program or library where the variable is defined includes no debug information at all. Inspecting the type of a global variable for which GDB has no type information shows:. See no debug info variables , for how to print the values of such variables.

Print a brief description of all types whose names match the regular expression regexp or all types in your program, if you supply no argument. This command differs from ptype in two ways: first, like whatis , it does not print a detailed description; second, it lists all source files and line numbers where a type is defined. When using ptype or whatis , these printers are consulted when the name of a type is needed.

List all the variables local to a particular scope. See Specify Location , for details about supported forms of location. For example:. This command is especially useful for determining what data to collect during a trace experiment , see collect.

Show information about the current source file—that is, the source file for the function containing the current point of execution:. The source files are presented based on a list of object files executables and libraries currently loaded into GDB.

For each object file all of the associated source files are listed. Each source file will only be printed once for each object file, but a single source file can be repeated in the output if it is part of multiple object files. If the optional regexp is provided, then only source files that match the regular expression will be printed. The matching is case-sensitive, except on operating systems that have case-insensitive filesystem e. By default, the regexp is used to match anywhere in the filename.

If -dirname , only files having a dirname matching regexp are shown. If -basename , only files having a basename matching regexp are shown. It is possible that an object file may be printed in the list with no associated source files.

This can happen when either no source files match regexp , or, the object file was compiled without debug information and so GDB is unable to find any source file names.

Print the names and data types of all defined functions. If regexp is provided, print only the functions whose names match the regular expression regexp. If a function name contains characters that conflict with the regular expression language e. If needed, use backslash to escape the meaning of special characters or quotes. Print the names and data types of all variables that are defined outside of functions i.

The printed variables are grouped by source files and annotated with their respective source line numbers. Like info variables , but only print the variables selected with the provided regexp s. 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:. Display information for any section with section-flag. The section flags that GDB currently knows about are:. Section will have space allocated in the process when loaded. Set for all sections except those containing debug information. Section will be loaded from the file into the child process memory. Set for pre-initialized code and data, clear for.

For each target GDB maintains a table containing the allocatable sections from all currently mapped objects, along with information about where the section is mapped. Tell GDB that readonly sections in your object file really are read-only i. In that case, GDB can fetch values from these sections out of the object file, rather than from the target program.

For some targets notably embedded ones , this can be a significant enhancement to debugging performance. Tell GDB not to trust readonly sections. January 5th, 1. Symbols are a fundamental requirement for debugging and other diagnostic tools. Windows or. NET libraries. Additionally because symbols are so fundamental to debugging , we continue to make tweaks to the experience so understanding the ins and outs of how Visual Studio behaves can save you hours of frustration. The other ways to determine if symbols are loaded:.

If you are using TFS read about how to add symbol and source archiving support. The symbol file location box tells the debugger where to look for symbol files, these can be http symbol servers e.

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.

If you are interested in seeing information about ill-constructed symbol tables, you can either ask GDB to print only one message about each such type of problem, no matter how many times the problem occurs; or you can ask GDB to print more messages, to see how many times the problems occur, with the set complaints command see section Optional warnings and messages.



0コメント

  • 1000 / 1000