X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FSourceLevelDebugging.html;h=6eaaa240c143033c127cae0ac61b258c4d79bbf8;hb=32dc4d9cd76795f43478e80eec9b1e073adf0f98;hp=4c4439fd59ff28a42a79105cd17d8a0fcada4d20;hpb=464f4ef2bdb47a44ffa2c4208296da641db7358d;p=oota-llvm.git diff --git a/docs/SourceLevelDebugging.html b/docs/SourceLevelDebugging.html index 4c4439fd59f..6eaaa240c14 100644 --- a/docs/SourceLevelDebugging.html +++ b/docs/SourceLevelDebugging.html @@ -174,22 +174,15 @@ height="369"> as setting program variables, or calling functions that have been deleted. -
  • LLVM optimizations gracefully interact with debugging information. If - they are not aware of debug information, they are automatically disabled - as necessary in the cases that would invalidate the debug info. This - retains the LLVM features, making it easy to write new - transformations.
  • -
  • As desired, LLVM optimizations can be upgraded to be aware of the LLVM debugging information, allowing them to update the debugging information as they perform aggressive optimizations. This means that, with effort, the LLVM optimizers could optimize debug code just as well as non-debug code.
  • -
  • LLVM debug information does not prevent many important optimizations from +
  • LLVM debug information does not prevent optimizations from happening (for example inlining, basic block reordering/merging/cleanup, - tail duplication, etc), further reducing the amount of the compiler that - eventually is "aware" of debugging information.
  • + tail duplication, etc).
  • LLVM debug information is automatically optimized along with the rest of the program, using existing facilities. For example, duplicate @@ -305,8 +298,8 @@ height="369"> 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 = 8 << 16 or 0x80000 or - 524288.)

    + with the current debug version (LLVMDebugVersion = 8 << 16 or + 0x80000 or 524288.)

    The details of the various descriptors follow.

    @@ -331,6 +324,10 @@ height="369"> i1, ;; True if this is optimized. metadata, ;; Flags i32 ;; Runtime version + metadata ;; List of enums types + metadata ;; List of retained types + metadata ;; List of subprograms + metadata ;; List of global variables } @@ -344,7 +341,8 @@ height="369">

    Compile unit descriptors provide the root context for objects declared in a specific compilation unit. File descriptors are defined using this context. These descriptors are collected by a named metadata - !llvm.dbg.cu. + !llvm.dbg.cu. Compile unit descriptor keeps track of subprograms, + global variables and type information. @@ -362,7 +360,7 @@ height="369"> ;; (DW_TAG_file_type) metadata, ;; Source file name metadata, ;; Source file directory (includes trailing slash) - metadata ;; Reference to compile unit where defined + metadata ;; Unused } @@ -372,8 +370,7 @@ height="369"> provide context for source line correspondence.

    Each input file is encoded as a separate file descriptor in LLVM debugging - information output. Each file descriptor would be defined using a - compile unit.

    + information output.

    @@ -441,6 +438,7 @@ global variables are collected by named metadata !llvm.dbg.gv.

    Function *,;; Pointer to LLVM function metadata, ;; Lists function template parameters metadata ;; Function declaration descriptor + metadata ;; List of function variables } @@ -474,10 +472,23 @@ global variables are collected by named metadata !llvm.dbg.gv.

    -

    These descriptors provide debug information about nested blocks within a +

    This descriptor provides debug information about nested blocks within a subprogram. The line number and column numbers are used to dinstinguish two lexical blocks at same depth.

    +
    +
    +!3 = metadata !{
    +  i32,     ;; Tag = 11 + LLVMDebugVersion (DW_TAG_lexical_block)
    +  metadata ;; Reference to the scope we're annotating with a file change
    +  metadata,;; Reference to the file the scope is enclosed in.
    +}
    +
    +
    + +

    This descriptor provides a wrapper around a lexical scope to handle file + changes in the middle of a lexical block.

    + @@ -492,7 +503,7 @@ global variables are collected by named metadata !llvm.dbg.gv.

    !4 = metadata !{ i32, ;; Tag = 36 + LLVMDebugVersion ;; (DW_TAG_base_type) - metadata, ;; Reference to context (typically a compile unit) + metadata, ;; Reference to context metadata, ;; Name (may be "" for anonymous types) metadata, ;; Reference to file where defined (may be NULL) i32, ;; Line number where defined (may be 0) @@ -507,7 +518,7 @@ global variables are collected by named metadata !llvm.dbg.gv.

    These descriptors define primitive types used in the code. Example int, bool and float. The context provides the scope of the type, which is usually the - top level. Since basic types are not usually user defined the compile unit + top level. Since basic types are not usually user defined the context and line number can be left as NULL and 0. The size, alignment and offset are expressed in bits and can be 64 bit values. The alignment is used to round the offset when embedded in a @@ -592,7 +603,7 @@ DW_TAG_restrict_type = 55 the derived type.

    Derived type location can be determined - from the compile unit and line number. The size, alignment and offset are + from the context and line number. The size, alignment and offset are expressed in bits and can be 64 bit values. The alignment is used to round the offset when embedded in a composite type (example to keep float doubles on 64 bit boundaries.) The offset is @@ -682,7 +693,7 @@ DW_TAG_inheritance = 28 the formal arguments to the subroutine.

    Composite type location can be - determined from the compile unit and line number. The size, alignment and + determined from the context and line number. The size, alignment and offset are expressed in bits and can be 64 bit values. The alignment is used to round the offset when embedded in a composite type (as an example, to keep @@ -757,7 +768,9 @@ DW_TAG_inheritance = 28 metadata, ;; Reference to file where defined i32, ;; 24 bit - Line number where defined ;; 8 bit - Argument number. 1 indicates 1st argument. - metadata ;; Type descriptor + metadata, ;; Type descriptor + i32, ;; flags + metadata ;; (optional) Reference to inline location } @@ -779,7 +792,7 @@ DW_TAG_return_variable = 258 has no source correspondent.

    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 + Name the source variable name. Context and line indicate where the variable was defined. Type descriptor defines the declared type of the variable.