Source-Files.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1992-2019 Free Software Foundation, Inc.
  4. Contributed by Cygnus Support. Written by Julia Menapace, Jim Kingdon,
  5. and David MacKenzie.
  6. Permission is granted to copy, distribute and/or modify this document
  7. under the terms of the GNU Free Documentation License, Version 1.3 or
  8. any later version published by the Free Software Foundation; with no
  9. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  10. Texts. A copy of the license is included in the section entitled "GNU
  11. Free Documentation License". -->
  12. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>STABS: Source Files</title>
  15. <meta name="description" content="STABS: Source Files">
  16. <meta name="keywords" content="STABS: Source Files">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="Symbol-Types-Index.html#Symbol-Types-Index" rel="index" title="Symbol Types Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="Program-Structure.html#Program-Structure" rel="up" title="Program Structure">
  25. <link href="Include-Files.html#Include-Files" rel="next" title="Include Files">
  26. <link href="Main-Program.html#Main-Program" rel="prev" title="Main Program">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.smallquotation {font-size: smaller}
  31. div.display {margin-left: 3.2em}
  32. div.example {margin-left: 3.2em}
  33. div.indentedblock {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style:oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nocodebreak {white-space:nowrap}
  49. span.nolinebreak {white-space:nowrap}
  50. span.roman {font-family:serif; font-weight:normal}
  51. span.sansserif {font-family:sans-serif; font-weight:normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  57. <a name="Source-Files"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Include-Files.html#Include-Files" accesskey="n" rel="next">Include Files</a>, Previous: <a href="Main-Program.html#Main-Program" accesskey="p" rel="prev">Main Program</a>, Up: <a href="Program-Structure.html#Program-Structure" accesskey="u" rel="up">Program Structure</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
  61. </div>
  62. <hr>
  63. <a name="Paths-and-Names-of-the-Source-Files"></a>
  64. <h3 class="section">2.2 Paths and Names of the Source Files</h3>
  65. <a name="index-N_005fSO"></a>
  66. <p>Before any other stabs occur, there must be a stab specifying the source
  67. file. This information is contained in a symbol of stab type
  68. <code>N_SO</code>; the string field contains the name of the file. The
  69. value of the symbol is the start address of the portion of the
  70. text section corresponding to that file.
  71. </p>
  72. <p>Some compilers use the desc field to indicate the language of the
  73. source file. Sun&rsquo;s compilers started this usage, and the first
  74. constants are derived from their documentation. Languages added
  75. by gcc/gdb start at 0x32 to avoid conflict with languages Sun may
  76. add in the future. A desc field with a value 0 indicates that no
  77. language has been specified via this mechanism.
  78. </p>
  79. <dl compact="compact">
  80. <dt><code>N_SO_AS</code> (0x1)</dt>
  81. <dd><p>Assembly language
  82. </p></dd>
  83. <dt><code>N_SO_C</code> (0x2)</dt>
  84. <dd><p>K&amp;R traditional C
  85. </p></dd>
  86. <dt><code>N_SO_ANSI_C</code> (0x3)</dt>
  87. <dd><p>ANSI C
  88. </p></dd>
  89. <dt><code>N_SO_CC</code> (0x4)</dt>
  90. <dd><p>C++
  91. </p></dd>
  92. <dt><code>N_SO_FORTRAN</code> (0x5)</dt>
  93. <dd><p>Fortran
  94. </p></dd>
  95. <dt><code>N_SO_PASCAL</code> (0x6)</dt>
  96. <dd><p>Pascal
  97. </p></dd>
  98. <dt><code>N_SO_FORTRAN90</code> (0x7)</dt>
  99. <dd><p>Fortran90
  100. </p></dd>
  101. <dt><code>N_SO_OBJC</code> (0x32)</dt>
  102. <dd><p>Objective-C
  103. </p></dd>
  104. <dt><code>N_SO_OBJCPLUS</code> (0x33)</dt>
  105. <dd><p>Objective-C++
  106. </p></dd>
  107. </dl>
  108. <p>Some compilers (for example, GCC2 and SunOS4 <samp>/bin/cc</samp>) also
  109. include the directory in which the source was compiled, in a second
  110. <code>N_SO</code> symbol preceding the one containing the file name. This
  111. symbol can be distinguished by the fact that it ends in a slash. Code
  112. from the <code>cfront</code> C<tt>++</tt> compiler can have additional <code>N_SO</code> symbols for
  113. nonexistent source files after the <code>N_SO</code> for the real source file;
  114. these are believed to contain no useful information.
  115. </p>
  116. <p>For example:
  117. </p>
  118. <div class="example">
  119. <pre class="example">.stabs &quot;/cygint/s1/users/jcm/play/&quot;,100,0,0,Ltext0 # <span class="roman">100 is N_SO</span>
  120. .stabs &quot;hello.c&quot;,100,0,0,Ltext0
  121. .text
  122. Ltext0:
  123. </pre></div>
  124. <a name="index-C_005fFILE"></a>
  125. <p>Instead of <code>N_SO</code> symbols, XCOFF uses a <code>.file</code> assembler
  126. directive which assembles to a <code>C_FILE</code> symbol; explaining this in
  127. detail is outside the scope of this document.
  128. </p>
  129. <p>If it is useful to indicate the end of a source file, this is done with
  130. an <code>N_SO</code> symbol with an empty string for the name. The value is
  131. the address of the end of the text section for the file. For some
  132. systems, there is no indication of the end of a source file, and you
  133. just need to figure it ended when you see an <code>N_SO</code> for a different
  134. source file, or a symbol ending in <code>.o</code> (which at least some
  135. linkers insert to mark the start of a new <code>.o</code> file).
  136. </p>
  137. <hr>
  138. <div class="header">
  139. <p>
  140. Next: <a href="Include-Files.html#Include-Files" accesskey="n" rel="next">Include Files</a>, Previous: <a href="Main-Program.html#Main-Program" accesskey="p" rel="prev">Main Program</a>, Up: <a href="Program-Structure.html#Program-Structure" accesskey="u" rel="up">Program Structure</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
  141. </div>
  142. </body>
  143. </html>