Section 1: General Information
17
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual Not for Distribution
Beta Version February 2, 2001
1.4.6. Line Number Information
The line number information in the object file is used for source-level debugging.
Line number information is present when C files are compiled with the
-q
or
-q1
debug flag or assembly language files are assembled with the
-L
line number
flag. When compiled or assembled with one of the above listed flags, a line
number entry is generated for every line of C or assembly language code. The
line number entries are grouped by section and within each section grouping the
entries are grouped by function as shown in Table 1.11.
symbol index 0
virtual address line number
virtual address line number
. . .
. . .
symbol index 0
virtual address line number
virtual address line number
Table 1.11: Line Number Grouping
Table 1.12 describes the fields within a line number entry. Defined in file_fmt.txt
are LINE_NBR and LINE_NBR_SIZE, the typedefs for the line number entry
structure and line number entry size, respectively.
Bytes Declaration Name Description
0-3 unsigned long l_sym_index Symbol table index of function
0-3 unsigned long l_phys_addr Address of source line
4-5 unsigned short l_line_nbr Source line number
Table 1.12: Line Number Section Contents
The first line number entry within a function grouping specifies line number 0 and
has, in place of the virtual address, an index into the symbol table for the entry
containing the name of the function. The subsequent entries have the actual line
numbers relative to the open brace ' { ' that begins the function, and the address
of the text that corresponds to the line number. The line number entries are
ordered by increasing address.
The .bf (begin function) symbol entry immediately follows the auxiliary entry for
the function name symbol. The absolute C source line number of the function's
open brace is specified in the auxiliary entry for the .bf symbol (see section
1.4.9.4 Beginning of Blocks and Functions). Absolute C source line numbers