* Fix all vapi files fixing valaswig bindings

- Implement missing methods
This commit is contained in:
pancake 2010-11-24 23:19:17 +01:00
parent 7a4faa0e1d
commit 7c844bb576
15 changed files with 73 additions and 24 deletions

2
TODO
View File

@ -7,7 +7,7 @@
Bindings
========
* Fix segfaults in valaswig
* Remove libr/pkgconfig ... already used?
* Distribute generated .i files or cxx files.. so build is faster
Debugger

View File

@ -243,6 +243,11 @@ R_API int r_debug_step_over(RDebug *dbg, int steps) {
return ret;
}
R_API int r_debug_kill_setup(RDebug *dbg, int sig, int action) {
// TODO: implement r_debug_kill_setup
return R_FALSE;
}
R_API int r_debug_continue_kill(RDebug *dbg, int sig) {
int ret = R_FALSE;
if (dbg && dbg->h && dbg->h->cont) {

View File

@ -115,3 +115,10 @@ R_API RDebugTracepoint *r_debug_trace_add (RDebug *dbg, ut64 addr, int size) {
} else tp->times++;
return tp;
}
R_API void r_debug_trace_reset (RDebug *dbg) {
RDebugTrace *t = dbg->trace;
r_list_destroy (t->traces);
t->traces = r_list_new ();
t->traces->free = free;
}

View File

@ -248,7 +248,7 @@ R_API int r_debug_arg_set (RDebug *dbg, int fast, int num, ut64 value);
R_API int r_debug_pid_list(struct r_debug_t *dbg, int pid);
R_API int r_debug_thread_list(struct r_debug_t *dbg, int pid);
R_API void r_debug_trace_reset (RDebug *dbg, int liberate);
R_API void r_debug_trace_reset (RDebug *dbg);
R_API int r_debug_trace_pc (RDebug *dbg);
R_API void r_debug_trace_at (RDebug *dbg, const char *str);
R_API RDebugTracepoint *r_debug_trace_get (RDebug *dbg, ut64 addr);

View File

@ -32,8 +32,7 @@ R_API char *r_print_hexpair(RPrint *p, const char *str, int idx);
R_API RPrint *r_print_new();
R_API RPrint *r_print_free(RPrint *p);
R_API void r_print_set_flags(RPrint *p, int _flags);
void r_print_unset_flags(RPrint *p, int flags);
R_API void r_print_set_width(RPrint *p, int width);
R_API void r_print_unset_flags(RPrint *p, int flags);
R_API void r_print_addr(RPrint *p, ut64 addr);
R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int base, int step);
R_API void r_print_hexpairs(RPrint *p, ut64 addr, const ut8 *buf, int len);

View File

@ -7,5 +7,5 @@ Name: r_anal
Description: radare foundation libraries
Version:
Requires:
Libs: -L${libdir} -lr_anal -lr_util -lr_lib
Libs: -L${libdir} -lr_anal -lr_util -lr_lib -lr_reg
Cflags: -I${includedir}/libr

View File

@ -7,5 +7,5 @@ Name: r_debug
Description: radare foundation libraries
Version: 0.2
Requires:
Libs: -L${libdir} -lr_util -lr_debug -lr_reg -lr_bp
Libs: -L${libdir} -lr_util -lr_debug -lr_reg -lr_bp -lr_anal
Cflags: -I${includedir}/libr

View File

@ -1,5 +1,5 @@
PKGNAME radare2-swig
VERSION 0.6
VERSION 0.6.1
CONTACT pancake ; pancake@nopcode.org
LANG_C!
@ -10,6 +10,23 @@ CHKPRG! SWIG swig
ARG_WITH USERCC=gcc cc Define C compiler to use (gcc by default) ;
ARG_WITH USERCXX=g++ cxx Define C++ compiler to use (g++ by default) ;
ARG_WITH USEROSTYPE=auto ostype Choose OS type ( gnulinux windows darwin ) ;
IFEQ USEROSTYPE auto ; {
IFEQ HOST_OS linux ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS netbsd ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS freebsd ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS openbsd ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS darwin ; {
USEROSTYPE = darwin ;
} } } } }
}
PKGCFG! FOO FOO libr

View File

