Fix typos.
[oota-llvm.git] / docs / SourceLevelDebugging.html
index 6a3d675080b8ad178977834fd4efebfe889c5735..3c9df8dc0fea433275df4c1f41791121fdc3414e 100644 (file)
@@ -16,6 +16,7 @@
   <li><a href="#introduction">Introduction</a>
   <ol>
     <li><a href="#phil">Philosophy behind LLVM debugging information</a></li>
+    <li><a href="#consumers">Debug information consumers</a></li>
     <li><a href="#debugopt">Debugging optimized code</a></li>
   </ol></li>
   <li><a href="#format">Debugging information format</a>
       <li><a href="#format_compile_units">Compile unit descriptors</a></li>
       <li><a href="#format_global_variables">Global variable descriptors</a></li>
       <li><a href="#format_subprograms">Subprogram descriptors</a></li>
+      <li><a href="#format_blocks">Block descriptors</a></li>
       <li><a href="#format_basic_type">Basic type descriptors</a></li>
       <li><a href="#format_derived_type">Derived type descriptors</a></li>
       <li><a href="#format_composite_type">Composite type descriptors</a></li>
       <li><a href="#format_subrange">Subrange descriptors</a></li>
       <li><a href="#format_enumeration">Enumerator descriptors</a></li>
+      <li><a href="#format_variables">Local variables</a></li>
     </ul></li>
     <li><a href="#format_common_intrinsics">Debugger intrinsic functions</a>
       <ul>
@@ -63,7 +66,7 @@ height="369">
 
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
-            and <a href="mailto:jlaskey@apple.com">Jim Laskey</a></p>
+            and <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p>
 </div>
 
 
@@ -126,11 +129,34 @@ href="http://www.eagercon.com/dwarf/dwarf3std.htm">Dwarf 3 standard</a>).</p>
 
 <p>When a program is being debugged, a debugger interacts with the user and
 turns the stored debug information into source-language specific information. 
-As such, the debugger must be aware of the source-language, and is thus tied to
+As such, a debugger must be aware of the source-language, and is thus tied to
 a specific language of family of languages.</p>
 
 </div>
 
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+  <a name="consumers">Debug information consumers</a>
+</div>
+
+<div class="doc_text">
+<p>The role of debug information is to provide meta information normally
+stripped away during the compilation process.  This meta information provides an
+llvm user a relationship between generated code and the original program source
+code.</p>
+
+<p>Currently, debug information is consumed by the DwarfWriter to produce dwarf
+information used by the gdb debugger.  Other targets could use the same
+information to produce stabs or other debug forms.</p>
+
+<p>It would also be reasonable to use debug information to feed profiling tools
+for analysis of generated code, or, tools for reconstructing the original source
+from generated code.</p>
+
+<p>TODO - expound a bit more.</p>
+
+</div>
+
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="debugopt">Debugging optimized code</a>
@@ -175,7 +201,7 @@ removed.</li>
 
 <p>Basically, the debug information allows you to compile a program with
 "<tt>-O0 -g</tt>" and get full debug information, allowing you to arbitrarily
-modify the program as it executes from the debugger.  Compiling a program with
+modify the program as it executes from a debugger.  Compiling a program with
 "<tt>-O3 -g</tt>" gives you full debug information that is always available and
 accurate for reading (e.g., you get accurate stack traces despite tail call
 elimination and inlining), but you might lose the ability to modify the program
@@ -225,7 +251,7 @@ assumptions about the source-level language being debugged, though it keeps
 these to a minimum.  The only common features that the LLVM debugger assumes
 exist are <a href="#format_compile_units">source files</a>, and <a
 href="#format_global_variables">program objects</a>.  These abstract objects are
-used by the debugger to form stack traces, show information about local
+used by a debugger to form stack traces, show information about local
 variables, etc.</p>
 
 <p>This section of the documentation first describes the representation aspects
@@ -247,14 +273,15 @@ debug descriptors.</p>
 
 <p>Consumers of LLVM debug information expect the descriptors for program
 objects to start in a canonical format, but the descriptors can include
