pancake 54bdfb22bd * Uppsercase classnames (rCore -> RCore)
- Fixes ruby warnings
  - Follow java syntax conventions
  - Helped to identify and fix bugs in many vapis
  - Sync swig examples
  - Add test-r_core.rb (ruby test for RCore)
* Some work in r_cons, some refactoring and cleanup
  - scr.html is now working again
  - w32 cons support should work now
  - Rename r_cons_get_columns -> r_cons_get_size()
  - But it needs more work
* Typedef all r_range, r_parse and r_anal structs
  - Add missing r_lib.pc in configure.acr
* 'make' clean now removes the libr* in swig/${LANG}/
2010-01-26 01:28:33 +01:00

110 lines
2.9 KiB
C

#ifndef _INCLUDE_LIBR_BP_H_
#define _INCLUDE_LIBR_BP_H_
#include <r_types.h>
#include <r_io.h>
#include "list.h"
#define R_BP_MAXPIDS 10
#define R_BP_CONT_NORMAL 0
#define R_BP_CONT_NORMAL 0
typedef struct r_bp_arch_t {
int length;
int endian;
const ut8 *bytes;
} RBreakpointArch;
enum {
R_BP_TYPE_SW,
R_BP_TYPE_HW,
R_BP_TYPE_COND,
R_BP_TYPE_FAULT,
R_BP_TYPE_DELETE,
};
typedef struct r_bp_handle_t {
char *name;
char *arch;
int type; // R_BP_TYPE_SW
int nbps;
struct r_bp_arch_t *bps;
struct list_head list;
} RBreakpointHandler;
typedef struct r_bp_item_t {
ut64 addr;
int size; /* size of breakpoint area */
int recoil; /* recoil */
int rwx;
int hw;
int trace;
int enabled;
int hits;
ut8 *obytes; /* original bytes */
ut8 *bbytes; /* breakpoint bytes */
int pids[R_BP_MAXPIDS];
struct list_head list;
} RBreakpointItem;
typedef int (*RBreakpointCallback)(void *user, int type, ut64 addr, int hw, int rwx);
typedef struct r_bp_t {
int trace_all;
ut64 trace_bp;
int nbps;
int stepcont;
RBreakpointCallback breakpoint;
struct r_io_bind_t iob; // compile time dependency
struct r_bp_handle_t *cur;
struct list_head plugins;
struct list_head bps;
} RBreakpoint;
enum {
R_BP_PROT_READ = 1,
R_BP_PROT_WRITE = 2,
R_BP_PROT_EXEC = 4,
};
#ifdef R_API
R_API struct r_bp_t *r_bp_init(struct r_bp_t *bp);
R_API struct r_bp_t *r_bp_new();
R_API struct r_bp_t *r_bp_free(struct r_bp_t *bp);
R_API int r_bp_del(struct r_bp_t *bp, ut64 addr);
R_API int r_bp_handle_add(struct r_bp_t *bp, struct r_bp_handle_t *foo);
R_API int r_bp_use(struct r_bp_t *bp, const char *name);
R_API int r_bp_handle_del(struct r_bp_t *bp, const char *name);
R_API void r_bp_handle_list(struct r_bp_t *bp);
R_API int r_bp_in(struct r_bp_t *bp, ut64 addr, int rwx);
R_API int r_bp_list(struct r_bp_t *bp, int rad);
R_API int r_bp_get_bytes(struct r_bp_t *bp, ut8 *buf, int len, int endian, int idx);
R_API int r_bp_set_trace(struct r_bp_t *bp, ut64 addr, int set);
//R_API int r_bp_set_trace_bp(struct r_bp_t *bp, ut64 addr, int set);
R_API struct r_bp_item_t *r_bp_enable(struct r_bp_t *bp, ut64 addr, int set);
R_API int r_bp_add_cond(struct r_bp_t *bp, const char *cond);
R_API int r_bp_del_cond(struct r_bp_t *bp, int idx);
R_API int r_bp_add_fault(struct r_bp_t *bp, ut64 addr, int size, int rwx);
R_API struct r_bp_item_t *r_bp_add_sw(struct r_bp_t *bp, ut64 addr, int size, int rwx);
R_API struct r_bp_item_t *r_bp_add_hw(struct r_bp_t *bp, ut64 addr, int size, int rwx);
R_API RBreakpointItem *r_bp_at_addr(RBreakpoint *bp, ut64 addr, int rwx);
R_API int r_bp_restore(struct r_bp_t *bp, int set);
R_API int r_bp_recoil(struct r_bp_t *bp, ut64 addr);
#endif
/* plugin pointers */
extern struct r_bp_handle_t r_bp_plugin_x86;
extern struct r_bp_handle_t r_bp_plugin_arm;
#if 0
extern struct r_bp_handle_t r_bp_plugin_powerpc;
extern struct r_bp_handle_t r_bp_plugin_mips;
extern struct r_bp_handle_t r_bp_plugin_sparc;
#endif
#endif