@ -1,10 +1,12 @@
include ../config.mk
LIBS=r_util.so r_bp.so r_asm.so r_diff.so r_core.so r_bin.so r_cons.so r_anal.so r_cmd.so
LIBS+=r_debug.so r_config.so r_io.so r_syscall.so r_search.so r_lib.so libr.so r_flags.so
LIBS+=r_parse.so r_lang.so
LIBS=r_util.${SOEXT} r_bp.${SOEXT} r_asm.${SOEXT} r_diff.${SOEXT}
LIBS+=r_bin.${SOEXT} r_cons.${SOEXT} r_anal.${SOEXT} r_cmd.${SOEXT}
LIBS+=r_debug.${SOEXT} r_config.${SOEXT} r_io.${SOEXT} r_syscall.${SOEXT}
LIBS+=r_search.${SOEXT} r_lib.${SOEXT} libr.${SOEXT} r_flags.${SOEXT}
LIBS+=r_parse.${SOEXT} r_lang.${SOEXT} r_core.${SOEXT}
.SUFFIXES: .so
.SUFFIXES: .so .dylib .dll
all: ${LIBS}
@ -17,8 +19,8 @@ w32:
export CC CXX CFLAGS LDFLAGS ; \
${MAKE}
%.so:
@-test ../../libr/vapi/`echo $@|sed -e s,.so,.vapi,` -nt ${LIBS_PFX}$@ ; \
%.${SOEXT}:
@-test ../../libr/vapi/`echo $@|sed -e s,.${SOEXT},.vapi,` -nt ${LIBS_PFX}$@ ; \
if [ ! $$? = 0 ]; then \
if [ ! -e ${LIBS_PFX}$@ ]; then \
true ; \
@ -27,7 +29,7 @@ w32:
fi ; \
fi ; \
if [ $$? = 0 ]; then \
(cd .. && sh do-swig.sh ${LANG} `echo $@ | sed -e s,.so,,`) ; \
(cd .. && sh do-swig.sh ${LANG} `echo $@ | sed -e s,.${SOEXT},,`) ; \
fi
test:

View File

@ -54,7 +54,7 @@ public class RCore {
public int anal_bb(uint64 at, int depth, int head);
public int anal_bb_list(bool rad);
public int anal_bb_seek(uint64 addr);
public int anal_fcn(uint64 at, uint64 from, int depth);
public int anal_fcn(uint64 at, uint64 from, int reftype, int depth);
public int anal_fcn_list(string input, bool rad);
public int anal_graph(uint64 addr, int opts);
//public int anal_graph_fcn(string input, int opts);

View File

@ -1,3 +1,4 @@
r_anal
r_util
r_bp
r_reg

View File

@ -20,7 +20,7 @@ public class Radare.RDebug {
[CCode (cname="r_debug_wait")]
public bool hold();
public bool kill(int sig);
public bool kill(bool thread, int sig);
public bool kill_setup(int sig, int action); // XXX must be uint64 action
public bool select (int pid, int tid);
public bool step(int count);
@ -41,7 +41,7 @@ public class Radare.RDebug {
public RDebug.Map map_get(uint64 addr);
public bool map_sync ();
public RList<RDebug.Frame> frames ();
// TODO: public RList<RDebug.Frame> frames ();
public uint64 arg_get (int fast, int num);
public bool arg_set (int fast, int num, uint64 val);
@ -66,7 +66,7 @@ public class Radare.RDebug {
public int pid_list (int pid);
public int thread_list (int pid);
public void trace_reset (bool liberate);
public void trace_reset ();
public int trace_pc ();
public void trace_at (string str);
//public RDebug.Tracepoint trace_get(uint64 addr);
@ -87,7 +87,7 @@ public class Radare.RDebug {
}
// XXX cname=int must be deprecated by valaswig
[CCode (cprefix="R_DBG_PROC_", cname="int")]
[CCode (cname="int", cprefix="R_DBG_PROC_")]
public enum ProcessStatus {
STOP,
RUN,
@ -96,9 +96,14 @@ public class Radare.RDebug {
DEAD
}
[CCode (cprefix="R_DBG_REASON_", cname="int")]
[CCode (cname="int", cprefix="R_DBG_REASON_")]
public enum Reason {
NEWPROC,
NEW_PID,
NEW_TID,
NEW_LIB,
EXIT_PID,
EXIT_TID,
EXIT_LIB,
TRAP,
ILL,
SIGNAL,

View File

@ -13,7 +13,7 @@ namespace Radare {
//public static int lines (string file, string sa, int la, string file2, string sb, int lb);
//public int lines(string a, int len, string b, int len);
public static int gdiff(string file1, string file2, bool rad, bool va);
//public static int gdiff(string file1, string file2, bool rad, bool va);
public bool set_delta(int delta);
[Compact]

View File

@ -3,10 +3,22 @@
[Compact]
[CCode (cheader_filename="r_print.h", cprefix="r_print_", cname="struct r_print_t", free_function="r_print_free")]
public class Radare.RPrint {
/* constructor */
public RPrint();
/* fields */
public int width;
public bool interrupt;
public int limit;
public bool cur_enabled;
public int cur;
public int ocur;
public int flags;
//public string datefmt;
/* methods */
public string hexpair (string str, int idx);
public void set_flags (int flags);
public void set_width (int width);
public void hexdump(uint64 addr, uint8* buf, int len, int baddr, int step);
public void hexpairs(uint64 addr, uint8 *buf, int len);
public void bytes(uint8* buf, int len, string fmt);

View File

@ -3,8 +3,9 @@ using Radare;
public static void main(string[] args)
{
var c = new RCore();
var a = RDebug.ProcessStatus.STOP;
RCore.File *f = c.file_open("/bin/ls", 0);
stdout.printf("Filedescriptor: %d\n", f->fd);
stdout.printf("Filedescriptor: %d %d\n", f->fd, a);
c.cmd("x- 128 @ 33", false);
RCons.flush();
}