-additional information appended at the end that is source-language specific. 
-All LLVM debugging information is versioned, allowing backwards compatibility in
-the case that the core structures need to change in some way.  Also, all
-debugging information objects start with a tag to indicate what type of object
-it is.  The source-language is allowed to define its own objects, by using
-unreserved tag numbers.</p>
-
-<p>The fields of debug descriptors used internally by LLVM (MachineDebugInfo)
+additional information appended at the end that is source-language specific. All
+LLVM debugging information is versioned, allowing backwards compatibility in the
+case that the core structures need to change in some way.  Also, all debugging
+information objects start with a tag to indicate what type of object it is.  The
+source-language is allowed to define its own objects, by using unreserved tag
+numbers.  We recommend using with tags in the range 0x1000 thru 0x2000 (there is
+a defined enum DW_TAG_user_base = 0x1000.)</p>
+
+<p>The fields of debug descriptors used internally by LLVM (MachineModuleInfo)
 are restricted to only the simple data types <tt>int</tt>, <tt>uint</tt>,
 <tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>sbyte*</tt> and <tt> { }*
 </tt>.  References to arbitrary values are handled using a <tt> { }* </tt> and a
@@ -268,13 +295,15 @@ descriptors, arrays of descriptors or global variables.</p>
   }
 </pre>
 
-<p>The first field of a descriptor is always an <tt>uint</tt> containing a tag
-value identifying the content of the descriptor. The remaining fields are
-specific to the descriptor.  The values of tags are loosely bound to the tag
-values of Dwarf information entries.  However, that does not restrict the use of
-the information supplied to Dwarf targets.</p>
+<p><a name="LLVMDebugVersion">The first field of a descriptor is always an
+<tt>uint</tt> containing a tag value identifying the content of the descriptor.
+The remaining fields are specific to the descriptor.  The values of tags are
+loosely bound to the tag values of Dwarf information entries.  However, that
+does not restrict the use of the information supplied to Dwarf targets.  To
+facilitate versioning of debug information, the tag is augmented with the
+current debug version (LLVMDebugVersion = 4 << 16 or 0x40000 or 262144.)</a></p>
 
-<p>The details of the various descriptors follow.</p>
+<p>The details of the various descriptors follow.</p>  
 
 </div>
 
@@ -287,7 +316,7 @@ the information supplied to Dwarf targets.</p>
 
 <pre>
   %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type {
-    uint,   ;; Tag = 0
+    uint,   ;; Tag = 0 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a>
     uint    ;; Tag of descriptors grouped by the anchor
   }
 </pre>
@@ -297,7 +326,7 @@ LLVM debugger to efficiently index all of the global objects without having the
 scan the program.  To do this, all of the global objects use "anchor"
 descriptors with designated names.  All of the global objects of a particular
 type (e.g., compile units) contain a pointer to the anchor.  This pointer allows
-the debugger to use def-use chains to find all global objects of that type.</p>
+a debugger to use def-use chains to find all global objects of that type.</p>
 
 <p>The following names are recognized as anchors by LLVM:</p>
 
@@ -325,9 +354,8 @@ deleted.</p>
 
 <pre>
   %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = type {
-    uint,   ;; Tag = 17 (DW_TAG_compile_unit)
+    uint,   ;; Tag = 17 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_compile_unit)
     {  }*,  ;; Compile unit anchor = cast = (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to {  }*)
-    uint,   ;; LLVM debug version number = 1
     uint,   ;; Dwarf language identifier (ex. DW_LANG_C89) 
     sbyte*, ;; Source file name
     sbyte*, ;; Source file directory (includes trailing slash)
@@ -335,11 +363,11 @@ deleted.</p>
   }
 </pre>
 
-<p>These descriptors contain the version number for the debug info (currently
-1), a source language ID for the file (we use the Dwarf 3.0 ID numbers, such as
-<tt>DW_LANG_C89</tt>, <tt>DW_LANG_C_plus_plus</tt>, <tt>DW_LANG_Cobol74</tt>,
-etc), three strings describing the filename, working directory of the compiler,
-and an identifier string for the compiler that produced it.</p>
+<p>These descriptors contain a source language ID for the file (we use the Dwarf
+3.0 ID numbers, such as <tt>DW_LANG_C89</tt>, <tt>DW_LANG_C_plus_plus</tt>,
+<tt>DW_LANG_Cobol74</tt>, etc), three strings describing the filename, working
+directory of the compiler, and an identifier string for the compiler that
+produced it.</p>
 
 <p> Compile unit descriptors provide the root context for objects declared in a
 specific source file.  Global variables and top level functions would be defined
