@@ -34,7 +34,7 @@ static char *tmpbuf;
3434static korp_mutex tmpbuf_lock ;
3535
3636int
37- wasm_debug_handler_init ()
37+ wasm_debug_handler_init (void )
3838{
3939 int ret ;
4040 tmpbuf = wasm_runtime_malloc (MAX_PACKET_SIZE );
@@ -51,7 +51,7 @@ wasm_debug_handler_init()
5151}
5252
5353void
54- wasm_debug_handler_deinit ()
54+ wasm_debug_handler_deinit (void )
5555{
5656 wasm_runtime_free (tmpbuf );
5757 tmpbuf = NULL ;
@@ -204,8 +204,7 @@ handle_general_query(WASMGDBServer *server, char *payload)
204204 if (!strcmp (name , "Supported" )) {
205205 os_mutex_lock (& tmpbuf_lock );
206206 snprintf (tmpbuf , MAX_PACKET_SIZE ,
207- "qXfer:libraries:read+;PacketSize=%" PRIx32 ";" ,
208- MAX_PACKET_SIZE );
207+ "qXfer:libraries:read+;PacketSize=%x;" , MAX_PACKET_SIZE );
209208 write_packet (server , tmpbuf );
210209 os_mutex_unlock (& tmpbuf_lock );
211210 }
@@ -384,7 +383,7 @@ send_thread_stop_status(WASMGDBServer *server, uint32 status, korp_tid tid)
384383
385384 if (status == 0 ) {
386385 os_mutex_lock (& tmpbuf_lock );
387- snprintf (tmpbuf , MAX_PACKET_SIZE , "W%02x" , status );
386+ snprintf (tmpbuf , MAX_PACKET_SIZE , "W%02" PRIx32 , status );
388387 write_packet (server , tmpbuf );
389388 os_mutex_unlock (& tmpbuf_lock );
390389 return ;
@@ -400,8 +399,9 @@ send_thread_stop_status(WASMGDBServer *server, uint32 status, korp_tid tid)
400399
401400 os_mutex_lock (& tmpbuf_lock );
402401 // TODO: how name a wasm thread?
403- len += snprintf (tmpbuf , MAX_PACKET_SIZE , "T%02xthread:%" PRIx64 ";name:%s;" ,
404- gdb_status , (uint64 )(uintptr_t )tid , "nobody" );
402+ len += snprintf (tmpbuf , MAX_PACKET_SIZE ,
403+ "T%02" PRIx32 "thread:%" PRIx64 ";name:%s;" , gdb_status ,
404+ (uint64 )(uintptr_t )tid , "nobody" );
405405 if (tids_count > 0 ) {
406406 len += snprintf (tmpbuf + len , MAX_PACKET_SIZE - len , "threads:" );
407407 while (i < tids_count ) {
624624handle_get_write_memory (WASMGDBServer * server , char * payload )
625625{
626626 size_t hex_len ;
627- int32 offset , act_len ;
627+ int offset ;
628+ int32 act_len ;
628629 uint64 maddr , mlen ;
629630 char * buff ;
630631 bool ret ;
0 commit comments