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