@@ -357,15 +385,18 @@ line correspondence.</p>
 
 <pre>
   %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type {
-    uint,   ;; Tag = 52 (DW_TAG_variable)
+    uint,   ;; Tag = 52 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_variable)
     {  }*,  ;; Global variable anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to {  }*),  
-    {  }*,  ;; Reference to compile unit
+    {  }*,  ;; Reference to context descriptor
     sbyte*, ;; Name
+    sbyte*, ;; Display name (fully qualified C++ name)
+    sbyte*, ;; MIPS linkage name (for C++)
+    {  }*,  ;; Reference to compile unit where defined
+    uint,   ;; Line number where defined
     {  }*,  ;; Reference to type descriptor
     bool,   ;; True if the global is local to compile unit (static)
     bool,   ;; True if the global is defined in the compile unit (not extern)
-    {  }*,  ;; Reference to the global variable
-    uint    ;; Line number in compile unit where variable is defined
+    {  }*   ;; Reference to the global variable
   }
 </pre>
 
@@ -383,21 +414,42 @@ provide details such as name, type and where the variable is defined.</p>
 
 <pre>
   %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type {
-    uint,   ;; Tag = 46 (DW_TAG_subprogram)
+    uint,   ;; Tag = 46 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subprogram)
     {  }*,  ;; Subprogram anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to {  }*),  
-    {  }*,  ;; Reference to compile unit
+    {  }*,  ;; Reference to context descriptor
     sbyte*, ;; Name
+    sbyte*, ;; Display name (fully qualified C++ name)
+    sbyte*, ;; MIPS linkage name (for C++)
+    {  }*,  ;; Reference to compile unit where defined
+    uint,   ;; Line number where defined
     {  }*,  ;; Reference to type descriptor
     bool,   ;; True if the global is local to compile unit (static)
     bool    ;; True if the global is defined in the compile unit (not extern)
-    TODO - MORE TO COME
   }
-
 </pre>
 
 <p>These descriptors provide debug information about functions, methods and
-subprograms.  The provide details such as name, return and argument types and
-where the subprogram is defined.</p>
+subprograms.  They provide details such as name, return types and the source
+location where the subprogram is defined.</p>
+
+</div>
+<!-- ======================================================================= -->
+<div class="doc_subsubsection">
+  <a name="format_blocks">Block descriptors</a>
+</div>
+
+<div class="doc_text">
+
+<pre>
+  %<a href="#format_blocks">llvm.dbg.block</a> = type {
+    uint,   ;; Tag = 13 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_lexical_block)
+    {  }*   ;; Reference to context descriptor
+  }
+</pre>
+
+<p>These descriptors provide debug information about nested blocks within a
+subprogram.  The array of member descriptors is used to define local variables
+and deeper nested blocks.</p>
 
 </div>
 
@@ -410,11 +462,11 @@ where the subprogram is defined.</p>
 
 <pre>
   %<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type {
-    uint,   ;; Tag = 36 (DW_TAG_base_type)
+    uint,   ;; Tag = 36 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_base_type)
     {  }*,  ;; Reference to context (typically a compile unit)
     sbyte*, ;; Name (may be "" for anonymous types)
     {  }*,  ;; Reference to compile unit where defined (may be NULL)
-    int,    ;; Line number where defined (may be 0)
+    uint,   ;; Line number where defined (may be 0)
     uint,   ;; Size in bits
     uint,   ;; Alignment in bits
     uint,   ;; Offset in bits
@@ -460,7 +512,7 @@ one of the following;</p>
     {  }*,  ;; Reference to context
     sbyte*, ;; Name (may be "" for anonymous types)
     {  }*,  ;; Reference to compile unit where defined (may be NULL)
