2014-03-27 15:34:17 +00:00
|
|
|
#ifndef R2_REG_H
|
|
|
|
#define R2_REG_H
|
2009-02-05 21:08:46 +00:00
|
|
|
|
|
|
|
#include <r_types.h>
|
2009-09-19 22:28:06 +00:00
|
|
|
#include <r_util.h>
|
2014-01-07 03:29:56 +00:00
|
|
|
|
2015-12-08 23:41:44 +00:00
|
|
|
R_LIB_VERSION_HEADER (r_reg);
|
2009-02-05 21:08:46 +00:00
|
|
|
|
Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).
* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection
Handle EXIT_PID events differently than DEAD process events
* Move breakpoint/recoil handling to wait/cont/step
Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture. This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.
* Track how the caller wishes to continue
It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.
* Proper handling for swstep=true
Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.
For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.
To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.
Now breakpoints should work regardless of the swtep setting.
* Always call the recoil before continuing
Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.
* Hide software step breakpoint events from the user
When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.
* Improve process exit handling on Linux
There are three types of process exiting events on Linux:
1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/
On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.
* Check more bits within waitpid status
We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.
If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 08:34:45 +00:00
|
|
|
/*
|
|
|
|
* various CPUs have registers within various types/classes
|
|
|
|
* this enum aims to cover them all.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2009-09-18 18:11:42 +00:00
|
|
|
R_REG_TYPE_GPR,
|
|
|
|
R_REG_TYPE_DRX,
|
|
|
|
R_REG_TYPE_FPU,
|
|
|
|
R_REG_TYPE_MMX,
|
|
|
|
R_REG_TYPE_XMM,
|
2009-09-19 21:41:25 +00:00
|
|
|
R_REG_TYPE_FLG,
|
2009-09-21 13:39:10 +00:00
|
|
|
R_REG_TYPE_SEG,
|
2009-09-18 18:11:42 +00:00
|
|
|
R_REG_TYPE_LAST,
|
2015-08-23 02:43:31 +00:00
|
|
|
R_REG_TYPE_ALL = -1, // TODO; rename to ANY
|
Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).
* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection
Handle EXIT_PID events differently than DEAD process events
* Move breakpoint/recoil handling to wait/cont/step
Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture. This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.
* Track how the caller wishes to continue
It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.
* Proper handling for swstep=true
Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.
For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.
To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.
Now breakpoints should work regardless of the swtep setting.
* Always call the recoil before continuing
Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.
* Hide software step breakpoint events from the user
When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.
* Improve process exit handling on Linux
There are three types of process exiting events on Linux:
1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/
On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.
* Check more bits within waitpid status
We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.
If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 08:34:45 +00:00
|
|
|
} RRegisterType;
|
2009-02-05 21:08:46 +00:00
|
|
|
|
Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).
* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection
Handle EXIT_PID events differently than DEAD process events
* Move breakpoint/recoil handling to wait/cont/step
Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture. This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.
* Track how the caller wishes to continue
It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.
* Proper handling for swstep=true
Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.
For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.
To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.
Now breakpoints should work regardless of the swtep setting.
* Always call the recoil before continuing
Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.
* Hide software step breakpoint events from the user
When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.
* Improve process exit handling on Linux
There are three types of process exiting events on Linux:
1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/
On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.
* Check more bits within waitpid status
We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.
If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 08:34:45 +00:00
|
|
|
/*
|
|
|
|
* pretty much all CPUs share some common registers
|
|
|
|
* this enum aims to create an abstraction to ease cross-arch handling.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2010-02-22 03:02:13 +00:00
|
|
|
R_REG_NAME_PC, // program counter
|
|
|
|
R_REG_NAME_SP, // stack pointer
|
|
|
|
R_REG_NAME_SR, // status register
|
|
|
|
R_REG_NAME_BP, // base pointer
|
2015-12-31 13:10:11 +00:00
|
|
|
R_REG_NAME_LR, // link register
|
2014-01-08 22:23:06 +00:00
|
|
|
/* args */
|
2010-02-22 03:02:13 +00:00
|
|
|
R_REG_NAME_A0, // arguments
|
2010-02-03 13:34:00 +00:00
|
|
|
R_REG_NAME_A1,
|
|
|
|
R_REG_NAME_A2,
|
|
|
|
R_REG_NAME_A3,
|
2015-04-18 08:35:57 +00:00
|
|
|
R_REG_NAME_A4,
|
|
|
|
R_REG_NAME_A5,
|
|
|
|
R_REG_NAME_A6,
|
2016-11-15 15:20:10 +00:00
|
|
|
R_REG_NAME_A7,
|
|
|
|
R_REG_NAME_A8,
|
|
|
|
R_REG_NAME_A9,
|
2015-10-13 21:01:30 +00:00
|
|
|
/* retval */
|
|
|
|
R_REG_NAME_R0, // arguments
|
|
|
|
R_REG_NAME_R1,
|
|
|
|
R_REG_NAME_R2,
|
|
|
|
R_REG_NAME_R3,
|
2014-01-08 22:23:06 +00:00
|
|
|
/* flags */
|
|
|
|
R_REG_NAME_ZF,
|
|
|
|
R_REG_NAME_SF,
|
|
|
|
R_REG_NAME_CF,
|
|
|
|
R_REG_NAME_OF,
|
2014-06-14 00:01:03 +00:00
|
|
|
/* syscall number (orig_eax,rax,r0,x0) */
|
|
|
|
R_REG_NAME_SN,
|
2010-02-03 13:34:00 +00:00
|
|
|
R_REG_NAME_LAST,
|
Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).
* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection
Handle EXIT_PID events differently than DEAD process events
* Move breakpoint/recoil handling to wait/cont/step
Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture. This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.
* Track how the caller wishes to continue
It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.
* Proper handling for swstep=true
Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.
For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.
To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.
Now breakpoints should work regardless of the swtep setting.
* Always call the recoil before continuing
Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.
* Hide software step breakpoint events from the user
When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.
* Improve process exit handling on Linux
There are three types of process exiting events on Linux:
1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/
On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.
* Check more bits within waitpid status
We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.
If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 08:34:45 +00:00
|
|
|
} RRegisterId;
|
2010-02-03 13:34:00 +00:00
|
|
|
|
2014-01-07 03:29:56 +00:00
|
|
|
// TODO: use enum here?
|
|
|
|
#define R_REG_COND_EQ 0
|
|
|
|
#define R_REG_COND_NE 1
|
|
|
|
#define R_REG_COND_CF 2
|
|
|
|
#define R_REG_COND_CARRY 2
|
|
|
|
#define R_REG_COND_NEG 3
|
|
|
|
#define R_REG_COND_NEGATIVE 3
|
|
|
|
#define R_REG_COND_OF 4
|
|
|
|
#define R_REG_COND_OVERFLOW 4
|
|
|
|
// unsigned
|
|
|
|
#define R_REG_COND_HI 5
|
|
|
|
#define R_REG_COND_HE 6
|
|
|
|
#define R_REG_COND_LO 7
|
|
|
|
#define R_REG_COND_LOE 8
|
|
|
|
// signed
|
|
|
|
#define R_REG_COND_GE 9
|
|
|
|
#define R_REG_COND_GT 10
|
|
|
|
#define R_REG_COND_LT 11
|
|
|
|
#define R_REG_COND_LE 12
|
2014-01-08 22:23:06 +00:00
|
|
|
#define R_REG_COND_LAST 13
|
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
typedef struct r_reg_item_t {
|
2009-09-17 09:48:36 +00:00
|
|
|
char *name;
|
2016-06-22 17:43:19 +00:00
|
|
|
int /*RRegisterType*/ type;
|
2017-02-10 01:05:58 +00:00
|
|
|
int size; /* 8,16,32,64 ... 128/256 ??? */
|
|
|
|
int offset; /* offset in data structure */
|
2009-09-18 18:11:42 +00:00
|
|
|
int packed_size; /* 0 means no packed register, 1byte pack, 2b pack... */
|
2015-09-21 21:40:17 +00:00
|
|
|
bool is_float;
|
2010-09-24 02:09:39 +00:00
|
|
|
char *flags;
|
2016-05-31 11:33:09 +00:00
|
|
|
int index;
|
2016-11-12 22:19:03 +00:00
|
|
|
int arena; /* in which arena is this reg living */
|
2010-09-18 00:51:17 +00:00
|
|
|
} RRegItem;
|
2009-09-13 22:37:28 +00:00
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
typedef struct r_reg_arena_t {
|
2009-09-18 18:11:42 +00:00
|
|
|
ut8 *bytes;
|
|
|
|
int size;
|
2010-09-18 00:51:17 +00:00
|
|
|
} RRegArena;
|
2009-09-13 22:37:28 +00:00
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
typedef struct r_reg_set_t {
|
2010-09-18 00:51:17 +00:00
|
|
|
RRegArena *arena;
|
2017-02-10 01:05:58 +00:00
|
|
|
RList *pool; /* RRegArena */
|
|
|
|
RList *regs; /* RRegItem */
|
2017-03-25 15:00:25 +00:00
|
|
|
RListIter *cur;
|
2016-11-14 22:58:29 +00:00
|
|
|
int maskregstype; /* which type of regs have this reg set (logic mask with RRegisterType R_REG_TYPE_XXX) */
|
2010-09-18 00:51:17 +00:00
|
|
|
} RRegSet;
|
2009-09-13 22:37:28 +00:00
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
typedef struct r_reg_t {
|
2009-09-18 18:11:42 +00:00
|
|
|
char *profile;
|
2016-01-09 02:14:18 +00:00
|
|
|
char *reg_profile_cmt;
|
2011-04-02 16:55:47 +00:00
|
|
|
char *reg_profile_str;
|
2016-11-15 15:20:10 +00:00
|
|
|
char *name[R_REG_NAME_LAST]; // aliases
|
2010-09-18 00:51:17 +00:00
|
|
|
RRegSet regset[R_REG_TYPE_LAST];
|
2016-05-31 12:11:09 +00:00
|
|
|
RList *allregs;
|
2010-09-23 18:42:35 +00:00
|
|
|
int iters;
|
2015-09-21 21:40:17 +00:00
|
|
|
int arch;
|
2014-06-19 02:03:11 +00:00
|
|
|
int bits;
|
2014-09-06 01:59:28 +00:00
|
|
|
int size;
|
2015-09-21 21:40:17 +00:00
|
|
|
bool is_thumb;
|
|
|
|
bool big_endian;
|
2010-09-18 00:51:17 +00:00
|
|
|
} RReg;
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2014-01-07 03:29:56 +00:00
|
|
|
typedef struct r_reg_flags_t {
|
2015-09-21 21:40:17 +00:00
|
|
|
bool s; // sign, negative number (msb)
|
|
|
|
bool z; // zero
|
|
|
|
bool a; // half-carry adjust (if carry happens at nibble level)
|
|
|
|
bool c; // carry
|
|
|
|
bool o; // overflow
|
|
|
|
bool p; // parity (lsb)
|
2014-01-07 03:29:56 +00:00
|
|
|
} RRegFlags;
|
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
#ifdef R_API
|
2012-03-07 17:18:22 +00:00
|
|
|
R_API void r_reg_free(RReg *reg);
|
2016-04-03 23:59:30 +00:00
|
|
|
R_API void r_reg_free_internal(RReg *reg, bool init);
|
2015-01-13 02:40:01 +00:00
|
|
|
R_API RReg *r_reg_new(void);
|
2013-06-20 00:49:39 +00:00
|
|
|
R_API int r_reg_set_name(RReg *reg, int role, const char *name);
|
2014-09-13 00:23:03 +00:00
|
|
|
R_API int r_reg_set_profile_string(RReg *reg, const char *profile);
|
2012-03-07 09:43:02 +00:00
|
|
|
R_API int r_reg_set_profile(RReg *reg, const char *profile);
|
2017-07-09 16:18:27 +00:00
|
|
|
R_API int r_reg_parse_gdb_profile(const char *profile);
|
2010-02-03 17:15:31 +00:00
|
|
|
|
2014-10-15 00:24:22 +00:00
|
|
|
R_API RRegSet *r_reg_regset_get(RReg *r, int type);
|
2013-06-20 00:49:39 +00:00
|
|
|
R_API ut64 r_reg_getv(RReg *reg, const char *name);
|
2014-01-28 03:03:35 +00:00
|
|
|
R_API ut64 r_reg_setv(RReg *reg, const char *name, ut64 val);
|
2017-02-10 01:05:58 +00:00
|
|
|
R_API const char *r_reg_32_to_64(RReg *reg, const char *rreg32);
|
2013-06-20 00:49:39 +00:00
|
|
|
R_API const char *r_reg_get_type(int idx);
|
2012-03-07 09:43:02 +00:00
|
|
|
R_API const char *r_reg_get_name(RReg *reg, int kind);
|
2015-10-31 00:57:52 +00:00
|
|
|
R_API const char *r_reg_get_role(int role);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API RRegItem *r_reg_get(RReg *reg, const char *name, int type);
|
2012-03-07 09:43:02 +00:00
|
|
|
R_API RList *r_reg_get_list(RReg *reg, int type);
|
2015-12-08 23:41:44 +00:00
|
|
|
R_API RRegItem *r_reg_get_at(RReg *reg, int type, int regsize, int delta);
|
|
|
|
R_API RRegItem *r_reg_next_diff(RReg *reg, int type, const ut8 *buf, int buflen, RRegItem *prev_ri, int regsize);
|
2010-10-27 22:55:07 +00:00
|
|
|
|
2016-05-31 12:11:09 +00:00
|
|
|
R_API void r_reg_reindex(RReg *reg);
|
|
|
|
R_API RRegItem *r_reg_index_get(RReg *reg, int idx);
|
|
|
|
|
2015-08-23 01:58:49 +00:00
|
|
|
/* Item */
|
|
|
|
R_API void r_reg_item_free(RRegItem *item);
|
|
|
|
|
2010-10-27 22:55:07 +00:00
|
|
|
/* XXX: dupped ?? */
|
2009-09-25 02:04:51 +00:00
|
|
|
R_API int r_reg_type_by_name(const char *str);
|
2010-10-27 22:55:07 +00:00
|
|
|
R_API int r_reg_get_name_idx(const char *type);
|
2009-09-19 19:54:22 +00:00
|
|
|
|
2015-12-08 23:41:44 +00:00
|
|
|
R_API RRegItem *r_reg_cond_get(RReg *reg, const char *name);
|
|
|
|
R_API int r_reg_cond_get_value(RReg *r, const char *name);
|
|
|
|
R_API int r_reg_cond_bits(RReg *r, int type, RRegFlags *f);
|
|
|
|
R_API RRegFlags *r_reg_cond_retrieve(RReg *r, RRegFlags *);
|
|
|
|
R_API int r_reg_cond(RReg *r, int type);
|
2014-01-07 03:29:56 +00:00
|
|
|
|
2015-09-21 21:40:17 +00:00
|
|
|
/* integer value 8-64 bits */
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API ut64 r_reg_get_value(RReg *reg, RRegItem *item);
|
2016-11-14 22:58:29 +00:00
|
|
|
R_API ut64 r_reg_get_value_big(RReg *reg, RRegItem *item, utX *val);
|
2017-08-26 23:10:19 +00:00
|
|
|
R_API ut64 r_reg_get_value_by_role(RReg *reg, RRegisterId role);
|
|
|
|
R_API bool r_reg_set_value(RReg *reg, RRegItem *item, ut64 value);
|
|
|
|
R_API bool r_reg_set_value_by_role(RReg *reg, RRegisterId role, ut64 value);
|
2015-09-21 21:40:17 +00:00
|
|
|
|
|
|
|
/* float */
|
2015-08-23 01:58:49 +00:00
|
|
|
R_API float r_reg_get_float(RReg *reg, RRegItem *item);
|
2015-09-21 21:40:17 +00:00
|
|
|
R_API bool r_reg_set_float(RReg *reg, RRegItem *item, float value);
|
|
|
|
|
|
|
|
/* double */
|
|
|
|
R_API double r_reg_get_double(RReg *reg, RRegItem *item);
|
|
|
|
R_API bool r_reg_set_double(RReg *reg, RRegItem *item, double value);
|
|
|
|
|
|
|
|
/* long double */
|
|
|
|
R_API long double r_reg_get_longdouble(RReg *reg, RRegItem *item);
|
|
|
|
R_API bool r_reg_set_longdouble(RReg *reg, RRegItem *item, long double value);
|
|
|
|
|
|
|
|
/* boolean */
|
2010-09-24 02:09:39 +00:00
|
|
|
R_API char *r_reg_get_bvalue(RReg *reg, RRegItem *item);
|
2014-11-18 16:21:42 +00:00
|
|
|
R_API ut64 r_reg_set_bvalue(RReg *reg, RRegItem *item, const char *str);
|
2015-09-21 21:40:17 +00:00
|
|
|
|
|
|
|
/* packed registers */
|
2015-08-23 01:58:49 +00:00
|
|
|
R_API int r_reg_set_pack(RReg *reg, RRegItem *item, int packidx, int packbits, ut64 val);
|
|
|
|
R_API ut64 r_reg_get_pack(RReg *reg, RRegItem *item, int packidx, int packbits);
|
2009-09-19 19:54:22 +00:00
|
|
|
|
|
|
|
/* byte arena */
|
2015-12-08 23:41:44 +00:00
|
|
|
R_API ut8 *r_reg_get_bytes(RReg *reg, int type, int *size);
|
|
|
|
R_API bool r_reg_set_bytes(RReg *reg, int type, const ut8 *buf, const int len);
|
2016-03-22 06:32:40 +00:00
|
|
|
R_API bool r_reg_read_regs(RReg *reg, ut8 *buf, const int len);
|
2017-02-10 01:05:58 +00:00
|
|
|
R_API int r_reg_arena_set_bytes(RReg *reg, const char *str);
|
2015-12-08 23:41:44 +00:00
|
|
|
R_API RRegArena *r_reg_arena_new(int size);
|
|
|
|
R_API void r_reg_arena_free(RRegArena *ra);
|
2012-03-07 09:43:02 +00:00
|
|
|
R_API int r_reg_fit_arena(RReg *reg);
|
2010-09-23 18:42:35 +00:00
|
|
|
R_API void r_reg_arena_swap(RReg *reg, int copy);
|
|
|
|
R_API int r_reg_arena_push(RReg *reg);
|
|
|
|
R_API void r_reg_arena_pop(RReg *reg);
|
2014-06-19 02:52:28 +00:00
|
|
|
R_API void r_reg_arena_zero(RReg *reg);
|
2015-09-09 23:42:56 +00:00
|
|
|
|
|
|
|
R_API ut8 *r_reg_arena_peek(RReg *reg);
|
|
|
|
R_API void r_reg_arena_poke(RReg *reg, const ut8 *buf);
|
2016-10-24 12:31:03 +00:00
|
|
|
R_API ut8 *r_reg_arena_dup(RReg *reg, const ut8 *source);
|
2015-12-08 23:41:44 +00:00
|
|
|
R_API const char *r_reg_cond_to_string(int n);
|
2014-01-08 22:23:06 +00:00
|
|
|
R_API int r_reg_cond_from_string(const char *str);
|
2016-11-23 23:29:34 +00:00
|
|
|
R_API void r_reg_arena_shrink(RReg *reg);
|
2009-12-24 02:17:53 +00:00
|
|
|
#endif
|
2009-09-19 19:54:22 +00:00
|
|
|
|
2009-02-05 21:08:46 +00:00
|
|
|
#endif
|