Skip to content

Commit e2f9164

Browse files
author
Carlos Rojas
committed
Merge branch 'feat/wood' of github.com:TOPLLab/WARDuino into feat/wood
2 parents 4aaaf31 + 9815ff4 commit e2f9164

11 files changed

Lines changed: 181 additions & 124 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Supported platforms: Linux (Ubuntu), macOS, ESP-IDF, Arduino
2222
The project uses CMake. Quick install looks like this:
2323

2424
```bash
25-
git clone git@github.com:TOPLLab/WARDuino.git
25+
git clone --recursive git@github.com:TOPLLab/WARDuino.git
2626
cd WARDuino
2727
mkdir build-emu
2828
cd build-emu

documentation/DumpFormat.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,79 @@ The locals can also be retreived on their own with the 0x11 byte.
9191
}
9292
```
9393

94+
## WOOD Dump (0x60)
95+
96+
```json
97+
{
98+
"pc":"0x564df0c5e746",
99+
"start":[
100+
"0x564df0c5e6a0"
101+
],
102+
"breakpoints":[
103+
104+
],
105+
"stack":[
106+
{
107+
"idx":0,
108+
"type":"i32",
109+
"value":1000
110+
}
111+
],
112+
"callstack":[
113+
{
114+
"type":0,
115+
"fidx":"0x4",
116+
"sp":-1,
117+
"fp":-1,
118+
"block_key":"(nil)",
119+
"ra":"0x564df0c5e70f"
120+
},
121+
{
122+
"type":3,
123+
"fidx":"0x0",
124+
"sp":0,
125+
"fp":0,
126+
"block_key":"0x564df0c5e730",
127+
"ra":"0x564df0c5e732"
128+
}
129+
],
130+
"globals":[
131+
{
132+
"idx":0,
133+
"type":"i32",
134+
"value":23
135+
},
136+
{
137+
"idx":1,
138+
"type":"i32",
139+
"value":1
140+
},
141+
{
142+
"idx":2,
143+
"type":"i32",
144+
"value":0
145+
}
146+
],
147+
"table":{
148+
"max":0,
149+
"init":0,
150+
"elements":[
151+
152+
]
153+
},
154+
"memory":{
155+
"pages":0,
156+
"max":0,
157+
"init":0,
158+
"bytes":[
159+
160+
]
161+
},
162+
"br_table":{
163+
"size":"0x100",
164+
"labels":[
165+
166+
]
167+
}
168+
}
169+
```

platforms/Arduino/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
flash:
2-
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32wrover Arduino.ino
2+
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32wrover Arduino.ino
33

44
compile:
55
arduino-cli -v compile --fqbn esp32:esp32:esp32wrover Arduino.ino
66

77
monitor:
8-
arduino-cli monitor -p /dev/ttyUSB0 -c baudrate=115200
8+
arduino-cli monitor -p /dev/ttyUSB0 -c baudrate=115200

platforms/CLI-Emulator/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "../../src/Debug/debugger.h"
1414
#include "../../src/Utils/macros.h"
15-
#include "../../src/WARDuino.h"
1615
#include "../../tests/integration/wasm_tests.h"
1716

1817
// Constants
@@ -47,6 +46,9 @@ void print_help() {
4746
"binaries (default: wat2wasm)\n");
4847
fprintf(stdout,
4948
" --file Wasm file (module) to load and execute\n");
49+
fprintf(stdout,
50+
" --no-socket Run without socket "
51+
"(default: false)\n");
5052
}
5153

5254
Module *load(WARDuino wac, const char *file_name, Options opt) {
@@ -116,7 +118,7 @@ void bindSocketToAddress(int socket_fd, struct sockaddr_in address) {
116118
}
117119

118120
struct sockaddr_in createAddress(int port) {
119-
struct sockaddr_in address;
121+
struct sockaddr_in address {};
120122
address.sin_family = AF_INET;
121123
address.sin_addr.s_addr = INADDR_ANY;
122124
address.sin_port = htons(port);

0 commit comments

Comments
 (0)