-    int,    ;; Line number where defined (may be 0)
+    uint,   ;; Line number where defined (may be 0)
     uint,   ;; Size in bits
     uint,   ;; Alignment in bits
     uint,   ;; Offset in bits
@@ -473,6 +525,7 @@ value of the tag varies depending on the meaning.  The following are possible
 tag values;</p>
 
 <pre>
+  DW_TAG_formal_parameter = 5
   DW_TAG_member = 13
   DW_TAG_pointer_type = 15
   DW_TAG_reference_type = 16
@@ -483,8 +536,10 @@ tag values;</p>
 </pre>
 
 <p> <tt>DW_TAG_member</tt> is used to define a member of a <a
-href="#format_composite_type">composite type</a>.  The type of the member is the
-<a href="#format_derived_type">derived type</a>.</p>
+href="#format_composite_type">composite type</a> or <a
+href="#format_subprograms">subprogram</a>.  The type of the member is the <a
+href="#format_derived_type">derived type</a>. <tt>DW_TAG_formal_parameter</tt>
+is used to define a member which is a formal argument of a subprogram.</p>
 
 <p><tt>DW_TAG_typedef</tt> is used to
 provide a name for the derived type.</p>
@@ -521,7 +576,7 @@ NULL derived type.</p>
     {  }*,  ;; Reference to context
     sbyte*, ;; Name (may be "" for anonymous types)
     {  }*,  ;; Reference to compile unit where defined (may be NULL)
-    int,    ;; Line number where defined (may be 0)
+    uint,   ;; Line number where defined (may be 0)
     uint,   ;; Size in bits
     uint,   ;; Alignment in bits
     uint,   ;; Offset in bits
@@ -538,11 +593,17 @@ are possible tag values;</p>
   DW_TAG_enumeration_type = 4
   DW_TAG_structure_type = 19
   DW_TAG_union_type = 23
+  DW_TAG_vector_type = 259
+  DW_TAG_subroutine_type = 46
+  DW_TAG_inheritance = 26
 </pre>
 
-<p>The members of array types (tag = <tt>DW_TAG_array_type</tt>) are <a
-href="#format_subrange">subrange descriptors</a>, each representing the range of
-subscripts at that level of indexing.</p>
+<p>The vector flag indicates that an array type is a native packed vector.</p>
+
+<p>The members of array types (tag = <tt>DW_TAG_array_type</tt>) or vector types
+(tag = <tt>DW_TAG_vector_type</tt>) are <a href="#format_subrange">subrange
+descriptors</a>, each representing the range of subscripts at that level of
+indexing.</p>
 
 <p>The members of enumeration types (tag = <tt>DW_TAG_enumeration_type</tt>) are
 <a href="#format_enumeration">enumerator descriptors</a>, each representing the
@@ -555,6 +616,21 @@ href="#format_basic_type">basic</a>, <a href="#format_derived_type">derived</a>
 or <a href="#format_composite_type">composite</a> type descriptors, each
 representing a field member of the structure or union.</p>
 
+<p>For C++ classes (tag = <tt>DW_TAG_structure_type</tt>), member descriptors
+provide information about base classes, static members and member functions. If
+a member is a <a href="#format_derived_type">derived type descriptor</a> and has
+a tag of <tt>DW_TAG_inheritance</tt>, then the type represents a base class. If
+the member of is a <a href="#format_global_variables">global variable
+descriptor</a> then it represents a static member.  And, if the member is a <a
+href="#format_subprograms">subprogram descriptor</a> then it represents a member
+function.  For static members and member functions, <tt>getName()</tt> returns
+the members link or the C++ mangled name.  <tt>getDisplayName()</tt> the
+simplied version of the name.</p>
+
+<p>The first member of subroutine (tag = <tt>DW_TAG_subroutine_type</tt>)
+type elements is the return type for the subroutine.  The remaining
+elements are the formal arguments to the subroutine.</p>
+
 <p><a href="#format_composite_type">Composite type</a> location can be
 determined from the compile unit and line number.  The size, alignment and
 offset are expressed in bits and can be 64 bit values.  The alignment is used to
