* linux-nat.h (ALL_LWPS): Remove the ptid parameter.
* amd64-linux-nat.c (amd64_linux_dr_set_control)
(amd64_linux_dr_set_addr, amd64_linux_dr_unset_status): Adjust.
* arm-linux-nat.c (arm_linux_insert_hw_breakpoint)
(arm_linux_remove_hw_breakpoint, arm_linux_insert_watchpoint)
(arm_linux_remove_watchpoint): Adjust.
* i386-linux-nat.c (i386_linux_dr_set_control)
(i386_linux_dr_set_addr, i386_linux_dr_unset_status): Adjust.
* ia64-linux-nat.c (ia64_linux_insert_watchpoint)
(ia64_linux_remove_watchpoint): Adjust.
* mips-linux-nat.c (write_watchpoint_regs): Adjust.
* ppc-linux-nat.c (ppc_linux_insert_hw_breakpoint)
(ppc_linux_insert_hw_breakpoint, ppc_linux_remove_hw_breakpoint)
(ppc_linux_insert_mask_watchpoint)
(ppc_linux_remove_mask_watchpoint, ppc_linux_insert_watchpoint)
(ppc_linux_remove_watchpoint): Adjust.
* s390-nat.c (s390_insert_watchpoint, s390_remove_watchpoint):
Adjust.
amd64_linux_dr_set_control (unsigned long control)
{
struct lwp_info *lp;
- ptid_t ptid;
amd64_linux_dr[DR_CONTROL] = control;
- ALL_LWPS (lp, ptid)
- amd64_linux_dr_set (ptid, DR_CONTROL, control);
+ ALL_LWPS (lp)
+ amd64_linux_dr_set (lp->ptid, DR_CONTROL, control);
}
/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */
amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
struct lwp_info *lp;
- ptid_t ptid;
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
amd64_linux_dr[DR_FIRSTADDR + regnum] = addr;
- ALL_LWPS (lp, ptid)
- amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
+ ALL_LWPS (lp)
+ amd64_linux_dr_set (lp->ptid, DR_FIRSTADDR + regnum, addr);
}
/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */
amd64_linux_dr_unset_status (unsigned long mask)
{
struct lwp_info *lp;
- ptid_t ptid;
- ALL_LWPS (lp, ptid)
+ ALL_LWPS (lp)
{
unsigned long value;
- value = amd64_linux_dr_get (ptid, DR_STATUS);
+ value = amd64_linux_dr_get (lp->ptid, DR_STATUS);
value &= ~mask;
- amd64_linux_dr_set (ptid, DR_STATUS, value);
+ amd64_linux_dr_set (lp->ptid, DR_STATUS, value);
}
}
arm_linux_insert_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
- ptid_t ptid;
struct lwp_info *lp;
struct arm_linux_hw_breakpoint p;
return -1;
arm_linux_hw_breakpoint_initialize (gdbarch, bp_tgt, &p);
- ALL_LWPS (lp, ptid)
- arm_linux_insert_hw_breakpoint1 (&p, TIDGET (ptid), 0);
+ ALL_LWPS (lp)
+ arm_linux_insert_hw_breakpoint1 (&p, TIDGET (lp->ptid), 0);
return 0;
}
arm_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
- ptid_t ptid;
struct lwp_info *lp;
struct arm_linux_hw_breakpoint p;
return -1;
arm_linux_hw_breakpoint_initialize (gdbarch, bp_tgt, &p);
- ALL_LWPS (lp, ptid)
- arm_linux_remove_hw_breakpoint1 (&p, TIDGET (ptid), 0);
+ ALL_LWPS (lp)
+ arm_linux_remove_hw_breakpoint1 (&p, TIDGET (lp->ptid), 0);
return 0;
}
arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
struct expression *cond)
{
- ptid_t ptid;
struct lwp_info *lp;
struct arm_linux_hw_breakpoint p;
return -1;
arm_linux_hw_watchpoint_initialize (addr, len, rw, &p);
- ALL_LWPS (lp, ptid)
- arm_linux_insert_hw_breakpoint1 (&p, TIDGET (ptid), 1);
+ ALL_LWPS (lp)
+ arm_linux_insert_hw_breakpoint1 (&p, TIDGET (lp->ptid), 1);
return 0;
}
arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
struct expression *cond)
{
- ptid_t ptid;
struct lwp_info *lp;
struct arm_linux_hw_breakpoint p;
return -1;
arm_linux_hw_watchpoint_initialize (addr, len, rw, &p);
- ALL_LWPS (lp, ptid)
- arm_linux_remove_hw_breakpoint1 (&p, TIDGET (ptid), 1);
+ ALL_LWPS (lp)
+ arm_linux_remove_hw_breakpoint1 (&p, TIDGET (lp->ptid), 1);
return 0;
}
i386_linux_dr_set_control (unsigned long control)
{
struct lwp_info *lp;
- ptid_t ptid;
i386_linux_dr[DR_CONTROL] = control;
- ALL_LWPS (lp, ptid)
- i386_linux_dr_set (ptid, DR_CONTROL, control);
+ ALL_LWPS (lp)
+ i386_linux_dr_set (lp->ptid, DR_CONTROL, control);
}
/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */
i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
struct lwp_info *lp;
- ptid_t ptid;
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
i386_linux_dr[DR_FIRSTADDR + regnum] = addr;
- ALL_LWPS (lp, ptid)
- i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
+ ALL_LWPS (lp)
+ i386_linux_dr_set (lp->ptid, DR_FIRSTADDR + regnum, addr);
}
/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */
i386_linux_dr_unset_status (unsigned long mask)
{
struct lwp_info *lp;
- ptid_t ptid;
- ALL_LWPS (lp, ptid)
+ ALL_LWPS (lp)
{
unsigned long value;
-
- value = i386_linux_dr_get (ptid, DR_STATUS);
+
+ value = i386_linux_dr_get (lp->ptid, DR_STATUS);
value &= ~mask;
- i386_linux_dr_set (ptid, DR_STATUS, value);
+ i386_linux_dr_set (lp->ptid, DR_STATUS, value);
}
}
struct expression *cond)
{
struct lwp_info *lp;
- ptid_t ptid;
int idx;
long dbr_addr, dbr_mask;
int max_watchpoints = 4;
debug_registers[2 * idx] = dbr_addr;
debug_registers[2 * idx + 1] = dbr_mask;
- ALL_LWPS (lp, ptid)
+ ALL_LWPS (lp)
{
- store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
- enable_watchpoints_in_psr (ptid);
+ store_debug_register_pair (lp->ptid, idx, &dbr_addr, &dbr_mask);
+ enable_watchpoints_in_psr (lp->ptid);
}
return 0;
if ((dbr_mask & (0x3UL << 62)) && addr == (CORE_ADDR) dbr_addr)
{
struct lwp_info *lp;
- ptid_t ptid;
debug_registers[2 * idx] = 0;
debug_registers[2 * idx + 1] = 0;
dbr_addr = 0;
dbr_mask = 0;
- ALL_LWPS (lp, ptid)
- store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
+ ALL_LWPS (lp)
+ store_debug_register_pair (lp->ptid, idx, &dbr_addr, &dbr_mask);
return 0;
}
native target is active. */
extern struct lwp_info *lwp_list;
-/* Iterate over the PTID each active thread (light-weight process). There
- must be at least one. */
-#define ALL_LWPS(LP, PTID) \
- for ((LP) = lwp_list, (PTID) = (LP)->ptid; \
+/* Iterate over each active thread (light-weight process). */
+#define ALL_LWPS(LP) \
+ for ((LP) = lwp_list; \
(LP) != NULL; \
- (LP) = (LP)->next, (PTID) = (LP) ? (LP)->ptid : (PTID))
+ (LP) = (LP)->next)
#define GET_LWP(ptid) ptid_get_lwp (ptid)
#define GET_PID(ptid) ptid_get_pid (ptid)
write_watchpoint_regs (void)
{
struct lwp_info *lp;
- ptid_t ptid;
int tid;
- ALL_LWPS (lp, ptid)
+ ALL_LWPS (lp)
{
- tid = ptid_get_lwp (ptid);
+ tid = ptid_get_lwp (lp->ptid);
if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror) == -1)
perror_with_name (_("Couldn't write debug register"));
}
ppc_linux_insert_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
- ptid_t ptid;
struct lwp_info *lp;
struct ppc_hw_breakpoint p;
p.addr2 = 0;
}
- ALL_LWPS (lp, ptid)
- booke_insert_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_insert_point (&p, TIDGET (lp->ptid));
return 0;
}
ppc_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
- ptid_t ptid;
struct lwp_info *lp;
struct ppc_hw_breakpoint p;
p.addr2 = 0;
}
- ALL_LWPS (lp, ptid)
- booke_remove_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_remove_point (&p, TIDGET (lp->ptid));
return 0;
}
ppc_linux_insert_mask_watchpoint (struct target_ops *ops, CORE_ADDR addr,
CORE_ADDR mask, int rw)
{
- ptid_t ptid;
struct lwp_info *lp;
struct ppc_hw_breakpoint p;
p.addr2 = mask;
p.condition_value = 0;
- ALL_LWPS (lp, ptid)
- booke_insert_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_insert_point (&p, TIDGET (lp->ptid));
return 0;
}
ppc_linux_remove_mask_watchpoint (struct target_ops *ops, CORE_ADDR addr,
CORE_ADDR mask, int rw)
{
- ptid_t ptid;
struct lwp_info *lp;
struct ppc_hw_breakpoint p;
p.addr2 = mask;
p.condition_value = 0;
- ALL_LWPS (lp, ptid)
- booke_remove_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_remove_point (&p, TIDGET (lp->ptid));
return 0;
}
struct expression *cond)
{
struct lwp_info *lp;
- ptid_t ptid;
int ret = -1;
if (have_ptrace_booke_interface ())
create_watchpoint_request (&p, addr, len, rw, cond, 1);
- ALL_LWPS (lp, ptid)
- booke_insert_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_insert_point (&p, TIDGET (lp->ptid));
ret = 0;
}
saved_dabr_value = dabr_value;
- ALL_LWPS (lp, ptid)
- if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0,
+ ALL_LWPS (lp)
+ if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (lp->ptid), 0,
saved_dabr_value) < 0)
return -1;
struct expression *cond)
{
struct lwp_info *lp;
- ptid_t ptid;
int ret = -1;
if (have_ptrace_booke_interface ())
create_watchpoint_request (&p, addr, len, rw, cond, 0);
- ALL_LWPS (lp, ptid)
- booke_remove_point (&p, TIDGET (ptid));
+ ALL_LWPS (lp)
+ booke_remove_point (&p, TIDGET (lp->ptid));
ret = 0;
}
else
{
saved_dabr_value = 0;
- ALL_LWPS (lp, ptid)
- if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0,
+ ALL_LWPS (lp)
+ if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (lp->ptid), 0,
saved_dabr_value) < 0)
return -1;
struct expression *cond)
{
struct lwp_info *lp;
- ptid_t ptid;
struct watch_area *area = xmalloc (sizeof (struct watch_area));
if (!area)
area->next = watch_base;
watch_base = area;
- ALL_LWPS (lp, ptid)
- s390_fix_watch_points (ptid);
+ ALL_LWPS (lp)
+ s390_fix_watch_points (lp->ptid);
return 0;
}
struct expression *cond)
{
struct lwp_info *lp;
- ptid_t ptid;
struct watch_area *area, **parea;
for (parea = &watch_base; *parea; parea = &(*parea)->next)
*parea = area->next;
xfree (area);
- ALL_LWPS (lp, ptid)
- s390_fix_watch_points (ptid);
+ ALL_LWPS (lp)
+ s390_fix_watch_points (lp->ptid);
return 0;
}