1 # RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/symtab.out
2 # RUN: %lldb %T/symtab.out -o "target symbols add -s symtab.out %S/Inputs/symtab.syms" \
3 # RUN: -s %s | FileCheck %s
5 # CHECK-LABEL: (lldb) image dump symtab symtab.out
6 # CHECK: Symtab, file = {{.*}}symtab.out, num_symbols = 4:
7 # CHECK: Index UserID DSX Type File Address/Value Load Address Size Flags Name
8 # CHECK: [ 0] 0 SX Code 0x0000000000400000 0x00000000000000b0 0x00000000 ___lldb_unnamed_symbol{{[0-9]*}}
9 # CHECK: [ 1] 0 X Code 0x00000000004000b0 0x0000000000000010 0x00000000 f1
10 # CHECK: [ 2] 0 X Code 0x00000000004000c0 0x0000000000000010 0x00000000 f2
11 # CHECK: [ 3] 0 X Code 0x00000000004000d0 0x0000000000000022 0x00000000 _start
13 # CHECK-LABEL: (lldb) image lookup -a 0x4000b0 -v
14 # CHECK: Address: symtab.out[0x00000000004000b0] (symtab.out.PT_LOAD[0]..text2 + 0)
15 # CHECK: Function: id = {0x00000001}, name = "f1_func", range = [0x00000000004000b0-0x00000000004000bc)
16 # CHECK: Symbol: id = {0x00000000}, range = [0x00000000004000b0-0x00000000004000c0), name="f1"
18 # CHECK-LABEL: (lldb) image lookup -n f2 -v
19 # CHECK: Address: symtab.out[0x00000000004000c0] (symtab.out.PT_LOAD[0]..text2 + 16)
20 # CHECK: Symbol: id = {0x00000000}, range = [0x00000000004000c0-0x00000000004000d0), name="f2"
22 image dump symtab symtab.out
23 image lookup -a 0x4000b0 -v