@@ -574,7 +650,7 @@ type</a>.</p>
 
 <pre>
   %<a href="#format_subrange">llvm.dbg.subrange.type</a> = type {
-    uint,   ;; Tag = 33 (DW_TAG_subrange_type)
+    uint,   ;; Tag = 33 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subrange_type)
     uint,   ;; Low value
     uint    ;; High value
   }
@@ -597,7 +673,7 @@ low == high the array will be unbounded.</p>
 
 <pre>
   %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> = type {
-    uint,   ;; Tag = 40 (DW_TAG_enumerator)
+    uint,   ;; Tag = 40 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_enumerator)
     sbyte*, ;; Name
     uint    ;; Value
   }
@@ -609,6 +685,44 @@ value.</p>
 
 </div>
 
+<!-- ======================================================================= -->
+<div class="doc_subsubsection">
+  <a name="format_variables">Local variables</a>
+</div>
+
+<div class="doc_text">
+<pre>
+  %<a href="#format_variables">llvm.dbg.variable.type</a> = type {
+    uint,    ;; Tag (see below)
+    {  }*,   ;; Context
+    sbyte*,  ;; Name
+    {  }*,   ;; Reference to compile unit where defined
+    uint,    ;; Line number where defined
+    {  }*    ;; Type descriptor
+  }
+</pre>
+
+<p>These descriptors are used to define variables local to a sub program.  The
+value of the tag depends on the usage of the variable;</p>
+
+<pre>
+  DW_TAG_auto_variable = 256
+  DW_TAG_arg_variable = 257
+  DW_TAG_return_variable = 258
+</pre>
+
+<p>An auto variable is any variable declared in the body of the function.  An
+argument variable is any variable that appears as a formal argument to the
+function.  A return variable is used to track the result of a function and has
+no source correspondent.</p>
+
+<p>The context is either the subprogram or block where the variable is defined.
+Name the source variable name.  Compile unit and line indicate where the
+variable was defined. Type descriptor defines the declared type of the
+variable.</p>
+
+</div>
+
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="format_common_intrinsics">Debugger intrinsic functions</a>
@@ -628,15 +742,17 @@ provide debug information at various points in generated code.</p>
 
 <div class="doc_text">
 <pre>
-  void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint, uint, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* )
+  void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint, uint, { }* )
 </pre>
 
 <p>This intrinsic is used to provide correspondence between the source file and
 the generated code.  The first argument is the line number (base 1), second
 argument si the column number (0 if unknown) and the third argument the source
-compile unit.  Code following a call to this intrinsic will have been defined in
-close proximity of the line, column and file.  This information holds until the
-next call to <a href="#format_common_stoppoint">lvm.dbg.stoppoint</a>.</p>
+<tt>%<a href="#format_compile_units">llvm.dbg.compile_unit</a>*</tt> cast to a
+<tt>{ }*</tt>.  Code following a call to this intrinsic will have been defined
+in close proximity of the line, column and file.  This information holds until
+the next call to <tt>%<a
+href="#format_common_stoppoint">lvm.dbg.stoppoint</a></tt>.</p>
 
 </div>
 
@@ -647,14 +763,17 @@ next call to <a href="#format_common_stoppoint">lvm.dbg.stoppoint</a>.</p>
 
 <div class="doc_text">
 <pre>
-  void %<a href="#format_common_func_start">llvm.dbg.func.start</a>( %<a href="#format_subprograms">llvm.dbg.subprogram.type</a>* )
+  void %<a href="#format_common_func_start">llvm.dbg.func.start</a>( { }* )
 </pre>
 
 <p>This intrinsic is used to link the debug information in <tt>%<a
 href="#format_subprograms">llvm.dbg.subprogram</a></tt> to the function. It also
 defines the beginning of the function's declarative region (scope.)  The
 intrinsic should be called early in the function after the all the alloca
-instructions.</p>
+instructions.  It should be paired off with a closing <tt>%<a
+href="#format_common_region_end">llvm.dbg.region.end</a></tt>.  The function's
+single argument is the <tt>%<a
+href="#format_subprograms">llvm.dbg.subprogram.type</a></tt>.</p>
 
 </div>
 
