/* Native-dependent code for GNU/Linux x86-64.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
}
-/* Callback for iterate_over_lwps. Update the debug registers of
- LWP. */
+/* Callback for linux_nat_iterate_watchpoint_lwps. Update the debug registers
+ of LWP. */
static int
update_debug_registers_callback (struct lwp_info *lwp, void *arg)
static void
amd64_linux_dr_set_control (unsigned long control)
{
- ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
-
- iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
+ linux_nat_iterate_watchpoint_lwps (update_debug_registers_callback, NULL);
}
/* Set address REGNUM (zero based) to ADDR in all LWPs of the current
static void
amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
- ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
-
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
- iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
+ linux_nat_iterate_watchpoint_lwps (update_debug_registers_callback, NULL);
}
/* Called when resuming a thread.
struct i386_debug_reg_state *state = i386_debug_reg_state ();
int i;
+ /* On Linux kernel before 2.6.33 commit
+ 72f674d203cd230426437cdcf7dd6f681dad8b0d
+ if you enable a breakpoint by the DR_CONTROL bits you need to have
+ already written the corresponding DR_FIRSTADDR...DR_LASTADDR registers.
+
+ Ensure DR_CONTROL gets written as the very last register here. */
+
for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
if (state->dr_ref_count[i] > 0)
{
INF. */
static int
-amd64_linux_siginfo_fixup (struct siginfo *native, gdb_byte *inf, int direction)
+amd64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
{
/* Is the inferior 32-bit? If so, then do fixup the siginfo
object. */
if (gdbarch_addr_bit (get_frame_arch (get_current_frame ())) == 32)
{
- gdb_assert (sizeof (struct siginfo) == sizeof (compat_siginfo_t));
+ gdb_assert (sizeof (siginfo_t) == sizeof (compat_siginfo_t));
if (direction == 0)
compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, native);