Mercurial > hg > CbC > CbC_llvm
comparison docs/SourceLevelDebugging.rst @ 100:7d135dc70f03 LLVM 3.9
LLVM 3.9
author | Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jan 2016 22:53:40 +0900 |
parents | afa8332a0e37 |
children | 1172e4bd9c6f |
comparison
equal
deleted
inserted
replaced
96:6418606d0ead | 100:7d135dc70f03 |
---|---|
229 Compiled to LLVM, this function would be represented like this: | 229 Compiled to LLVM, this function would be represented like this: |
230 | 230 |
231 .. code-block:: llvm | 231 .. code-block:: llvm |
232 | 232 |
233 ; Function Attrs: nounwind ssp uwtable | 233 ; Function Attrs: nounwind ssp uwtable |
234 define void @foo() #0 { | 234 define void @foo() #0 !dbg !4 { |
235 entry: | 235 entry: |
236 %X = alloca i32, align 4 | 236 %X = alloca i32, align 4 |
237 %Y = alloca i32, align 4 | 237 %Y = alloca i32, align 4 |
238 %Z = alloca i32, align 4 | 238 %Z = alloca i32, align 4 |
239 call void @llvm.dbg.declare(metadata i32* %X, metadata !11, metadata !13), !dbg !14 | 239 call void @llvm.dbg.declare(metadata i32* %X, metadata !11, metadata !13), !dbg !14 |
261 | 261 |
262 !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) | 262 !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
263 !1 = !DIFile(filename: "/dev/stdin", directory: "/Users/dexonsmith/data/llvm/debug-info") | 263 !1 = !DIFile(filename: "/dev/stdin", directory: "/Users/dexonsmith/data/llvm/debug-info") |
264 !2 = !{} | 264 !2 = !{} |
265 !3 = !{!4} | 265 !3 = !{!4} |
266 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, function: void ()* @foo, variables: !2) | 266 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, variables: !2) |
267 !5 = !DISubroutineType(types: !6) | 267 !5 = !DISubroutineType(types: !6) |
268 !6 = !{null} | 268 !6 = !{null} |
269 !7 = !{i32 2, !"Dwarf Version", i32 2} | 269 !7 = !{i32 2, !"Dwarf Version", i32 2} |
270 !8 = !{i32 2, !"Debug Info Version", i32 3} | 270 !8 = !{i32 2, !"Debug Info Version", i32 3} |
271 !9 = !{i32 1, !"PIC Level", i32 2} | 271 !9 = !{i32 1, !"PIC Level", i32 2} |
302 scope information for the variable ``X``. | 302 scope information for the variable ``X``. |
303 | 303 |
304 .. code-block:: llvm | 304 .. code-block:: llvm |
305 | 305 |
306 !14 = !DILocation(line: 2, column: 9, scope: !4) | 306 !14 = !DILocation(line: 2, column: 9, scope: !4) |
307 !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, | 307 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, |
308 isLocal: false, isDefinition: true, scopeLine: 1, | 308 isLocal: false, isDefinition: true, scopeLine: 1, |
309 isOptimized: false, function: void ()* @foo, | 309 isOptimized: false, variables: !2) |
310 variables: !2) | |
311 | 310 |
312 Here ``!14`` is metadata providing `location information | 311 Here ``!14`` is metadata providing `location information |
313 <LangRef.html#dilocation>`_. In this example, scope is encoded by ``!4``, a | 312 <LangRef.html#dilocation>`_. In this example, scope is encoded by ``!4``, a |
314 `subprogram descriptor <LangRef.html#disubprogram>`_. This way the location | 313 `subprogram descriptor <LangRef.html#disubprogram>`_. This way the location |
315 information attached to the intrinsics indicates that the variable ``X`` is | 314 information attached to the intrinsics indicates that the variable ``X`` is |
461 ;; Define the anchor for subprograms. | 460 ;; Define the anchor for subprograms. |
462 ;; | 461 ;; |
463 !4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, | 462 !4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, |
464 isLocal: false, isDefinition: true, scopeLine: 1, | 463 isLocal: false, isDefinition: true, scopeLine: 1, |
465 flags: DIFlagPrototyped, isOptimized: false, | 464 flags: DIFlagPrototyped, isOptimized: false, |
466 function: i32 (i32, i8**)* @main, variables: !2) | 465 variables: !2) |
467 | 466 |
468 ;; | 467 ;; |
469 ;; Define the subprogram itself. | 468 ;; Define the subprogram itself. |
470 ;; | 469 ;; |
471 define i32 @main(i32 %argc, i8** %argv) { | 470 define i32 @main(i32 %argc, i8** %argv) !dbg !4 { |
472 ... | 471 ... |
473 } | 472 } |
474 | 473 |
475 Debugging information format | 474 Debugging information format |
476 ============================ | 475 ============================ |