@@ -665,12 +784,15 @@ instructions.</p>
 
 <div class="doc_text">
 <pre>
-  void %<a href="#format_common_region_start">llvm.dbg.region.start</a>()
+  void %<a href="#format_common_region_start">llvm.dbg.region.start</a>( { }* )
 </pre>
 
 <p>This intrinsic is used to define the beginning of a declarative scope (ex.
 block) for local language elements.  It should be paired off with a closing
-<tt>%<a href="#format_common_region_end">llvm.dbg.region.end</a></tt>.</p>
+<tt>%<a href="#format_common_region_end">llvm.dbg.region.end</a></tt>.  The
+function's single argument is the <tt>%<a
+href="#format_blocks">llvm.dbg.block</a></tt> which is starting.</p>
+
 
 </div>
 
@@ -681,13 +803,17 @@ block) for local language elements.  It should be paired off with a closing
 
 <div class="doc_text">
 <pre>
-  void %<a href="#format_common_region_end">llvm.dbg.region.end</a>()
+  void %<a href="#format_common_region_end">llvm.dbg.region.end</a>( { }* )
 </pre>
 
 <p>This intrinsic is used to define the end of a declarative scope (ex. block)
 for local language elements.  It should be paired off with an opening <tt>%<a
 href="#format_common_region_start">llvm.dbg.region.start</a></tt> or <tt>%<a
-href="#format_common_func_start">llvm.dbg.func.start</a></tt>.</p>
+href="#format_common_func_start">llvm.dbg.func.start</a></tt>.  The function's
+single argument is either the <tt>%<a
+href="#format_blocks">llvm.dbg.block</a></tt> or the <tt>%<a
+href="#format_subprograms">llvm.dbg.subprogram.type</a></tt> which is
+ending.</p>
 
 </div>
 
@@ -698,11 +824,14 @@ href="#format_common_func_start">llvm.dbg.func.start</a></tt>.</p>
 
 <div class="doc_text">
 <pre>
-  void %<a href="#format_common_declare">llvm.dbg.declare</a>( {} *, ... )
+  void %<a href="#format_common_declare">llvm.dbg.declare</a>( { } *, { }* )
 </pre>
 
-<p>This intrinsic provides information about a local element (ex. variable.) 
-TODO - details.</p>
+<p>This intrinsic provides information about a local element (ex. variable.) The
+first argument is the alloca for the variable, cast to a <tt>{ }*</tt>. The
+second argument is the <tt>%<a
+href="#format_variables">llvm.dbg.variable</a></tt> containing the description
+of the variable, also cast to a <tt>{ }*</tt>.</p>
 
 </div>
 
@@ -720,8 +849,8 @@ that allows the LLVM to maintain simple semantics for <a
 href="#debugopt">debugging optimized code</a>.  The basic idea is that the
 front-end inserts calls to the <a
 href="#format_common_stoppoint">%<tt>llvm.dbg.stoppoint</tt></a> intrinsic
-function at every point in the program where the debugger should be able to
-inspect the program (these correspond to places the debugger stops when you
+function at every point in the program where a debugger should be able to
+inspect the program (these correspond to places a debugger stops when you
 "<tt>step</tt>" through it).  The front-end can choose to place these as
 fine-grained as it would like (for example, before every subexpression
 evaluated), but it is recommended to only put them after every source statement
@@ -841,7 +970,7 @@ to support inlining with debugging information: there is no explicit correlation
 drawn between LLVM functions and their source-level counterparts (note however,
 that if the inliner inlines all instances of a non-strong-linkage function into
 its caller that it will not be possible for the user to manually invoke the
-inlined function from the debugger).</p>
+inlined function from a debugger).</p>
 
 <p>Once the function has been defined, the <a
 href="#format_common_stoppoint"><tt>stopping point</tt></a> corresponding to
@@ -936,7 +1065,7 @@ int main(int argc, char *argv[]) {
 ;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp".
 ;;
 %<a href="#format_compile_units">llvm.dbg.compile_unit1</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
-    uint 17
+    uint add(uint 17, uint 262144)
     {  }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to {  }*), 
     uint 1, 
     uint 1, 
