+2014-07-11 Gary Benson <gbenson@redhat.com>
+
+ * amd64-linux-nat.c (amd64_linux_dr_get): Renamed to
+ x86_linux_dr_get. All uses updated.
+ (amd64_linux_dr_set): Renamed to
+ x86_linux_dr_set. All uses updated.
+ (amd64_linux_dr_get_addr): Renamed to
+ x86_linux_dr_get_addr. All uses updated.
+ (amd64_linux_dr_get_control): Renamed to
+ x86_linux_dr_get_control. All uses updated.
+ (amd64_linux_dr_get_status): Renamed to
+ x86_linux_dr_get_status. All uses updated.
+ (amd64_linux_dr_set_control): Renamed to
+ x86_linux_dr_set_control. All uses updated.
+ (amd64_linux_dr_set_addr): Renamed to
+ x86_linux_dr_set_addr. All uses updated.
+ (amd64_linux_prepare_to_resume): Renamed to
+ x86_linux_prepare_to_resume. All uses updated.
+ (amd64_linux_new_thread): Renamed to
+ x86_linux_new_thread. All uses updated.
+ (amd64_linux_new_fork): Renamed to
+ x86_linux_new_fork. All uses updated.
+ (amd64_linux_child_post_startup_inferior): Renamed to
+ x86_linux_child_post_startup_inferior. All uses updated.
+ (amd64_linux_enable_btrace): Renamed to
+ x86_linux_enable_btrace. All uses updated.
+ (amd64_linux_disable_btrace): Renamed to
+ x86_linux_disable_btrace. All uses updated.
+ (amd64_linux_teardown_btrace): Renamed to
+ x86_linux_teardown_btrace. All uses updated.
+ (amd64_linux_read_btrace): Renamed to
+ x86_linux_read_btrace. All uses updated.
+ * i386-linux-nat.c (i386_linux_dr_get): Renamed to
+ x86_linux_dr_get. All uses updated.
+ (i386_linux_dr_set): Renamed to
+ x86_linux_dr_set. All uses updated.
+ (i386_linux_dr_get_addr): Renamed to
+ x86_linux_dr_get_addr. All uses updated.
+ (i386_linux_dr_get_control): Renamed to
+ x86_linux_dr_get_control. All uses updated.
+ (i386_linux_dr_get_status): Renamed to
+ x86_linux_dr_get_status. All uses updated.
+ (i386_linux_dr_set_control): Renamed to
+ x86_linux_dr_set_control. All uses updated.
+ (i386_linux_dr_set_addr): Renamed to
+ x86_linux_dr_set_addr. All uses updated.
+ (i386_linux_prepare_to_resume): Renamed to
+ x86_linux_prepare_to_resume. All uses updated.
+ (i386_linux_new_thread): Renamed to
+ x86_linux_new_thread. All uses updated.
+ (i386_linux_new_fork): Renamed to
+ x86_linux_new_fork. All uses updated.
+ (i386_linux_child_post_startup_inferior): Renamed to
+ x86_linux_child_post_startup_inferior. All uses updated.
+ (i386_linux_enable_btrace): Renamed to
+ x86_linux_enable_btrace. All uses updated.
+ (i386_linux_disable_btrace): Renamed to
+ x86_linux_disable_btrace. All uses updated.
+ (i386_linux_teardown_btrace): Renamed to
+ x86_linux_teardown_btrace. All uses updated.
+ (i386_linux_read_btrace): Renamed to
+ x86_linux_read_btrace. All uses updated.
+
2014-07-11 Adrian Sendroiu <adrian.sendroiu@freescale.com>
* remote.c (extended_remote_post_attach): New function.
/* Support for debug registers. */
static unsigned long
-amd64_linux_dr_get (ptid_t ptid, int regnum)
+x86_linux_dr_get (ptid_t ptid, int regnum)
{
int tid;
unsigned long value;
/* Set debug register REGNUM to VALUE in only the one LWP of PTID. */
static void
-amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
{
int tid;
/* Return the inferior's debug register REGNUM. */
static CORE_ADDR
-amd64_linux_dr_get_addr (int regnum)
+x86_linux_dr_get_addr (int regnum)
{
/* DR6 and DR7 are retrieved with some other way. */
gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
- return amd64_linux_dr_get (inferior_ptid, regnum);
+ return x86_linux_dr_get (inferior_ptid, regnum);
}
/* Return the inferior's DR7 debug control register. */
static unsigned long
-amd64_linux_dr_get_control (void)
+x86_linux_dr_get_control (void)
{
- return amd64_linux_dr_get (inferior_ptid, DR_CONTROL);
+ return x86_linux_dr_get (inferior_ptid, DR_CONTROL);
}
/* Get DR_STATUS from only the one LWP of INFERIOR_PTID. */
static unsigned long
-amd64_linux_dr_get_status (void)
+x86_linux_dr_get_status (void)
{
- return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
+ return x86_linux_dr_get (inferior_ptid, DR_STATUS);
}
/* Callback for iterate_over_lwps. Update the debug registers of
/* Set DR_CONTROL to CONTROL in all LWPs of the current inferior. */
static void
-amd64_linux_dr_set_control (unsigned long control)
+x86_linux_dr_set_control (unsigned long control)
{
ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
inferior. */
static void
-amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+x86_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
If the debug regs have changed, update the thread's copies. */
static void
-amd64_linux_prepare_to_resume (struct lwp_info *lwp)
+x86_linux_prepare_to_resume (struct lwp_info *lwp)
{
int clear_status = 0;
/* Clear DR_CONTROL first. In some cases, setting DR0-3 to a
value that doesn't match what is enabled in DR_CONTROL
results in EINVAL. */
- amd64_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
+ x86_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
if (state->dr_ref_count[i] > 0)
{
- amd64_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);
+ x86_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);
/* If we're setting a watchpoint, any change the inferior
had done itself to the debug registers needs to be
/* If DR_CONTROL is supposed to be zero, we've already set it
above. */
if (state->dr_control_mirror != 0)
- amd64_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);
+ x86_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);
lwp->arch_private->debug_registers_changed = 0;
}
if (clear_status || lwp->stopped_by_watchpoint)
- amd64_linux_dr_set (lwp->ptid, DR_STATUS, 0);
+ x86_linux_dr_set (lwp->ptid, DR_STATUS, 0);
}
static void
-amd64_linux_new_thread (struct lwp_info *lp)
+x86_linux_new_thread (struct lwp_info *lp)
{
struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);
/* linux_nat_new_fork hook. */
static void
-amd64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
+x86_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
{
pid_t parent_pid;
struct i386_debug_reg_state *parent_state;
ptid_t ptid);
static void
-amd64_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
+x86_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
i386_cleanup_dregs ();
super_post_startup_inferior (self, ptid);
/* Enable branch tracing. */
static struct btrace_target_info *
-amd64_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
+x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
{
struct btrace_target_info *tinfo;
struct gdbarch *gdbarch;
/* Disable branch tracing. */
static void
-amd64_linux_disable_btrace (struct target_ops *self,
- struct btrace_target_info *tinfo)
+x86_linux_disable_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
enum btrace_error errcode = linux_disable_btrace (tinfo);
/* Teardown branch tracing. */
static void
-amd64_linux_teardown_btrace (struct target_ops *self,
- struct btrace_target_info *tinfo)
+x86_linux_teardown_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
/* Ignore errors. */
linux_disable_btrace (tinfo);
}
static enum btrace_error
-amd64_linux_read_btrace (struct target_ops *self,
- VEC (btrace_block_s) **data,
- struct btrace_target_info *btinfo,
- enum btrace_read_type type)
+x86_linux_read_btrace (struct target_ops *self,
+ VEC (btrace_block_s) **data,
+ struct btrace_target_info *btinfo,
+ enum btrace_read_type type)
{
return linux_read_btrace (data, btinfo, type);
}
i386_use_watchpoints (t);
- i386_dr_low.set_control = amd64_linux_dr_set_control;
- i386_dr_low.set_addr = amd64_linux_dr_set_addr;
- i386_dr_low.get_addr = amd64_linux_dr_get_addr;
- i386_dr_low.get_status = amd64_linux_dr_get_status;
- i386_dr_low.get_control = amd64_linux_dr_get_control;
+ i386_dr_low.set_control = x86_linux_dr_set_control;
+ i386_dr_low.set_addr = x86_linux_dr_set_addr;
+ i386_dr_low.get_addr = x86_linux_dr_get_addr;
+ i386_dr_low.get_status = x86_linux_dr_get_status;
+ i386_dr_low.get_control = x86_linux_dr_get_control;
i386_set_debug_register_length (8);
/* Override the GNU/Linux inferior startup hook. */
super_post_startup_inferior = t->to_post_startup_inferior;
- t->to_post_startup_inferior = amd64_linux_child_post_startup_inferior;
+ t->to_post_startup_inferior = x86_linux_child_post_startup_inferior;
/* Add our register access methods. */
t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
/* Add btrace methods. */
t->to_supports_btrace = linux_supports_btrace;
- t->to_enable_btrace = amd64_linux_enable_btrace;
- t->to_disable_btrace = amd64_linux_disable_btrace;
- t->to_teardown_btrace = amd64_linux_teardown_btrace;
- t->to_read_btrace = amd64_linux_read_btrace;
+ t->to_enable_btrace = x86_linux_enable_btrace;
+ t->to_disable_btrace = x86_linux_disable_btrace;
+ t->to_teardown_btrace = x86_linux_teardown_btrace;
+ t->to_read_btrace = x86_linux_read_btrace;
/* Register the target. */
linux_nat_add_target (t);
- linux_nat_set_new_thread (t, amd64_linux_new_thread);
- linux_nat_set_new_fork (t, amd64_linux_new_fork);
+ linux_nat_set_new_thread (t, x86_linux_new_thread);
+ linux_nat_set_new_fork (t, x86_linux_new_fork);
linux_nat_set_forget_process (t, i386_forget_process);
linux_nat_set_siginfo_fixup (t, amd64_linux_siginfo_fixup);
- linux_nat_set_prepare_to_resume (t, amd64_linux_prepare_to_resume);
+ linux_nat_set_prepare_to_resume (t, x86_linux_prepare_to_resume);
}
/* Get debug register REGNUM value from only the one LWP of PTID. */
static unsigned long
-i386_linux_dr_get (ptid_t ptid, int regnum)
+x86_linux_dr_get (ptid_t ptid, int regnum)
{
int tid;
unsigned long value;
/* Set debug register REGNUM to VALUE in only the one LWP of PTID. */
static void
-i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
{
int tid;
/* Return the inferior's debug register REGNUM. */
static CORE_ADDR
-i386_linux_dr_get_addr (int regnum)
+x86_linux_dr_get_addr (int regnum)
{
/* DR6 and DR7 are retrieved with some other way. */
gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
- return i386_linux_dr_get (inferior_ptid, regnum);
+ return x86_linux_dr_get (inferior_ptid, regnum);
}
/* Return the inferior's DR7 debug control register. */
static unsigned long
-i386_linux_dr_get_control (void)
+x86_linux_dr_get_control (void)
{
- return i386_linux_dr_get (inferior_ptid, DR_CONTROL);
+ return x86_linux_dr_get (inferior_ptid, DR_CONTROL);
}
/* Get DR_STATUS from only the one LWP of INFERIOR_PTID. */
static unsigned long
-i386_linux_dr_get_status (void)
+x86_linux_dr_get_status (void)
{
- return i386_linux_dr_get (inferior_ptid, DR_STATUS);
+ return x86_linux_dr_get (inferior_ptid, DR_STATUS);
}
/* Callback for iterate_over_lwps. Update the debug registers of
/* Set DR_CONTROL to ADDR in all LWPs of the current inferior. */
static void
-i386_linux_dr_set_control (unsigned long control)
+x86_linux_dr_set_control (unsigned long control)
{
ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
inferior. */
static void
-i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+x86_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
If the debug regs have changed, update the thread's copies. */
static void
-i386_linux_prepare_to_resume (struct lwp_info *lwp)
+x86_linux_prepare_to_resume (struct lwp_info *lwp)
{
int clear_status = 0;
/* See amd64_linux_prepare_to_resume for Linux kernel note on
i386_linux_dr_set calls ordering. */
- i386_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
+ x86_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
if (state->dr_ref_count[i] > 0)
{
- i386_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);
+ x86_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);
/* If we're setting a watchpoint, any change the inferior
had done itself to the debug registers needs to be
}
if (state->dr_control_mirror != 0)
- i386_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);
+ x86_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);
lwp->arch_private->debug_registers_changed = 0;
}
if (clear_status || lwp->stopped_by_watchpoint)
- i386_linux_dr_set (lwp->ptid, DR_STATUS, 0);
+ x86_linux_dr_set (lwp->ptid, DR_STATUS, 0);
}
static void
-i386_linux_new_thread (struct lwp_info *lp)
+x86_linux_new_thread (struct lwp_info *lp)
{
struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);
/* linux_nat_new_fork hook. */
static void
-i386_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
+x86_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
{
pid_t parent_pid;
struct i386_debug_reg_state *parent_state;
ptid_t ptid);
static void
-i386_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
+x86_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
i386_cleanup_dregs ();
super_post_startup_inferior (self, ptid);
/* Enable branch tracing. */
static struct btrace_target_info *
-i386_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
+x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
{
struct btrace_target_info *tinfo;
struct gdbarch *gdbarch;
/* Disable branch tracing. */
static void
-i386_linux_disable_btrace (struct target_ops *self,
- struct btrace_target_info *tinfo)
+x86_linux_disable_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
enum btrace_error errcode = linux_disable_btrace (tinfo);
/* Teardown branch tracing. */
static void
-i386_linux_teardown_btrace (struct target_ops *self,
- struct btrace_target_info *tinfo)
+x86_linux_teardown_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
/* Ignore errors. */
linux_disable_btrace (tinfo);
}
static enum btrace_error
-i386_linux_read_btrace (struct target_ops *self,
- VEC (btrace_block_s) **data,
- struct btrace_target_info *btinfo,
- enum btrace_read_type type)
+x86_linux_read_btrace (struct target_ops *self,
+ VEC (btrace_block_s) **data,
+ struct btrace_target_info *btinfo,
+ enum btrace_read_type type)
{
return linux_read_btrace (data, btinfo, type);
}
i386_use_watchpoints (t);
- i386_dr_low.set_control = i386_linux_dr_set_control;
- i386_dr_low.set_addr = i386_linux_dr_set_addr;
- i386_dr_low.get_addr = i386_linux_dr_get_addr;
- i386_dr_low.get_status = i386_linux_dr_get_status;
- i386_dr_low.get_control = i386_linux_dr_get_control;
+ i386_dr_low.set_control = x86_linux_dr_set_control;
+ i386_dr_low.set_addr = x86_linux_dr_set_addr;
+ i386_dr_low.get_addr = x86_linux_dr_get_addr;
+ i386_dr_low.get_status = x86_linux_dr_get_status;
+ i386_dr_low.get_control = x86_linux_dr_get_control;
i386_set_debug_register_length (4);
/* Override the default ptrace resume method. */
/* Override the GNU/Linux inferior startup hook. */
super_post_startup_inferior = t->to_post_startup_inferior;
- t->to_post_startup_inferior = i386_linux_child_post_startup_inferior;
+ t->to_post_startup_inferior = x86_linux_child_post_startup_inferior;
/* Add our register access methods. */
t->to_fetch_registers = i386_linux_fetch_inferior_registers;
/* Add btrace methods. */
t->to_supports_btrace = linux_supports_btrace;
- t->to_enable_btrace = i386_linux_enable_btrace;
- t->to_disable_btrace = i386_linux_disable_btrace;
- t->to_teardown_btrace = i386_linux_teardown_btrace;
- t->to_read_btrace = i386_linux_read_btrace;
+ t->to_enable_btrace = x86_linux_enable_btrace;
+ t->to_disable_btrace = x86_linux_disable_btrace;
+ t->to_teardown_btrace = x86_linux_teardown_btrace;
+ t->to_read_btrace = x86_linux_read_btrace;
/* Register the target. */
linux_nat_add_target (t);
- linux_nat_set_new_thread (t, i386_linux_new_thread);
- linux_nat_set_new_fork (t, i386_linux_new_fork);
+ linux_nat_set_new_thread (t, x86_linux_new_thread);
+ linux_nat_set_new_fork (t, x86_linux_new_fork);
linux_nat_set_forget_process (t, i386_forget_process);
- linux_nat_set_prepare_to_resume (t, i386_linux_prepare_to_resume);
+ linux_nat_set_prepare_to_resume (t, x86_linux_prepare_to_resume);
}