mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-02 18:27:18 +00:00
91ad40d663
- radare2 debugger is now broken - r_reg has grown a bit more - Better separation of debugger elements * r_bp now has r_bp_add_hw and r_bp_add_sw() calls - Added minimal support for breakpoint handlers - Import th0rpe's watchpoint expression parser engine * iob moved from r_debug to r_bp * Arch types has been moved into r_asm - Soft compile time dependency * Update pkg-config .pc files
43 lines
739 B
C
43 lines
739 B
C
#include <r_reg.h>
|
|
#include <r_asm.h>
|
|
|
|
|
|
R_API struct r_reg_t *r_reg_init(struct r_reg_t *reg)
|
|
{
|
|
if (reg) {
|
|
reg->h = NULL;
|
|
INIT_LIST_HEAD(®->handles);
|
|
}
|
|
return reg;
|
|
}
|
|
|
|
R_API struct r_reg_t *r_reg_new()
|
|
{
|
|
struct r_reg_t *r = MALLOC_STRUCT(struct r_reg_t);
|
|
return r_reg_init(r);
|
|
}
|
|
|
|
R_API struct r_reg_t *r_reg_free(struct r_reg_t *reg)
|
|
{
|
|
if (reg) {
|
|
// TODO: free more things here
|
|
free(reg);
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
int r_reg_set_arch(struct r_reg_t *reg, int arch, int bits)
|
|
{
|
|
int ret = R_FALSE;
|
|
struct list_head *pos;
|
|
list_for_each(pos, ®->handles) {
|
|
struct r_reg_handle_t *h = list_entry(pos, struct r_reg_handle_t, list);
|
|
if (h->is_arch(arch, bits)) {
|
|
reg->h = h;
|
|
ret = R_TRUE;
|
|
break;
|
|
}
|
|
}
|
|
return ret;
|
|
}
|