File: line-table.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (54 lines) | stat: -rw-r--r-- 2,259 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/line-table.out
# RUN: %lldb %T/line-table.out -o "target symbols add -s line-table.out %S/Inputs/line-table.syms" \
# RUN:   -s %s -o exit | FileCheck %s

# We create a compile unit for each function. The compile unit name is the first
# line table entry in that function.
# This symbol file contains a single function in the "compile unit" a.c. This
# function has two line table sequences.
image dump line-table a.c
# CHECK-LABEL: Line table for /tmp/a.c
# CHECK-NEXT: 0x00000000004000b0: /tmp/a.c:1
# CHECK-NEXT: 0x00000000004000b1: /tmp/a.c:2
# CHECK-NEXT: 0x00000000004000b2: /tmp/c.c:2
# CHECK-NEXT: 0x00000000004000b3: 
# CHECK-EMPTY: 
# CHECK-NEXT: 0x00000000004000b4: /tmp/c.c:3
# CHECK-NEXT: 0x00000000004000b5: 
# CHECK-EMPTY: 

# Single compile unit for c.c with a single line sequence.
image dump line-table c.c
# CHECK-LABEL: Line table for /tmp/c.c
# CHECK-NEXT: 0x00000000004000c0: /tmp/c.c:1
# CHECK-NEXT: 0x00000000004000c2: /tmp/a.c:2
# CHECK-NEXT: 0x00000000004000c4: 
# CHECK-EMPTY: 

# There are two compile units called "d.c". Hence, two line tables.
image dump line-table d.c
# CHECK-LABEL: Line table for /tmp/d.c
# CHECK-NEXT: 0x00000000004000d0: /tmp/d.c:1
# CHECK-NEXT: 0x00000000004000d2: 
# CHECK-EMPTY: 
# CHECK-LABEL: Line table for /tmp/d.c
# CHECK-NEXT: 0x00000000004000e0: /tmp/d.c:2
# CHECK-NEXT: 0x00000000004000e2: 
# CHECK-EMPTY: 

image lookup -a 0x4000b2 -v
# CHECK-LABEL: image lookup -a 0x4000b2 -v
# CHECK: Summary: line-table.out`func + 2
# CHECK: Function: id = {0x00000000}, name = "func", range = [0x00000000004000b0-0x00000000004000c0)

image dump symfile
# CHECK-LABEL: Compile units:
# CHECK-NEXT:  CompileUnit{0x00000000}, language = "<not loaded>", file = '/tmp/a.c'
# CHECK-NEXT:   Function{0x00000000}, demangled = func, type_uid = 0x00000000
# CHECK:  CompileUnit{0x00000001}, language = "<not loaded>", file = '/tmp/c.c'
# CHECK-NEXT:  CompileUnit{0x00000002}, language = "<not loaded>", file = '/tmp/d.c'
# CHECK-NEXT:  CompileUnit{0x00000003}, language = "<not loaded>", file = '/tmp/d.c'

breakpoint set -f c.c -l 2
# CHECK-LABEL: breakpoint set -f c.c -l 2
# CHECK: Breakpoint 1: where = line-table.out`func + 2 at c.c:2, address = 0x00000000004000b2