* Remove remaining fastcall stuff from r_asm

* Fix build for bindings
This commit is contained in:
Nibble 2011-02-04 18:34:20 +01:00
parent 0906e809fe
commit 5742b10641
15 changed files with 34 additions and 45 deletions

View File

@ -16,7 +16,6 @@ pre:
re:
rm -f asm.o libr_asm.so
${MAKE}
rm -f t/fastcall.o
sudo ${MAKE} install
plugins:

View File

@ -64,7 +64,7 @@ R_API int r_core_visual_trackflags(RCore *core) {
if (menu) {
r_cons_printf ("\n Flags in flagspace '%s'. Press '?' for help.\n\n",
(core->flags->space_idx==-1)?"*":core->flags->space[core->flags->space_idx]);
(core->flags->space_idx==-1)?"*":core->flags->spaces[core->flags->space_idx]);
hit = 0;
i = j = 0;
r_list_foreach (core->flags->flags, iter, flag) {
@ -101,9 +101,9 @@ R_API int r_core_visual_trackflags(RCore *core) {
r_cons_printf ("\n Flag spaces:\n\n");
hit = 0;
for (j=i=0;i<R_FLAG_SPACES_MAX;i++) {
if (core->flags->space[i]) {
if (core->flags->spaces[i]) {
if (option==i) {
fs = core->flags->space[i];
fs = core->flags->spaces[i];
hit = 1;
}
if ((i >=option-delta) && ((i<option+delta)|| \
@ -111,7 +111,7 @@ R_API int r_core_visual_trackflags(RCore *core) {
r_cons_printf(" %c %02d %c %s\n",
(option==i)?'>':' ', j,
(i==core->flags->space_idx)?'*':' ',
core->flags->space[i]);
core->flags->spaces[i]);
j++;
}
}

View File

@ -2,7 +2,7 @@
#include <r_debug.h>
R_API RDebugPid *r_debug_pid_new(char *path, int pid, char status, ut64 pc) {
R_API RDebugPid *r_debug_pid_new(const char *path, int pid, char status, ut64 pc) {
RDebugPid *p = R_NEW (RDebugPid);
p->path = strdup (path);
p->pid = pid;

View File

@ -90,7 +90,7 @@ R_API RFlag * r_flag_new() {
btree_init (&f->ntree);
#endif
for (i=0;i<R_FLAG_SPACES_MAX;i++)
f->space[i] = NULL;
f->spaces[i] = NULL;
}
return f;
}

View File

@ -3,9 +3,9 @@
#include <r_flags.h>
R_API const char *r_flag_space_get(struct r_flag_t *f, int idx) {
if (idx==-1 || idx>255 || f->space[idx]=='\0')
if (idx==-1 || idx>255 || f->spaces[idx]=='\0')
return "";
return f->space[idx];
return f->spaces[idx];
}
#if 0
@ -28,16 +28,16 @@ R_API void r_flag_space_set(RFlag *f, const char *name) {
}
for (i=0;i<R_FLAG_SPACES_MAX;i++) {
if (f->space[i] != NULL)
if (!strcmp (name, f->space[i])) {
if (f->spaces[i] != NULL)
if (!strcmp (name, f->spaces[i])) {
f->space_idx = i; //flag_space_idx = i;
return;
}
}
/* not found */
for(i=0;i<R_FLAG_SPACES_MAX;i++) {
if (f->space[i] == NULL) {
f->space[i] = strdup (name);
if (f->spaces[i] == NULL) {
f->spaces[i] = strdup (name);
f->space_idx = i;
break;
}
@ -47,8 +47,8 @@ R_API void r_flag_space_set(RFlag *f, const char *name) {
R_API void r_flag_space_list(RFlag *f) {
int i,j = 0;
for(i=0;i<R_FLAG_SPACES_MAX;i++) {
if (f->space[i])
if (f->spaces[i])
printf("%02d %c %s\n", j++,
(i==f->space_idx)?'*':' ', f->space[i]);
(i==f->space_idx)?'*':' ', f->spaces[i]);
}
}

View File

@ -91,7 +91,6 @@ typedef struct r_asm_plugin_t {
#ifdef R_API
/* asm.c */
R_API RAsm *r_asm_new();
R_API const char *r_asm_fastcall(RAsm *a, int idx, int num);
R_API void r_asm_free(RAsm *a);
R_API int r_asm_modify(RAsm *a, ut8 *buf, int field, ut64 val);

View File

@ -182,7 +182,7 @@ R_API int r_debug_continue_syscall(struct r_debug_t *dbg, int sc);
//R_API int r_debug_pid_del(struct r_debug_t *dbg);
//R_API int r_debug_pid_del_thread(struct r_debug_t *dbg);
R_API int r_debug_pid_list(RDebug *dbg, int pid);
R_API RDebugPid *r_debug_pid_new(char *path, int pid, char status, ut64 pc);
R_API RDebugPid *r_debug_pid_new(const char *path, int pid, char status, ut64 pc);
R_API RDebugPid *r_debug_pid_free(RDebugPid *pid);
R_API int r_debug_use(struct r_debug_t *dbg, const char *str);

View File

@ -28,7 +28,7 @@ typedef struct r_flag_item_t {
typedef struct r_flag_t {
int space_idx;
int space_idx2;
const char *space[R_FLAG_SPACES_MAX];
const char *spaces[R_FLAG_SPACES_MAX];
#if USE_BTREE
struct btree_node *tree; /* index by offset */
struct btree_node *ntree; /* index by name */
@ -52,7 +52,7 @@ R_API void r_flag_item_rename(RFlagItem *item, const char *name);
/* spaces */
R_API const char *r_flag_space_get(RFlag *f, int idx);
R_API RFlagItem *r_flag_get_i(RFlag *f, ut64 off);
//R_API RFlagItem *r_flag_space_get_i(RFlag *f, ut64 off);
R_API void r_flag_space_set(RFlag *f, const char *name);
R_API void r_flag_space_list(RFlag *f);
#endif

View File

@ -269,7 +269,7 @@ R_API RIODesc *r_io_desc_get(RIO *io, int fd);
R_API void r_io_desc_add(RIO *io, RIODesc *desc); //int fd, const char *file, int flags, struct r_io_plugin_t *plugin);
R_API int r_io_desc_del(RIO *io, int fd);
R_API struct r_io_desc_t *r_io_desc_get(RIO *io, int fd);
R_API int r_io_desc_generate(RIO *io);
//R_API int r_io_desc_generate(RIO *io);
/* plugins */
extern struct r_io_plugin_t r_io_plugin_procpid;

View File

@ -37,14 +37,6 @@ public class RAsm {
SRCREG2
}
/*
[Compact]
[CCode (cname="RAsmFastcall", destroy_function="", free_function="")]
public struct Fastcall {
string arg[16];
}
*/
[Compact]
[CCode (cname="RAsmPlugin", destroy_function="", free_function="")]
public class Plugin {
@ -101,7 +93,6 @@ public class RAsm {
public Code? mdisassemble(uint8 *buf, uint64 length);
public Code? mdisassemble_hexstr(string hexstr);
public Code? massemble(string buf);
public unowned string fastcall(int idx, int num);
/* TODO: not directy defined here */
public void free();

View File

@ -3,10 +3,12 @@
[CCode (cheader_filename="r_cons.h", cprefix="r_cons", lower_case_cprefix="r_cons_")]
namespace Radare {
[Compact]
[CCode (cname="struct r_cons_t", free_function="r_cons_free", cprefix="r_cons_")]
[CCode (cname="struct r_cons_t", free_function="", cprefix="r_cons_")]
/* XXX: LEAK */
public class RCons {
public RCons ();
static void free();
[CCode (cname="Color_RED")]
public static const string RED;
[CCode (cname="Color_BLACK")]

View File

@ -2,7 +2,7 @@
namespace Radare {
[Compact]
[CCode (cheader_filename="r_anal.h,r_core.h,r_bin.h,r_parse.h,r_lang.h,r_sign.h,r_reg.h,r_list.h,r_types_base.h", cname="RCore", free_function="r_core_free", cprefix="r_core_")]
[CCode (cheader_filename="r_flags.h,r_anal.h,r_core.h,r_bin.h,r_parse.h,r_lang.h,r_sign.h,r_reg.h,r_list.h,r_types_base.h", cname="RCore", free_function="r_core_free", cprefix="r_core_")]
public class RCore {
public RFlag flags;
public RNum num;
@ -51,7 +51,7 @@ public class RCore {
public int anal_search (uint64 from, uint64 to, uint64 ref);
public void anal_refs(uint64 addr, int gv);
public int anal_bb(uint64 at, int depth, int head);
public int anal_bb(RList<RAnal.Block> bbs, 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 reftype, int depth);
@ -66,8 +66,6 @@ public class RCore {
public int gdiff(RCore *c2);
public void sysenv_update ();
public void rtr_help();
public void rtr_pushout(string input);
public void rtr_list();
@ -90,7 +88,7 @@ public class RCore {
public int visual(string input);
public int visual_cmd(int ch);
public int serve(int fd);
public int serve(RIO.Desc fd);
/* asm */
//public static RCore.AsmHit asm_hit_new();

View File

@ -63,7 +63,7 @@ public class Radare.RDebug {
//public bool reg_set(string name, uint64 num);
//public uint64 reg_get(string name);
public RList<RDebug.Pid> pids (int pid);
//public RList<RDebug.Pid> pids (int pid);
// must deprecate //
public int pid_list (int pid);
public int thread_list (int pid);
@ -85,7 +85,7 @@ public class Radare.RDebug {
// list for childs
// list for threads
//public struct Process *parent;
public Pid ();
public Pid (string path, int pid, char status, uint64 pc);
}
// XXX cname=int must be deprecated by valaswig

View File

@ -32,7 +32,7 @@ namespace Radare {
public void space_list();
public unowned string? space_get(int idx);
public int space_get_i(string fsname);
//public int space_get_i(string fsname);
public void space_set(string name);
}
}

View File

@ -39,10 +39,10 @@ namespace Radare {
* flags: See Radare.Io.Flags
* mode: ...
*/
public int open(string uri, int flags, int mode);
public int open_as(string urihandler, string path, int flags, int mode);
public RIO.Desc open(string uri, int flags, int mode);
public RIO.Desc open_as(string urihandler, string path, int flags, int mode);
public int redirect(string uri);
public int set_fd(int fd);
public int set_fd(RIO.Desc fd);
public int read(out uint8 *buf, int len);
public int read_at(uint64 addr, uint8 *buf, int len);
public RBuffer *read_buf(uint64 addr, int len);
@ -50,8 +50,8 @@ namespace Radare {
public int write_at(uint64 addr, uint8 *buf, int len);
public uint64 seek(uint64 addr, int whence);
public int system(string cmd);
public int close(int fd);
public uint64 size(int fd);
public int close(RIO.Desc fd);
public uint64 size();
public void cache_commit ();
@ -143,9 +143,9 @@ namespace Radare {
public string name;
}
// int perms -> RIOPerm ?
public bool desc_add(int fd, string file, int perms, RIO.Plugin plugin);
public void desc_add(RIO.Desc *desc);
public bool desc_del(int fd);
//public RIO.Desc desc_get (int fd);
public int desc_generate();
//public int desc_generate();
}
}