|
|
@@ -34,7 +34,7 @@ static char *tmpbuf;
|
|
|
static korp_mutex tmpbuf_lock;
|
|
|
|
|
|
int
|
|
|
-wasm_debug_handler_init()
|
|
|
+wasm_debug_handler_init(void)
|
|
|
{
|
|
|
int ret;
|
|
|
tmpbuf = wasm_runtime_malloc(MAX_PACKET_SIZE);
|
|
|
@@ -51,7 +51,7 @@ wasm_debug_handler_init()
|
|
|
}
|
|
|
|
|
|
void
|
|
|
-wasm_debug_handler_deinit()
|
|
|
+wasm_debug_handler_deinit(void)
|
|
|
{
|
|
|
wasm_runtime_free(tmpbuf);
|
|
|
tmpbuf = NULL;
|
|
|
@@ -204,8 +204,7 @@ handle_general_query(WASMGDBServer *server, char *payload)
|
|
|
if (!strcmp(name, "Supported")) {
|
|
|
os_mutex_lock(&tmpbuf_lock);
|
|
|
snprintf(tmpbuf, MAX_PACKET_SIZE,
|
|
|
- "qXfer:libraries:read+;PacketSize=%" PRIx32 ";",
|
|
|
- MAX_PACKET_SIZE);
|
|
|
+ "qXfer:libraries:read+;PacketSize=%x;", MAX_PACKET_SIZE);
|
|
|
write_packet(server, tmpbuf);
|
|
|
os_mutex_unlock(&tmpbuf_lock);
|
|
|
}
|
|
|
@@ -384,7 +383,7 @@ send_thread_stop_status(WASMGDBServer *server, uint32 status, korp_tid tid)
|
|
|
|
|
|
if (status == 0) {
|
|
|
os_mutex_lock(&tmpbuf_lock);
|
|
|
- snprintf(tmpbuf, MAX_PACKET_SIZE, "W%02x", status);
|
|
|
+ snprintf(tmpbuf, MAX_PACKET_SIZE, "W%02" PRIx32, status);
|
|
|
write_packet(server, tmpbuf);
|
|
|
os_mutex_unlock(&tmpbuf_lock);
|
|
|
return;
|
|
|
@@ -400,8 +399,9 @@ send_thread_stop_status(WASMGDBServer *server, uint32 status, korp_tid tid)
|
|
|
|
|
|
os_mutex_lock(&tmpbuf_lock);
|
|
|
// TODO: how name a wasm thread?
|
|
|
- len += snprintf(tmpbuf, MAX_PACKET_SIZE, "T%02xthread:%" PRIx64 ";name:%s;",
|
|
|
- gdb_status, (uint64)(uintptr_t)tid, "nobody");
|
|
|
+ len += snprintf(tmpbuf, MAX_PACKET_SIZE,
|
|
|
+ "T%02" PRIx32 "thread:%" PRIx64 ";name:%s;", gdb_status,
|
|
|
+ (uint64)(uintptr_t)tid, "nobody");
|
|
|
if (tids_count > 0) {
|
|
|
len += snprintf(tmpbuf + len, MAX_PACKET_SIZE - len, "threads:");
|
|
|
while (i < tids_count) {
|
|
|
@@ -624,7 +624,8 @@ void
|
|
|
handle_get_write_memory(WASMGDBServer *server, char *payload)
|
|
|
{
|
|
|
size_t hex_len;
|
|
|
- int32 offset, act_len;
|
|
|
+ int offset;
|
|
|
+ int32 act_len;
|
|
|
uint64 maddr, mlen;
|
|
|
char *buff;
|
|
|
bool ret;
|