@@ -948,7 +1077,7 @@ int main(int argc, char *argv[]) {
 ;; Define the compile unit for the header file "/Users/mine/sources/MyHeader.h".
 ;;
 %<a href="#format_compile_units">llvm.dbg.compile_unit2</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
-    uint 17
+    uint add(uint 17, uint 262144)
     {  }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to {  }*), 
     uint 1, 
     uint 1, 
@@ -990,7 +1119,7 @@ int MyGlobal = 100;
 ;; compile unit.
 ;;
 %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint }
-%<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type { uint, {  }*, {  }*, sbyte*, {  }*, bool, bool, {  }*, uint }
+%<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type { uint, {  }*, {  }*, sbyte*, {  }*, uint, {  }*, bool, bool, {  }*, uint }
 %<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type { uint, {  }*, sbyte*, {  }*, int, uint, uint, uint, uint }
 %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ...
 ...
@@ -1011,24 +1140,26 @@ int MyGlobal = 100;
 ;; variable anchor and the global variable itself.
 ;;
 %<a href="#format_global_variables">llvm.dbg.global_variable</a> = internal constant %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> {
-    uint 52
+    uint add(uint 52, uint 262144)
     {  }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to {  }*), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([9 x sbyte]* %str1, int 0, int 0), 
+    sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), 
+    {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
+    uint 1,
     {  }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to {  }*), 
     bool false, 
     bool true, 
-    {  }* cast (int* %MyGlobal to {  }*), 
-    uint 1 }, section "llvm.metadata"
+    {  }* cast (int* %MyGlobal to {  }*) }, section "llvm.metadata"
     
 ;;
 ;; Define the basic type of 32 bit signed integer.  Note that since int is an
 ;; intrinsic type the source file is NULL and line 0.
 ;;    
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
-    sbyte* getelementptr ([4 x sbyte]* %str2, int 0, int 0), 
+    sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0), 
     {  }* null, 
     int 0, 
     uint 32, 
@@ -1040,7 +1171,8 @@ int MyGlobal = 100;
 ;; Define the names of the global variable and basic type.
 ;;
 %str1 = internal constant [9 x sbyte] c"MyGlobal\00", section "llvm.metadata"
-%str2 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
+%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata"
+%str3 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
 </pre>
 
 </div>
@@ -1083,10 +1215,13 @@ int main(int argc, char *argv[]) {
 ;; Define the descriptor for the subprogram.  TODO - more details.
 ;;
 %<a href="#format_subprograms">llvm.dbg.subprogram</a> = internal constant %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> {
-    uint 46
+    uint add(uint 46, uint 262144)
     {  }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to {  }*), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0), 
+    sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), 
+    {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*),
+    uint 1,
     {  }* null, 
     bool false, 
     bool true }, section "llvm.metadata"
