llvm-project/lldb/test/Shell/ObjectFile/wasm/embedded-debug-sections.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.6 KiB
YAML
Raw Normal View History

# RUN: yaml2obj %s -o %t
[LLDB] Add ObjectFileWasm plugin for WebAssembly debugging Summary: This is the first in a series of patches to enable LLDB debugging of WebAssembly targets. Current versions of Clang emit (partial) DWARF debug information in WebAssembly modules and we can leverage this debug information to give LLDB the ability to do source-level debugging of Wasm code that runs in a WebAssembly engine. A way to do this could be to use the remote debugging functionalities provided by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not only to connect a debugger to a process running on a remote machine, but also to connect the debugger to a managed VM or script engine that runs locally, provided that the engine implements a GDB-remote stub that offers the ability to access the engine runtime internal state. To make this work, the GDB-remote protocol would need to be extended with a few Wasm-specific custom query commands, used to access aspects of the Wasm engine state (like the Wasm memory, Wasm local and global variables, and so on). Furthermore, the DWARF format would need to be enriched with a few Wasm-specific extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf. This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm module loaded in a debuggee process. It knows how to parse Wasm modules and store the Code section and the DWARF-specific sections. Reviewers: jasonmolenda, clayborg, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D71575
2020-01-16 07:29:24 +08:00
# RUN: lldb-test object-file %t | FileCheck %s
# CHECK: Plugin name: wasm
# CHECK: Architecture: wasm32-unknown-unknown-wasm
# CHECK: UUID:
# CHECK: Executable: false
# CHECK: Stripped: false
# CHECK: Type: shared library
[LLDB] Add ObjectFileWasm plugin for WebAssembly debugging Summary: This is the first in a series of patches to enable LLDB debugging of WebAssembly targets. Current versions of Clang emit (partial) DWARF debug information in WebAssembly modules and we can leverage this debug information to give LLDB the ability to do source-level debugging of Wasm code that runs in a WebAssembly engine. A way to do this could be to use the remote debugging functionalities provided by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not only to connect a debugger to a process running on a remote machine, but also to connect the debugger to a managed VM or script engine that runs locally, provided that the engine implements a GDB-remote stub that offers the ability to access the engine runtime internal state. To make this work, the GDB-remote protocol would need to be extended with a few Wasm-specific custom query commands, used to access aspects of the Wasm engine state (like the Wasm memory, Wasm local and global variables, and so on). Furthermore, the DWARF format would need to be enriched with a few Wasm-specific extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf. This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm module loaded in a debuggee process. It knows how to parse Wasm modules and store the Code section and the DWARF-specific sections. Reviewers: jasonmolenda, clayborg, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D71575
2020-01-16 07:29:24 +08:00
# CHECK: Strata: user
# CHECK: Base VM address: 0x0
[LLDB] Add ObjectFileWasm plugin for WebAssembly debugging Summary: This is the first in a series of patches to enable LLDB debugging of WebAssembly targets. Current versions of Clang emit (partial) DWARF debug information in WebAssembly modules and we can leverage this debug information to give LLDB the ability to do source-level debugging of Wasm code that runs in a WebAssembly engine. A way to do this could be to use the remote debugging functionalities provided by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not only to connect a debugger to a process running on a remote machine, but also to connect the debugger to a managed VM or script engine that runs locally, provided that the engine implements a GDB-remote stub that offers the ability to access the engine runtime internal state. To make this work, the GDB-remote protocol would need to be extended with a few Wasm-specific custom query commands, used to access aspects of the Wasm engine state (like the Wasm memory, Wasm local and global variables, and so on). Furthermore, the DWARF format would need to be enriched with a few Wasm-specific extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf. This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm module loaded in a debuggee process. It knows how to parse Wasm modules and store the Code section and the DWARF-specific sections. Reviewers: jasonmolenda, clayborg, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D71575
2020-01-16 07:29:24 +08:00
# CHECK: Name: code
# CHECK: Type: code
# CHECK: VM address: 0x0
# CHECK: VM size: 56
# CHECK: File size: 56
# CHECK: Name: .debug_info
# CHECK: Type: dwarf-info
# CHECK: VM address: 0x0
# CHECK: VM size: 0
# CHECK: File size: 2
# CHECK: Name: .debug_abbrev
# CHECK: Type: dwarf-abbrev
# CHECK: VM address: 0x0
# CHECK: VM size: 0
# CHECK: File size: 2
# CHECK: Name: .debug_line
# CHECK: Type: dwarf-line
# CHECK: VM address: 0x0
# CHECK: VM size: 0
# CHECK: File size: 2
# CHECK: Name: .debug_str
# CHECK: Type: dwarf-str
# CHECK: VM address: 0x0
# CHECK: VM size: 0
# CHECK: File size: 3
--- !WASM
FileHeader:
Version: 0x00000001
Sections:
- Type: CODE
Functions:
- Index: 0
Locals:
- Type: I32
Count: 6
Body: 238080808000210141102102200120026B21032003200036020C200328020C2104200328020C2105200420056C210620060F0B
- Type: CUSTOM
Name: .debug_info
Payload: 4C00
- Type: CUSTOM
Name: .debug_abbrev
Payload: 0111
- Type: CUSTOM
Name: .debug_line
Payload: 5100
- Type: CUSTOM
Name: .debug_str
Payload: 636CFF
...