llvm-project/lldb/test/Shell/Symtab/symtab-wasm.test
Derek Schuff 782f50792f
[lldb][Wasm] Handle imports when parsing Wasm name sections (#170960)
LLDB can use the wasm name section to populate its symbol table and get
names for functions. However the index space used in the name section is
the "function index space" which includes imported as well as locally
defined functions.
2025-12-09 23:41:06 +00:00

19 lines
1.4 KiB
Plaintext

# RUN: yaml2obj %S/Inputs/simple.wasm.yaml -o %t.wasm
# RUN: %lldb %t.wasm -o 'image dump symtab' | FileCheck %s --check-prefix SYMTAB
SYMTAB: Code 0x0000000000000000 0x0000000000000000 0x00000000 foo
SYMTAB: Code 0x0000000000000000 0x0000000000000000 0x00000000 another_import
SYMTAB: Code 0x0000000000000002 0x0000000000000002 0x00000000 __wasm_call_ctors
SYMTAB: Code 0x0000000000000005 0x0000000000000029 0x00000000 add
SYMTAB: Code 0x000000000000002f 0x000000000000004c 0x00000000 __original_main
SYMTAB: Code 0x000000000000007c 0x0000000000000009 0x00000000 main
# RUN: %lldb %t.wasm -o 'image dump sections' | FileCheck %s --check-prefix SECTIONS
SECTIONS: 0x0000000000000001 code [0x0000000000000000-0x0000000000000085) --- 0x000001d2 0x00000085 0x00000000 symtab-wasm.test.tmp.wasm.code
SECTIONS: 0x0000000000000040 wasm-name --- 0x00000282 0x0000006e 0x00000000 symtab-wasm.test.tmp.wasm.name
SECTIONS: 0x0000000000000100 data [0x0000000000000400-0x0000000000000409) --- 0x00000264 0x00000009 0x00000000 symtab-wasm.test.tmp.wasm..rodata
SECTIONS: 0x0000000000000200 data [0x000000000000040c-0x0000000000000410) --- 0x00000273 0x00000004 0x00000000 symtab-wasm.test.tmp.wasm..data
# RUN: %lldb %t.wasm -o 'x/s 0x0000000000000400' | FileCheck %s --check-prefix STR
STR: "data str"