本文整理汇总了C++中regcache_cooked_write_unsigned函数的典型用法代码示例。如果您正苦于以下问题:C++ regcache_cooked_write_unsigned函数的具体用法?C++ regcache_cooked_write_unsigned怎么用?C++ regcache_cooked_write_unsigned使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了regcache_cooked_write_unsigned函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sparc32_push_dummy_call
static CORE_ADDR
sparc32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
CORE_ADDR call_pc = (struct_return ? (bp_addr - 12) : (bp_addr - 8));
/* Set return address. */
regcache_cooked_write_unsigned (regcache, SPARC_O7_REGNUM, call_pc);
/* Set up function arguments. */
sp = sparc32_store_arguments (regcache, nargs, args, sp,
struct_return, struct_addr);
/* Allocate the 16-word window save area. */
sp -= 16 * 4;
/* Stack should be doubleword aligned at this point. */
gdb_assert (sp % 8 == 0);
/* Finally, update the stack pointer. */
regcache_cooked_write_unsigned (regcache, SPARC_SP_REGNUM, sp);
return sp;
}
示例2: mips_linux_write_pc
static void
mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc);
/* Clear the syscall restart flag. */
if (mips_linux_restart_reg_p (gdbarch))
regcache_cooked_write_unsigned (regcache, MIPS_RESTART_REGNUM, 0);
}
示例3: moxie_store_return_value
static void
moxie_store_return_value (struct type *type, struct regcache *regcache,
const void *valbuf)
{
CORE_ADDR regval;
int len = TYPE_LENGTH (type);
/* Things always get returned in RET1_REGNUM, RET2_REGNUM. */
regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len);
regcache_cooked_write_unsigned (regcache, RET1_REGNUM, regval);
if (len > 4)
{
regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4, len - 4);
regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
}
}
示例4: ppc_linux_write_pc
static void
ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc);
/* Set special TRAP register to -1 to prevent the kernel from
messing with the PC we just installed, if we happen to be
within an interrupted system call that the kernel wants to
restart.
Note that after we return from the dummy call, the TRAP and
ORIG_R3 registers will be automatically restored, and the
kernel continues to restart the system call at this point. */
if (ppc_linux_trap_reg_p (gdbarch))
regcache_cooked_write_unsigned (regcache, PPC_TRAP_REGNUM, -1);
}
示例5: ft32_store_return_value
static void
ft32_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR regval;
int len = TYPE_LENGTH (type);
/* Things always get returned in RET1_REGNUM, RET2_REGNUM. */
regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order);
regcache_cooked_write_unsigned (regcache, FT32_R0_REGNUM, regval);
if (len > 4)
{
regval = extract_unsigned_integer (valbuf + 4,
len - 4, byte_order);
regcache_cooked_write_unsigned (regcache, FT32_R1_REGNUM, regval);
}
}
示例6: sparc64_linux_write_pc
static void
sparc64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
ULONGEST state;
regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc);
regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4);
/* Clear the "in syscall" bit to prevent the kernel from
messing with the PCs we just installed, if we happen to be
within an interrupted system call that the kernel wants to
restart.
Note that after we return from the dummy call, the TSTATE et al.
registers will be automatically restored, and the kernel
continues to restart the system call at this point. */
regcache_cooked_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state);
state &= ~TSTATE_SYSCALL;
regcache_cooked_write_unsigned (regcache, SPARC64_STATE_REGNUM, state);
}
示例7: i386_linux_write_pc
static void
i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
regcache_cooked_write_unsigned (regcache, I386_EIP_REGNUM, pc);
/* We must be careful with modifying the program counter. If we
just interrupted a system call, the kernel might try to restart
it when we resume the inferior. On restarting the system call,
the kernel will try backing up the program counter even though it
no longer points at the system call. This typically results in a
SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
"orig_eax" pseudo-register.
Note that "orig_eax" is saved when setting up a dummy call frame.
This means that it is properly restored when that frame is
popped, and that the interrupted system call will be restarted
when we resume the inferior on return from a function call from
within GDB. In all other cases the system call will not be
restarted. */
regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
}
示例8: tilegx_write_pc
static void
tilegx_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
regcache_cooked_write_unsigned (regcache, TILEGX_PC_REGNUM, pc);
/* We must be careful with modifying the program counter. If we
just interrupted a system call, the kernel might try to restart
it when we resume the inferior. On restarting the system call,
the kernel will try backing up the program counter even though it
no longer points at the system call. This typically results in a
SIGSEGV or SIGILL. We can prevent this by writing INT_SWINT_1_SIGRETURN
in the "faultnum" pseudo-register.
Note that "faultnum" is saved when setting up a dummy call frame.
This means that it is properly restored when that frame is
popped, and that the interrupted system call will be restarted
when we resume the inferior on return from a function call from
within GDB. In all other cases the system call will not be
restarted. */
regcache_cooked_write_unsigned (regcache, TILEGX_FAULTNUM_REGNUM,
INT_SWINT_1_SIGRETURN);
}
示例9: lm32_store_return_value
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. */
static void
lm32_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
ULONGEST val;
int len = TYPE_LENGTH (type);
if (len <= 4)
{
val = extract_unsigned_integer (valbuf, len);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
}
else if (len <= 8)
{
val = extract_unsigned_integer (valbuf, 4);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
val = extract_unsigned_integer (valbuf + 4, len - 4);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val);
}
else
error (_("lm32_store_return_value: type length too large."));
}
示例10: enable_watchpoints_in_psr
static void
enable_watchpoints_in_psr (ptid_t ptid)
{
struct regcache *regcache = get_thread_regcache (ptid);
ULONGEST psr;
regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
if (!(psr & IA64_PSR_DB))
{
psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware
watchpoints and breakpoints. */
regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
}
}
示例11: m88k_write_pc
static void
m88k_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
/* According to the MC88100 RISC Microprocessor User's Manual,
section 6.4.3.1.2:
"... can be made to return to a particular instruction by placing
a valid instruction address in the SNIP and the next sequential
instruction address in the SFIP (with V bits set and E bits
clear). The rte resumes execution at the instruction pointed to
by the SNIP, then the SFIP."
The E bit is the least significant bit (bit 0). The V (valid)
bit is bit 1. This is why we logical or 2 into the values we are
writing below. It turns out that SXIP plays no role when
returning from an exception so nothing special has to be done
with it. We could even (presumably) give it a totally bogus
value. */
regcache_cooked_write_unsigned (regcache, M88K_SXIP_REGNUM, pc);
regcache_cooked_write_unsigned (regcache, M88K_SNIP_REGNUM, pc | 2);
regcache_cooked_write_unsigned (regcache, M88K_SFIP_REGNUM, (pc + 4) | 2);
}
示例12: vax_push_dummy_call
static CORE_ADDR
vax_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
struct value **args, CORE_ADDR sp,
function_call_return_method return_method,
CORE_ADDR struct_addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR fp = sp;
gdb_byte buf[4];
/* Set up the function arguments. */
sp = vax_store_arguments (regcache, nargs, args, sp);
/* Store return value address. */
if (return_method == return_method_struct)
regcache_cooked_write_unsigned (regcache, VAX_R1_REGNUM, struct_addr);
/* Store return address in the PC slot. */
sp -= 4;
store_unsigned_integer (buf, 4, byte_order, bp_addr);
write_memory (sp, buf, 4);
/* Store the (fake) frame pointer in the FP slot. */
sp -= 4;
store_unsigned_integer (buf, 4, byte_order, fp);
write_memory (sp, buf, 4);
/* Skip the AP slot. */
sp -= 4;
/* Store register save mask and control bits. */
sp -= 4;
store_unsigned_integer (buf, 4, byte_order, 0);
write_memory (sp, buf, 4);
/* Store condition handler. */
sp -= 4;
store_unsigned_integer (buf, 4, byte_order, 0);
write_memory (sp, buf, 4);
/* Update the stack pointer and frame pointer. */
store_unsigned_integer (buf, 4, byte_order, sp);
regcache->cooked_write (VAX_SP_REGNUM, buf);
regcache->cooked_write (VAX_FP_REGNUM, buf);
/* Return the saved (fake) frame pointer. */
return fp;
}
示例13: lm32_store_return_value
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. */
static void
lm32_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
int len = TYPE_LENGTH (type);
if (len <= 4)
{
val = extract_unsigned_integer (valbuf, len, byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
}
else if (len <= 8)
{
val = extract_unsigned_integer (valbuf, 4, byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
val = extract_unsigned_integer (valbuf + 4, len - 4, byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val);
}
else
error (_("lm32_store_return_value: type length too large."));
}
示例14: i386fbsd_resume
static void
i386fbsd_resume (struct target_ops *ops,
ptid_t ptid, int step, enum gdb_signal signal)
{
pid_t pid = ptid_get_pid (ptid);
int request = PT_STEP;
if (pid == -1)
/* Resume all threads. This only gets used in the non-threaded
case, where "resume all threads" and "resume inferior_ptid" are
the same. */
pid = ptid_get_pid (inferior_ptid);
if (!step)
{
struct regcache *regcache = get_current_regcache ();
ULONGEST eflags;
/* Workaround for a bug in FreeBSD. Make sure that the trace
flag is off when doing a continue. There is a code path
through the kernel which leaves the flag set when it should
have been cleared. If a process has a signal pending (such
as SIGALRM) and we do a PT_STEP, the process never really has
a chance to run because the kernel needs to notify the
debugger that a signal is being sent. Therefore, the process
never goes through the kernel's trap() function which would
normally clear it. */
regcache_cooked_read_unsigned (regcache, I386_EFLAGS_REGNUM,
&eflags);
if (eflags & 0x0100)
regcache_cooked_write_unsigned (regcache, I386_EFLAGS_REGNUM,
eflags & ~0x0100);
request = PT_CONTINUE;
}
/* An addres of (caddr_t) 1 tells ptrace to continue from where it
was. (If GDB wanted it to start some other way, we have already
written a new PC value to the child.) */
if (ptrace (request, pid, (caddr_t) 1,
gdb_signal_to_host (signal)) == -1)
perror_with_name (("ptrace"));
}
示例15: ia64_linux_stopped_data_address
static int
ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
{
CORE_ADDR psr;
siginfo_t siginfo;
struct regcache *regcache = get_current_regcache ();
if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
return 0;
if (siginfo.si_signo != SIGTRAP
|| (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0;
regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint
for the next instruction. */
regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
*addr_p = (CORE_ADDR) siginfo.si_addr;
return 1;
}