mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-22 09:13:06 +00:00
libdrgn: rename drgn_register_state_set_from_integer() -> from_u64()
This is for consistency with drgn_register_state_get_u64() that we're about to add. Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
parent
cbdf6094b7
commit
0a7849d791
@ -215,8 +215,8 @@ linux_kernel_get_initial_registers_ppc64(const struct drgn_object *task_obj,
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
drgn_register_state_set_from_integer(prog, *ret, r1,
|
||||
ksp + SWITCH_FRAME_SIZE);
|
||||
drgn_register_state_set_from_u64(prog, *ret, r1,
|
||||
ksp + SWITCH_FRAME_SIZE);
|
||||
|
||||
err = NULL;
|
||||
out:
|
||||
|
@ -248,8 +248,8 @@ get_registers_from_frame_pointer(struct drgn_program *prog,
|
||||
if (!regs)
|
||||
return &drgn_enomem;
|
||||
drgn_register_state_set_from_buffer(regs, rip, &frame[1]);
|
||||
drgn_register_state_set_from_integer(prog, regs, rsp,
|
||||
frame_pointer + sizeof(frame));
|
||||
drgn_register_state_set_from_u64(prog, regs, rsp,
|
||||
frame_pointer + sizeof(frame));
|
||||
drgn_register_state_set_from_buffer(regs, rbp, &frame[0]);
|
||||
drgn_register_state_set_pc_from_register(prog, regs, rip);
|
||||
*ret = regs;
|
||||
@ -396,8 +396,7 @@ get_initial_registers_inactive_task_frame(struct drgn_object *frame_obj,
|
||||
|
||||
#undef COPY_REGISTER
|
||||
|
||||
drgn_register_state_set_from_integer(prog, regs,
|
||||
rsp, address + frame_size);
|
||||
drgn_register_state_set_from_u64(prog, regs, rsp, address + frame_size);
|
||||
drgn_register_state_set_pc_from_register(prog, regs, rip);
|
||||
|
||||
*ret = regs;
|
||||
|
@ -289,11 +289,11 @@ drgn_register_state_set_range_from_buffer_impl(struct drgn_register_state *regs,
|
||||
buf)
|
||||
|
||||
static inline void
|
||||
drgn_register_state_set_from_integer_impl(struct drgn_program *prog,
|
||||
struct drgn_register_state *regs,
|
||||
drgn_register_number regno,
|
||||
size_t reg_offset, size_t reg_size,
|
||||
uint64_t value)
|
||||
drgn_register_state_set_from_u64_impl(struct drgn_program *prog,
|
||||
struct drgn_register_state *regs,
|
||||
drgn_register_number regno,
|
||||
size_t reg_offset, size_t reg_size,
|
||||
uint64_t value)
|
||||
{
|
||||
copy_lsbytes(®s->buf[reg_offset], reg_size,
|
||||
drgn_platform_is_little_endian(&prog->platform), &value,
|
||||
@ -311,12 +311,11 @@ drgn_register_state_set_from_integer_impl(struct drgn_program *prog,
|
||||
* @param[in] reg Identifier of register to set. Number must be less than @ref
|
||||
* drgn_register_state::num_regs.
|
||||
*/
|
||||
#define drgn_register_state_set_from_integer(prog, regs, reg, value) \
|
||||
drgn_register_state_set_from_integer_impl(prog, regs, \
|
||||
DRGN_REGISTER_NUMBER(reg), \
|
||||
DRGN_REGISTER_OFFSET(reg), \
|
||||
DRGN_REGISTER_SIZE(reg), \
|
||||
value)
|
||||
#define drgn_register_state_set_from_u64(prog, regs, reg, value) \
|
||||
drgn_register_state_set_from_u64_impl(prog, regs, \
|
||||
DRGN_REGISTER_NUMBER(reg), \
|
||||
DRGN_REGISTER_OFFSET(reg), \
|
||||
DRGN_REGISTER_SIZE(reg), value)
|
||||
|
||||
/** @} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user