You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-tools/wamr-ide/README.md
+55-22Lines changed: 55 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,17 @@ The WAMR-IDE is an Integrated Development Environment to develop WebAssembly app
14
14
15
15
## How to setup WAMR IDE
16
16
17
-
Note: Please ensure that the scripts under `resource` directories have
18
-
execution permission. While on git they have x bits, you might have dropped
19
-
them eg. by copying them from Windows.
20
-
Similarly, do not drop execution permission when copying `lldb` binaries
21
-
under `resource/debug/bin`.
17
+
Now, we have same version tagged docker images, lldb binaries and VS Code installation file(.vsix file) packed for each GitHub release. So if you simply want to use WAMR debugging features in VS Code, the ideal(and effortless) way is following the tutorial in [this section](#21-download-wamr-vs-code-extension-from-the-github-releaserecommended-approach).
22
18
23
-
#### 1. Install `VSCode` on host.
19
+
Alternatively, if you want to build lldb, docker images, or .vsix file locally so that you can try the effect of your modification, you could refer to the tutorial in [this section](#22-build-wamr-vs-code-extension-locallyalternative-approach).
20
+
21
+
### 1. Preparation
22
+
23
+
#### 1.1. Install `VSCode` on host
24
24
25
25
- make sure the version of [vscode](https://code.visualstudio.com/Download) you installed is at least _1.59.0_
#### 3. Load docker images from the release tar file or build docker images on the host
40
+
### 2. WAMR VS Code extension: download from the GitHub release or build locally
41
+
42
+
#### 2.1 Download WAMR VS Code extension from the GitHub release(Recommended approach)
41
43
42
-
##### 3.1 Load docker images from the release tar file
44
+
##### 2.1.1 Load docker images from the GitHub release tar file
43
45
44
-
From now on, for each release, we have the same version tagged docker image saved as a tar file, which you can find and download in the release.
46
+
From now on, for each GitHub release, we have the same version tagged docker image saved as a tar file, which you can find and download in the GitHub release.
45
47
46
48
You could download the tar archive files for docker images from the release, and then load them using the following commands:
##### 2.1.2 Download the VS Code extension installation file from the GitHub release
74
+
75
+
From now on, for each GitHub release, we have the same version tagged zip/tar.gz file. For example, in release version 1.1.2, you can easily download and decompress `wamr-ide-1.1.2.tar.gz``wamr-ide-1.1.2.zip`, which contains `wamr-ide.vsix` VS Code extension installation file. As you can imagine, in the future, when new releases are available, you can freely choose whichever version(for example, 1.2.0, 1.3.0, etc.) you prefer. It should work as long as you download the same version tagged docker image and .vsix file.
76
+
77
+
##### 2.1.3 Install extension from vsix
78
+
79
+

80
+
81
+
select `wamr-ide.vsix` which you have decompressed from `.tar.gz` or `.zip` file.
82
+
83
+
#### 2.2 Build WAMR VS Code extension locally(Alternative approach)
84
+
85
+
You could also build the VS Code extension locally, the following instruction provides a thorough tutorial. It's worth noting that in the local build tutorial we use hard-coded tag version 1.0 other than the semantic version of WAMR.
86
+
87
+
Note: Please ensure that the scripts under `resource` directories have execution permission. While on git they have x bits, you might have dropped them eg. by copying them from Windows. Similarly, do not drop execution permission when copying `lldb` binaries under `resource/debug/bin`.
88
+
89
+
##### 2.2.1 Build docker images on host
72
90
73
91
We have 2 docker images which should be built or loaded on your host, `wasm-toolchain` and `wasm-debug-server`. To build these 2 images, please enter the `WASM-Debug-Server/Docker` & `WASM-Toolchain/Docker`, then execute the `build_docker_image` script respectively.
74
92
@@ -90,11 +108,11 @@ $ cd ./WASM-Debug-Server/Docker
90
108
$ ./build_docker_image.sh
91
109
```
92
110
93
-
#### After building, you can find `wasm-toolchain` and `wasm-debug-server` docker images on your local
111
+
##### 2.2.2 After building, you can find `wasm-toolchain` and `wasm-debug-server` docker images on your local
94
112
95
113

96
114
97
-
#### If building docker images fail during the process
115
+
##### 2.2.3 If building docker images fail during the process
98
116
99
117
Sometimes building the Docker images may fail due to bad network conditions. If the `wasm-toolchain` and `wasm-debug-server` images do not exist after building, please build them manually. Fix the proxy setting if needed and execute the following command to build docker images.
#### If you encounter the problem `failed to solve with frontend dockerfile.v0: failed to create LLB definition`, please config your docker desktop
135
+
##### 2.2.4 If you encounter the problem `failed to solve with frontend dockerfile.v0: failed to create LLB definition`, please config your docker desktop
- Make sure that the `wasm-toolchain:1.0` and `wasm-debug-server:1.0` docker images are both successfully built before using `WAMR IDE`, otherwise `Build`, `Run` and `Debug` will not work.
`wamride-1.0.0.vsix` can be packaged by [`npm vsce`](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).
128
146
@@ -134,14 +152,29 @@ $ npm install
134
152
$ vsce package
135
153
```
136
154
137
-
Note that patched `lldb` should be built and put into the `VSCode-Extension/resource/debug` folder before your package or extension debug process if you want to enable `source debugging` feature.
138
-
Please follow this [instruction](../../doc/source_debugging.md#debugging-with-interpreter) to build `lldb`.
139
-
Please follow this [instruction](./VSCode-Extension/resource/debug/README.md)
140
-
to copy the binaries.
155
+
##### 2.2.7 Enable VS Code debugging feature
156
+
157
+
By default, when you build .vsix locally, the debugging feature is off. Suppose you want to enable the source debugging feature. In that case, you could download `lldb` binaries from our GitHub release (for example, `wamr-lldb-1.1.2-x86_64-ubuntu-20.04.tar.gz`), decompress and put every subdirectory and file to the installed directory of your VS Code extension.
158
+
159
+
For example, let's say you are on an Ubuntu 20.04 machine. You first download and decompress `wamr-lldb-1.1.2-x86_64-ubuntu-20.04.tar.gz`, and you will get a `wamr-lldb` folder (or `inst` folder in our earlier release). Then, you can simply copy the files and directory inside that folder to the relative path `resource/debug/linux/` under your VS Code extension installation directory.
160
+
161
+
Example commands on an Ubuntu 20.04 machine:
162
+
163
+
```shell
164
+
# decompress .tar.gz file and get the folder
165
+
$ ls wamr-lldb
166
+
bin lib package.json syntaxes
167
+
# copy everything to the vscode extension installation path(in this case, it's /home/{usrname}/.vscode-server/extensions/wamr.wamride-1.0.0/)
If you want to use your own patched `lldb`, you could follow this [instruction](../../doc/source_debugging.md#debugging-with-interpreter) to build `lldb`. And follow this [instruction](./VSCode-Extension/resource/debug/README.md)
172
+
to copy the binaries to replace the existing ones.
173
+
141
174
142
175
> **You can also debug the extension directly follow this [instruction](./VSCode-Extension/README.md) without packing the extension.**
143
176
144
-
####5. Install extension from vsix
177
+
##### 2.2.7 Install extension from vsix
145
178
146
179

147
180
@@ -215,7 +248,7 @@ Click `Change workspace` button, a dialog will show as following. You can select
#### After setting up `include path` and `exclude files`, the corresponding folder and files will be decorated with color and icon as following picture shows.
251
+
#### After setting up `include path` and `exclude files`, the corresponding folder and files will be decorated with color and icon as following picture shows
219
252
220
253

Copy file name to clipboardExpand all lines: test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,14 @@
1
-
### If you want to enable `source debugging` for this extension, please build `lldb` firstly following this [instruction](../../../../../doc/source_debugging.md#debugging-with-interpreter).
1
+
### If you want to enable `source debugging` for this extension and use your own patched `lldb`, please build `lldb` firstly following this [instruction](../../../../../doc/source_debugging.md#debugging-with-interpreter)
2
2
3
-
### After building(`linux` for example), create `bin` folder and `lib` folder respectively in `linux` directory, add following necessary target files into the folders.
3
+
### After building(`linux` for example), create `bin` folder and `lib` folder respectively in `linux` directory, add following necessary target files into the folders
4
4
5
-
```shell
6
-
/llvm/build-lldb/bin/lldb # move this file to resource/debug/linux/bin/
7
-
/llvm/build-lldb/bin/lldb-vscode # move this file to resource/debug/linux/bin/
8
-
/llvm/build-lldb/lib/liblldb.so.13 # move this file to resource/debug/linux/lib/
9
-
```
5
+
```shell
6
+
/llvm/build-lldb/bin/lldb # move this file to {VS Code directory}/resource/debug/linux/bin/
7
+
/llvm/build-lldb/bin/lldb-vscode # move this file to {VS Code directory}/resource/debug/linux/bin/
8
+
/llvm/build-lldb/lib/liblldb.so.13 # move this file to {VS Code directory}/resource/debug/linux/lib/
9
+
```
10
+
11
+
> If you are debugging this extension following this [tutorial](../../README.md), {VS Code directory} will be `{WAMR root directory}/test-tools/wamr-ide/VSCode-Extension`. If you want to replace the current lldb with your own patched version so that you can use your patched lldb in VS Code, {VS Code directory} will be `~/.vscode/extensions/wamr.wamride-1.1.2` or `~/.vscode-server/extensions/wamr.wamride-1.1.2`.
10
12
11
13
Note: For macOS, the library is named like `liblldb.13.0.1.dylib`.
0 commit comments