Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herrcai0907/assemblyscript-dbg
vscode extension for assemblyscript debugger
https://github.com/herrcai0907/assemblyscript-dbg
Last synced: about 1 month ago
JSON representation
vscode extension for assemblyscript debugger
- Host: GitHub
- URL: https://github.com/herrcai0907/assemblyscript-dbg
- Owner: HerrCai0907
- License: mit
- Created: 2022-08-21T11:39:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-01T05:41:28.000Z (over 2 years ago)
- Last Synced: 2024-10-14T14:49:49.475Z (3 months ago)
- Language: TypeScript
- Size: 387 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assemblyscript-dbg
vscode extension for assemblyscript debugger
## How to use
### environment
- rustc >= 1.63
- protobuf >= 3.15Before using, please install wasmdbg-grpc from github
```bash
cargo install wasmdbg-grpc --git https://github.com/HerrCai0907/wasmdbg.git
```### recommand compile flag
```json
"options": {
"disable": ["sign-extension", "nontrapping-f2i", "bulk-memory"],
"runtime": "stub"
}
```Due to some compiler bug, in increment runtime souce-map miss lots of information, so use stub runtime is easy to debug.
Now interpreter does not support some instruction, so disable some ASC feature is also needed.
### import function
in `launch.json`, you can define a list of files to provide import function
```json
"configurations": [
{
"type": "assemblyscript-debug",
"request": "launch",
"name": "Ask for file name",
"program": "${workspaceFolder}/build/debug.wasm",
"cwd": "${workspaceFolder}",
"apiFiles": ["${workspaceFolder}/api.cjs"]
}
]
``````javascript
// api.cjs
module.exports = {
env: {
trace: (extension, args, memory, globals) => {
// actually extension already provide it, but you can replace it by yourself
const offset = args[0];
const n = args[1];
extension.logInfo(
`trace: ${extension.helper.getString(offset, memory)}${n ? " " : ""}${args.slice(2, 2 + n).join(", ")}`
);
return null;
},
},
index: {
getI32: (extension, args, memory, globals) => {
extension.logInfo(`call getI32, will return ${1024}`);
return 1024;
},
},
};
```