Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / stabs / Line-Numbers.html
blob61c000ae8f9053912c081d3b98d94a5833c9e055
1 <html lang="en">
2 <head>
3 <title>STABS</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="STABS">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Line%20Numbers">Line Numbers</a>,
13 Next:<a rel="next" accesskey="n" href="Procedures.html#Procedures">Procedures</a>,
14 Previous:<a rel="previous" accesskey="p" href="Include-Files.html#Include%20Files">Include Files</a>,
15 Up:<a rel="up" accesskey="u" href="Program-Structure.html#Program%20Structure">Program Structure</a>
16 <hr><br>
17 </div>
19 <h3 class="section">Line Numbers</h3>
21 <p>An <code>N_SLINE</code> symbol represents the start of a source line. The
22 desc field contains the line number and the value contains the code
23 address for the start of that source line. On most machines the address
24 is absolute; for stabs in sections (see <a href="Stab-Sections.html#Stab%20Sections">Stab Sections</a>), it is
25 relative to the function in which the <code>N_SLINE</code> symbol occurs.
27 <p>GNU documents <code>N_DSLINE</code> and <code>N_BSLINE</code> symbols for line
28 numbers in the data or bss segments, respectively. They are identical
29 to <code>N_SLINE</code> but are relocated differently by the linker. They
30 were intended to be used to describe the source location of a variable
31 declaration, but I believe that GCC2 actually puts the line number in
32 the desc field of the stab for the variable itself. GDB has been
33 ignoring these symbols (unless they contain a string field) since
34 at least GDB 3.5.
36 <p>For single source lines that generate discontiguous code, such as flow
37 of control statements, there may be more than one line number entry for
38 the same source line. In this case there is a line number entry at the
39 start of each code range, each with the same line number.
41 <p>XCOFF does not use stabs for line numbers. Instead, it uses COFF line
42 numbers (which are outside the scope of this document). Standard COFF
43 line numbers cannot deal with include files, but in XCOFF this is fixed
44 with the <code>C_BINCL</code> method of marking include files (see <a href="Include-Files.html#Include%20Files">Include Files</a>).
46 </body></html>