This PR implements a register context for Wasm, which uses virtual registers to resolve Wasm local, globals and stack values. The registers are used to implement support for `DW_OP_WASM_location` in the DWARF expression evaluator (#151010). This also adds a more comprehensive test, showing that we can use this to show local variables.
229 lines
7.8 KiB
YAML
229 lines
7.8 KiB
YAML
--- !WASM
|
|
FileHeader:
|
|
Version: 0x1
|
|
Sections:
|
|
- Type: TYPE
|
|
Signatures:
|
|
- Index: 0
|
|
ParamTypes: []
|
|
ReturnTypes: []
|
|
- Index: 1
|
|
ParamTypes:
|
|
- I32
|
|
- I32
|
|
ReturnTypes:
|
|
- I32
|
|
- Index: 2
|
|
ParamTypes: []
|
|
ReturnTypes:
|
|
- I32
|
|
- Type: FUNCTION
|
|
FunctionTypes: [ 0, 1, 2, 1 ]
|
|
- Type: TABLE
|
|
Tables:
|
|
- Index: 0
|
|
ElemType: FUNCREF
|
|
Limits:
|
|
Flags: [ HAS_MAX ]
|
|
Minimum: 0x1
|
|
Maximum: 0x1
|
|
- Type: MEMORY
|
|
Memories:
|
|
- Minimum: 0x2
|
|
- Type: GLOBAL
|
|
Globals:
|
|
- Index: 0
|
|
Type: I32
|
|
Mutable: true
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 66560
|
|
- Index: 1
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 1024
|
|
- Index: 2
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 1024
|
|
- Index: 3
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 1024
|
|
- Index: 4
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 66560
|
|
- Index: 5
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 1024
|
|
- Index: 6
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 66560
|
|
- Index: 7
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 131072
|
|
- Index: 8
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 0
|
|
- Index: 9
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 1
|
|
- Index: 10
|
|
Type: I32
|
|
Mutable: false
|
|
InitExpr:
|
|
Opcode: I32_CONST
|
|
Value: 65536
|
|
- Type: EXPORT
|
|
Exports:
|
|
- Name: memory
|
|
Kind: MEMORY
|
|
Index: 0
|
|
- Name: __wasm_call_ctors
|
|
Kind: FUNCTION
|
|
Index: 0
|
|
- Name: add
|
|
Kind: FUNCTION
|
|
Index: 1
|
|
- Name: __original_main
|
|
Kind: FUNCTION
|
|
Index: 2
|
|
- Name: main
|
|
Kind: FUNCTION
|
|
Index: 3
|
|
- Name: __main_void
|
|
Kind: FUNCTION
|
|
Index: 2
|
|
- Name: __indirect_function_table
|
|
Kind: TABLE
|
|
Index: 0
|
|
- Name: __dso_handle
|
|
Kind: GLOBAL
|
|
Index: 1
|
|
- Name: __data_end
|
|
Kind: GLOBAL
|
|
Index: 2
|
|
- Name: __stack_low
|
|
Kind: GLOBAL
|
|
Index: 3
|
|
- Name: __stack_high
|
|
Kind: GLOBAL
|
|
Index: 4
|
|
- Name: __global_base
|
|
Kind: GLOBAL
|
|
Index: 5
|
|
- Name: __heap_base
|
|
Kind: GLOBAL
|
|
Index: 6
|
|
- Name: __heap_end
|
|
Kind: GLOBAL
|
|
Index: 7
|
|
- Name: __memory_base
|
|
Kind: GLOBAL
|
|
Index: 8
|
|
- Name: __table_base
|
|
Kind: GLOBAL
|
|
Index: 9
|
|
- Name: __wasm_first_page_end
|
|
Kind: GLOBAL
|
|
Index: 10
|
|
- Type: CODE
|
|
Functions:
|
|
- Index: 0
|
|
Locals: []
|
|
Body: 0B
|
|
- Index: 1
|
|
Locals:
|
|
- Type: I32
|
|
Count: 1
|
|
Body: 23808080800041106B21022002200036020C20022001360208200228020C20022802086A0F0B
|
|
- Index: 2
|
|
Locals:
|
|
- Type: I32
|
|
Count: 2
|
|
Body: 23808080800041106B210020002480808080002000410036020C2000410136020820004102360204200028020820002802041081808080002101200041106A24808080800020010F0B
|
|
- Index: 3
|
|
Locals: []
|
|
Body: 1082808080000F0B
|
|
- Type: CUSTOM
|
|
Name: .debug_abbrev
|
|
Payload: 011101250E1305030E10171B0E110155170000022E01110112064018030E3A0B3B0B271949133F1900000305000218030E3A0B3B0B49130000042E01110112064018030E3A0B3B0B49133F1900000534000218030E3A0B3B0B49130000062400030E3E0B0B0B000000
|
|
- Type: CUSTOM
|
|
Name: .debug_info
|
|
Payload: 940000000400000000000401620000001D0055000000000000000D000000000000000000000002050000002900000004ED00029F510000000101900000000302910C60000000010190000000030291085E00000001019000000000042F0000004C00000004ED00009F04000000010690000000050291080B0000000107900000000502910409000000010890000000000600000000050400
|
|
- Type: CUSTOM
|
|
Name: .debug_ranges
|
|
Payload: 050000002E0000002F0000007B0000000000000000000000
|
|
- Type: CUSTOM
|
|
Name: .debug_str
|
|
Payload: 696E74006D61696E006A0069002F55736572732F6A6F6E61732F7761736D2D6D6963726F2D72756E74696D652F70726F647563742D6D696E692F706C6174666F726D732F64617277696E2F6275696C64006164640073696D706C652E630062006100636C616E672076657273696F6E2032322E302E306769742028676974406769746875622E636F6D3A4A4465766C696567686572652F6C6C766D2D70726F6A6563742E67697420343161363839613132323834633834623632383933393461356338306264636534383733656466302900
|
|
- Type: CUSTOM
|
|
Name: .debug_line
|
|
Payload: 62000000040020000000010101FB0E0D0001010101000000010000010073696D706C652E6300000000000005020500000001050A0A08AE050E0658050C5805032002020001010005022F0000001705070A08BB75050E7505110658050A58050382020F000101
|
|
- Type: CUSTOM
|
|
Name: name
|
|
FunctionNames:
|
|
- Index: 0
|
|
Name: __wasm_call_ctors
|
|
- Index: 1
|
|
Name: add
|
|
- Index: 2
|
|
Name: __original_main
|
|
- Index: 3
|
|
Name: main
|
|
GlobalNames:
|
|
- Index: 0
|
|
Name: __stack_pointer
|
|
- Type: CUSTOM
|
|
Name: producers
|
|
Languages:
|
|
- Name: C11
|
|
Version: ''
|
|
Tools:
|
|
- Name: clang
|
|
Version: '22.0.0git'
|
|
- Type: CUSTOM
|
|
Name: target_features
|
|
Features:
|
|
- Prefix: USED
|
|
Name: bulk-memory
|
|
- Prefix: USED
|
|
Name: bulk-memory-opt
|
|
- Prefix: USED
|
|
Name: call-indirect-overlong
|
|
- Prefix: USED
|
|
Name: multivalue
|
|
- Prefix: USED
|
|
Name: mutable-globals
|
|
- Prefix: USED
|
|
Name: nontrapping-fptoint
|
|
- Prefix: USED
|
|
Name: reference-types
|
|
- Prefix: USED
|
|
Name: sign-ext
|
|
...
|