Fix some wasi build warnings

This commit is contained in:
pancake 2023-11-15 19:15:53 +01:00 committed by pancake
parent d5c81a09ea
commit 1fe0153702
8 changed files with 32 additions and 21 deletions

View File

@ -1,23 +1,26 @@
/* radare - LGPL - Copyright 2023 - pancake */
/* radare - LGPL - Copyright 2011-2023 - pancake */
#include <r_bp.h>
#include <r_lib.h>
static RBreakpointArch r_bp_plugin_null_bps[] = {
static RBreakpointArch r_bp_plugin_bf_bps[] = {
{ 0, 1, 0, (const ut8*)"\xff" },
{ 0, 1, 0, (const ut8*)"\x00" },
{ 0, 0, 0, NULL },
};
RBreakpointPlugin r_bp_plugin_null = {
.name = "null",
.arch = "null",
.nbps = 0,
.bps = r_bp_plugin_null_bps,
RBreakpointPlugin r_bp_plugin_bf = {
.name = "bf",
.arch = "bf",
.nbps = 2,
.bps = r_bp_plugin_bf_bps,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_BP,
.data = &r_bp_plugin_null,
.data = &r_bp_plugin_bf,
.version = R2_VERSION
};
#endif

View File

@ -1,25 +1,23 @@
/* radare - LGPL - Copyright 2011-2023 - pancake */
/* radare - LGPL - Copyright 2023 - pancake */
#include <r_bp.h>
#include <r_lib.h>
static RBreakpointArch r_bp_plugin_bf_bps[] = {
{ 0, 1, 0, (const ut8*)"\xff" },
{ 0, 1, 0, (const ut8*)"\x00" },
static RBreakpointArch r_bp_plugin_null_bps[] = {
{ 0, 0, 0, NULL },
};
RBreakpointPlugin r_bp_plugin_bf = {
.name = "bf",
.arch = "bf",
.nbps = 2,
.bps = r_bp_plugin_bf_bps,
RBreakpointPlugin r_bp_plugin_null = {
.name = "null",
.arch = "null",
.nbps = 0,
.bps = r_bp_plugin_null_bps,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_BP,
.data = &r_bp_plugin_bf,
.data = &r_bp_plugin_null,
.version = R2_VERSION
};
#endif

View File

@ -15,6 +15,7 @@ r_debug_sources = [
'p/debug_bf.c',
'p/debug_bochs.c',
'p/debug_esil.c',
#'p/debug_rv32ima.c',
'p/debug_gdb.c',
'p/debug_io.c',
'p/debug_native.c',

View File

@ -21,6 +21,7 @@ r_io_sources = [
'p/io_socket.c',
'p/io_debug.c',
'p/io_default.c',
'p/io_sysgdb.c',
'p/io_gdb.c',
'p/io_gprobe.c',
'p/io_gzip.c',

View File

@ -304,7 +304,6 @@ if get_option('plugins') == ''
'bf',
'bochs',
'gdb',
'sysgdb',
'native',
'qnx',
'winkd'
@ -363,6 +362,10 @@ if get_option('plugins') == ''
'w32',
]
debug_plugins += 'windbg'
else
io_plugins += [
'sysgdb',
]
endif
lang_plugins += [

View File

@ -36,7 +36,7 @@ Usage Example:
#define HAVE_R2PIPE 1
#endif
#if !R2__WINDOWS__
#if !R2__WINDOWS__ && !__wasi__
static void env(const char *s, int f) {
char *a = r_str_newf ("%d", f);
r_sys_setenv (s, a);
@ -187,9 +187,10 @@ static int w32_createPipe(R2Pipe *r2pipe, const char *cmd) {
}
#endif
#if HAVE_R2PIPE
static R2Pipe* r2p_open_spawn(R2Pipe* r2p, const char *cmd) {
r_return_val_if_fail (r2p, NULL);
#if HAVE_R2PIPE && (R2__UNIX__ || defined(__CYGWIN__))
#if R2__UNIX__ || defined(__CYGWIN__)
char *out = r_sys_getenv ("R2PIPE_IN");
char *in = r_sys_getenv ("R2PIPE_OUT");
int done = false;
@ -214,6 +215,7 @@ static R2Pipe* r2p_open_spawn(R2Pipe* r2p, const char *cmd) {
return NULL;
#endif
}
#endif
static R2Pipe *r2pipe_new(void) {
R2Pipe *r2pipe = R_NEW0 (R2Pipe);

View File

@ -1289,7 +1289,9 @@ R_API bool r_run_start(RRunProfile *p) {
// setvbuf (stdout, NULL, _IONBF, 0);
if (p->_timeout) {
#if R2__UNIX__
#if !__wasi__
int mypid = r_sys_getpid ();
#endif
if (!r_sys_fork ()) {
int use_signal = p->_timeout_sig;
if (use_signal < 1) {

View File

@ -122,6 +122,7 @@ ae dummy_op
EOF
EXPECT=<<EOF
dummy
null
--
--
EOF