aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-linux-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-08-28 10:58:45 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-09-27 22:30:11 -0400
commit901b98215e767bbffb1bfa869e02d7dc5ea786ec (patch)
tree31da2785d795cdf08419b11c6cfd701f1fa7b248 /gdb/mips-linux-nat.c
parent676362df181a39a5c58bba15f4f7524bfd58b88d (diff)
downloadgdb-901b98215e767bbffb1bfa869e02d7dc5ea786ec.zip
gdb-901b98215e767bbffb1bfa869e02d7dc5ea786ec.tar.gz
gdb-901b98215e767bbffb1bfa869e02d7dc5ea786ec.tar.bz2
gdb: use intrusive_list for linux-nat lwp_list
Replace the manually maintained linked list of lwp_info objects with intrusive_list. Replace the ALL_LWPS macro with all_lwps, which returns a range. Add all_lwps_safe as well, for use in iterate_over_lwps, which currently iterates in a safe manner. Change-Id: I355313502510acc0103f5eaf2fbde80897d6376c
Diffstat (limited to 'gdb/mips-linux-nat.c')
-rw-r--r--gdb/mips-linux-nat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index b21c7cb..1088a7d 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -632,12 +632,9 @@ mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
static int
write_watchpoint_regs (void)
{
- struct lwp_info *lp;
- int tid;
-
- ALL_LWPS (lp)
+ for (const lwp_info *lp : all_lwps ())
{
- tid = lp->ptid.lwp ();
+ int tid = lp->ptid.lwp ();
if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1)
perror_with_name (_("Couldn't write debug register"));
}