23.2.2.18 Symbol table representation in Python.

Access to symbol table data maintained by gdb on the inferior is exposed to Python via two objects: gdb.Symtab_and_line and gdb.Symtab. Symbol table and line data for a frame is returned from the find_sal method in gdb.Frame object. See Frames In Python.

For more information on gdb's symbol table management, see Examining the Symbol Table, for more information.

A gdb.Symtab_and_line object has the following attributes:

— Instance Variable of Symtab_and_line: symtab

The symbol table object (gdb.Symtab) for this frame. This attribute is not writable.

— Instance Variable of Symtab_and_line: pc

Indicates the current program counter address. This attribute is not writable.

— Instance Variable of Symtab_and_line: line

Indicates the current line number for this object. This attribute is not writable.

A gdb.Symtab object has the following attributes:

— Instance Variable of Symtab: filename

The symbol table's source filename. This attribute is not writable.

— Instance Variable of Symtab: objfile

The symbol table's backing object file. See Objfiles In Python. This attribute is not writable.

The following methods are provided:

— Method on Symtab: fullname

Return the symbol table's source absolute file name.