Boolify the 'fetch' parameter of the get_thread_regcache function.
All of the current uses pass true for this parameter. Therefore, define
its default value as true and remove the argument from the uses.
We still keep the parameter, though, to give downstream targets the
option to obtain a regcache without having to fetch the whole
contents. Our (Intel) downstream target is an example.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
int
arm_is_thumb_mode (void)
{
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
+ regcache *regcache = get_thread_regcache (current_thread);
unsigned long cpsr;
collect_register_by_name (regcache, "cpsr", &cpsr);
scoped_restore_current_thread restore_thread;
switch_to_thread (lwp->thread);
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
+ regcache *regcache = get_thread_regcache (current_thread);
CORE_ADDR pc = low_get_pc (regcache);
threads_debug_printf ("pc is 0x%lx", (long) pc);
scoped_restore_current_thread restore_thread;
switch_to_thread (lwp->thread);
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
low_get_syscall_trapinfo (regcache, sysno);
threads_debug_printf ("get_syscall_trapinfo sysno %d", *sysno);
if (pc != sw_breakpoint_pc)
{
struct regcache *regcache
- = get_thread_regcache (current_thread, 1);
+ = get_thread_regcache (current_thread);
low_set_pc (regcache, sw_breakpoint_pc);
}
(PTRACE_TYPE_ARG3) 0, &info);
}
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
low_set_pc (regcache, status.tpoint_addr);
lwp->stop_pc = status.tpoint_addr;
if (increment_pc != 0)
{
struct regcache *regcache
- = get_thread_regcache (current_thread, 1);
+ = get_thread_regcache (current_thread);
event_child->stop_pc += increment_pc;
low_set_pc (regcache, event_child->stop_pc);
if (low_supports_breakpoints ())
{
struct regcache *regcache
- = get_thread_regcache (current_thread, 1);
+ = get_thread_regcache (current_thread);
low_set_pc (regcache, event_child->stop_pc);
}
if (decr_pc != 0)
{
struct regcache *regcache
- = get_thread_regcache (current_thread, 1);
+ = get_thread_regcache (current_thread);
low_set_pc (regcache, event_child->stop_pc + decr_pc);
}
}
linux_process_target::install_software_single_step_breakpoints (lwp_info *lwp)
{
thread_info *thread = lwp->thread;
- struct regcache *regcache = get_thread_regcache (thread, 1);
+ regcache *regcache = get_thread_regcache (thread);
scoped_restore_current_thread restore_thread;
if (thread->process ()->tdesc != nullptr && low_supports_breakpoints ())
{
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
+ regcache *regcache = get_thread_regcache (current_thread);
lwp->stop_pc = low_get_pc (regcache);
{
struct lwp_info *lwp = find_lwp_pid (ptid_t (lwpid));
thread_info *thr = lwp->thread;
- struct regcache *regcache = get_thread_regcache (thr, 1);
+ regcache *regcache = get_thread_regcache (thr);
ULONGEST tp = 0;
#ifdef __powerpc64__
{
thread_info *thr = lwp->thread;
- struct regcache *regcache = get_thread_regcache (thr, 1);
+ regcache *regcache = get_thread_regcache (thr);
unsigned int desc[4];
ULONGEST gs = 0;
const int reg_thread_area = 3; /* bits to scale down register value. */
if (bp->cond_list == NULL)
return 1;
- ctx.regcache = get_thread_regcache (current_thread, 1);
+ ctx.regcache = get_thread_regcache (current_thread);
ctx.tframe = NULL;
ctx.tpoint = NULL;
if (bp == NULL)
return 1;
- ctx.regcache = get_thread_regcache (current_thread, 1);
+ ctx.regcache = get_thread_regcache (current_thread);
ctx.tframe = NULL;
ctx.tpoint = NULL;
scoped_restore_current_thread restore_thread;
switch_to_thread (lwp->thread);
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
gregset_info ()->fill_function (regcache, gregset);
return PS_OK;
#ifndef IN_PROCESS_AGENT
struct regcache *
-get_thread_regcache (thread_info *thread, int fetch)
+get_thread_regcache (thread_info *thread, bool fetch)
{
regcache *regcache = thread->regcache ();
reg_buffer_common *
get_thread_regcache_for_ptid (ptid_t ptid)
{
- return get_thread_regcache (find_thread_ptid (ptid), 1);
+ return get_thread_regcache (find_thread_ptid (ptid));
}
void
struct regcache *new_register_cache (const struct target_desc *tdesc);
-struct regcache *get_thread_regcache (thread_info *thread, int fetch);
+regcache *get_thread_regcache (thread_info *thread, bool fetch = true);
/* Release all memory associated with the register cache for INFERIOR. */
switch_to_thread (the_target, ptid);
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
if (the_target->stopped_by_watchpoint ())
{
write_enn (cs.own_buf);
else
{
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
registers_to_string (regcache, cs.own_buf);
}
}
write_enn (cs.own_buf);
else
{
- regcache = get_thread_regcache (current_thread, 1);
+ regcache = get_thread_regcache (current_thread);
registers_from_string (regcache, &cs.own_buf[1]);
write_ok (cs.own_buf);
}
wstep->tp_number, paddress (wstep->tp_address));
ctx.base.type = trap_tracepoint;
- ctx.regcache = get_thread_regcache (tinfo, 1);
+ ctx.regcache = get_thread_regcache (tinfo);
while (wstep != NULL)
{
return 0;
ctx.base.type = trap_tracepoint;
- ctx.regcache = get_thread_regcache (tinfo, 1);
+ ctx.regcache = get_thread_regcache (tinfo);
for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
{
static void
maybe_adjust_pc ()
{
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
+ regcache *regcache = get_thread_regcache (current_thread);
child_fetch_inferior_registers (regcache, -1);
windows_thread_info *th