56 lines · plain
1# RUN: mkdir -p %t.dir2# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %t.dir/line-table.out3# RUN: %lldb %t.dir/line-table.out -o "target symbols add -s line-table.out %S/Inputs/line-table.syms" \4# RUN: -s %s -o exit | FileCheck %s5 6# We create a compile unit for each function. The compile unit name is the first7# line table entry in that function.8# This symbol file contains a single function in the "compile unit" a.c. This9# function has two line table sequences.10image dump line-table a.c11# CHECK-LABEL: Line table for /tmp/a.c12# CHECK-NEXT: 0x00000000004000b0: /tmp/a.c:113# CHECK-NEXT: 0x00000000004000b1: /tmp/a.c:214# CHECK-NEXT: 0x00000000004000b2: /tmp/c.c:215# CHECK-NEXT: 0x00000000004000b3: 16# CHECK-EMPTY: 17# CHECK-NEXT: 0x00000000004000b4: /tmp/c.c:318# CHECK-NEXT: 0x00000000004000b5: 19# CHECK-EMPTY: 20 21# Single compile unit for c.c with a single line sequence.22image dump line-table c.c23# CHECK-LABEL: Line table for /tmp/c.c24# CHECK-NEXT: 0x00000000004000c0: /tmp/c.c:125# CHECK-NEXT: 0x00000000004000c2: /tmp/a.c:226# CHECK-NEXT: 0x00000000004000c4: 27# CHECK-EMPTY: 28 29# There are two compile units called "d.c". Hence, two line tables.30image dump line-table d.c31# CHECK-LABEL: Line table for /tmp/d.c32# CHECK-NEXT: 0x00000000004000d0: /tmp/d.c:133# CHECK-NEXT: 0x00000000004000d2: 34# CHECK-EMPTY: 35# CHECK-LABEL: Line table for /tmp/d.c36# CHECK-NEXT: 0x00000000004000e0: /tmp/d.c:237# CHECK-NEXT: 0x00000000004000e2: 38# CHECK-EMPTY: 39 40image lookup -a 0x4000b2 -v41# CHECK-LABEL: image lookup -a 0x4000b2 -v42# CHECK: Summary: line-table.out`func + 243# CHECK: Function: id = {0x00000000}, name = "func", range = [0x00000000004000b0-0x00000000004000c0)44 45image dump symfile46# CHECK-LABEL: Compile units:47# CHECK-NEXT: CompileUnit{0x00000000}, language = "<not loaded>", file = '/tmp/a.c'48# CHECK-NEXT: Function{0x00000000}, demangled = func, type_uid = 0x0000000049# CHECK: CompileUnit{0x00000001}, language = "<not loaded>", file = '/tmp/c.c'50# CHECK-NEXT: CompileUnit{0x00000002}, language = "<not loaded>", file = '/tmp/d.c'51# CHECK-NEXT: CompileUnit{0x00000003}, language = "<not loaded>", file = '/tmp/d.c'52 53breakpoint set -f c.c -l 254# CHECK-LABEL: breakpoint set -f c.c -l 255# CHECK: Breakpoint 1: where = line-table.out`func + 2 at c.c:2, address = 0x00000000004000b256