aboutsummaryrefslogtreecommitdiff
path: root/gdb/fbsd-nat.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
commita3627b54280ba306766f2689fb35442f24c4c313 (patch)
tree4ebe6fd819b4159eab08b222f42a2cc6f5ee3bef /gdb/fbsd-nat.c
parent983b1119bc315c9182e3aba898ca8099e54da49e (diff)
downloadfsf-binutils-gdb-a3627b54280ba306766f2689fb35442f24c4c313.zip
fsf-binutils-gdb-a3627b54280ba306766f2689fb35442f24c4c313.tar.gz
fsf-binutils-gdb-a3627b54280ba306766f2689fb35442f24c4c313.tar.bz2
fbsd-nat: Add a low_prepare_to_resume virtual method.
This method can be overridden by architecture-specific targets to perform additional work before a thread is resumed.
Diffstat (limited to 'gdb/fbsd-nat.c')
-rw-r--r--gdb/fbsd-nat.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 2bc7937..934fdba 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -1138,6 +1138,8 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
perror_with_name (request == PT_RESUME ?
("ptrace (PT_RESUME)") :
("ptrace (PT_SUSPEND)"));
+ if (request == PT_RESUME)
+ low_prepare_to_resume (tp);
}
}
else
@@ -1145,8 +1147,11 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
/* If ptid is a wildcard, resume all matching threads (they won't run
until the process is continued however). */
for (thread_info *tp : all_non_exited_threads (this, ptid))
- if (ptrace (PT_RESUME, tp->ptid.lwp (), NULL, 0) == -1)
- perror_with_name (("ptrace (PT_RESUME)"));
+ {
+ if (ptrace (PT_RESUME, tp->ptid.lwp (), NULL, 0) == -1)
+ perror_with_name (("ptrace (PT_RESUME)"));
+ low_prepare_to_resume (tp);
+ }
ptid = inferior_ptid;
}