@@ -1095,6 +1230,7 @@ int main(int argc, char *argv[]) {
 ;; Define the name of the subprogram.
 ;;
 %str1 = internal constant [5 x sbyte] c"main\00", section "llvm.metadata"
+%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata"
 
 ;;
 ;; Define the subprogram itself.
@@ -1126,7 +1262,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1149,7 +1285,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1172,7 +1308,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([14 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1195,7 +1331,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([10 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1218,7 +1354,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([19 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1241,7 +1377,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([4 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1264,7 +1400,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([13 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1287,7 +1423,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([14 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1310,7 +1446,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([23 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1333,7 +1469,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([6 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1356,7 +1492,7 @@ int %main(int %argc, sbyte** %argv) {
 
 <pre>
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([7 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1390,7 +1526,7 @@ typedef const int *IntPtr;
 ;; Define the typedef "IntPtr".
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 22
+    uint add(uint 22, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([7 x sbyte]* %str1, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1405,24 +1541,23 @@ typedef const int *IntPtr;
 ;; Define the pointer type.
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 15
+    uint add(uint 15, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
-    sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0)
+    sbyte* null
     {  }* null, 
     int 0, 
     uint 32, 
     uint 32, 
     uint 0, 
     {  }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to {  }*) }, section "llvm.metadata"
-%str2 = internal constant [1 x sbyte] zeroinitializer, section "llvm.metadata"
 
 ;;
 ;; Define the const type.
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 38
+    uint add(uint 38, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
-    sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0)
+    sbyte* null
     {  }* null, 
     int 0, 
     uint 0, 
@@ -1434,16 +1569,16 @@ typedef const int *IntPtr;
 ;; Define the int type.
 ;;
 %<a href="#format_basic_type">llvm.dbg.basictype1</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
-    sbyte* getelementptr ([4 x sbyte]* %str4, int 0, int 0), 
+    sbyte* getelementptr ([4 x sbyte]* %str2, int 0, int 0), 
     {  }* null, 
     int 0, 
     uint 32, 
     uint 32, 
     uint 0, 
     uint 5 }, section "llvm.metadata"
-%str4 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
+%str2 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
 </pre>
 
 </div>
@@ -1472,7 +1607,7 @@ struct Color {
 ;; Define basic type for unsigned int.
 ;;
 %<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
-    uint 36
+    uint add(uint 36, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([13 x sbyte]* %str1, int 0, int 0), 
     {  }* null, 
@@ -1487,7 +1622,7 @@ struct Color {
 ;; Define composite type for struct Color.
 ;;
 %<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> {
-    uint 19
+    uint add(uint 19, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([6 x sbyte]* %str2, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1495,7 +1630,7 @@ struct Color {
     uint 96, 
     uint 32, 
     uint 0, 
-    {  }* null, 
+    {  }* null,
     {  }* cast ([3 x {  }*]* %llvm.dbg.array to {  }*) }, section "llvm.metadata"
 %str2 = internal constant [6 x sbyte] c"Color\00", section "llvm.metadata"
 
@@ -1503,7 +1638,7 @@ struct Color {
 ;; Define the Red field.
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 13
+    uint add(uint 13, uint 262144)
     {  }* null, 
     sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1518,7 +1653,7 @@ struct Color {
 ;; Define the Green field.
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 13
+    uint add(uint 13, uint 262144)
     {  }* null, 
     sbyte* getelementptr ([6 x sbyte]* %str4, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1533,7 +1668,7 @@ struct Color {
 ;; Define the Blue field.
 ;;
 %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
-    uint 13
+    uint add(uint 13, uint 262144)
     {  }* null, 
     sbyte* getelementptr ([5 x sbyte]* %str5, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1579,7 +1714,7 @@ enum Trees {
 ;; Define composite type for enum Trees
 ;;
 %<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> {
-    uint 4
+    uint add(uint 4, uint 262144)
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
     sbyte* getelementptr ([6 x sbyte]* %str1, int 0, int 0), 
     {  }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to {  }*), 
@@ -1595,7 +1730,7 @@ enum Trees {
 ;; Define Spruce enumerator.
 ;;
 %<a href="#format_enumeration">llvm.dbg.enumerator1</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
-    uint 40
+    uint add(uint 40, uint 262144)
     sbyte* getelementptr ([7 x sbyte]* %str2, int 0, int 0), 
     int 100 }, section "llvm.metadata"
 %str2 = internal constant [7 x sbyte] c"Spruce\00", section "llvm.metadata"
@@ -1604,7 +1739,7 @@ enum Trees {
 ;; Define Oak enumerator.
 ;;
 %<a href="#format_enumeration">llvm.dbg.enumerator2</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
-    uint 40
+    uint add(uint 40, uint 262144)
     sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0), 
     int 200 }, section "llvm.metadata"
 %str3 = internal constant [4 x sbyte] c"Oak\00", section "llvm.metadata"
@@ -1613,7 +1748,7 @@ enum Trees {
 ;; Define Maple enumerator.
 ;;
 %<a href="#format_enumeration">llvm.dbg.enumerator3</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
-    uint 40
+    uint add(uint 40, uint 262144)
     sbyte* getelementptr ([6 x sbyte]* %str4, int 0, int 0), 
     int 300 }, section "llvm.metadata"
 %str4 = internal constant [6 x sbyte] c"Maple\00", section "llvm.metadata"