ports/devel/gdb/files/commit-a3627b54280
John Baldwin 1c25ded0af devel/gdb: Update to 12.1.
One notable feature included in 12.1 is async target support
permitting the use of commands like continue&.

In addition, this commit backports various post-12 commits to add
support for hardware breakpoints/watchpoints on aarch64, support for
resolving TLS variables from core dumps on amd64 and i386 via the
recently added NT_X86_SEGBASES core dump note, and support for
resolving TLS variables on arm and aarch64 via the recently added
NT_ARM_TLS register set.

Reviewed by:	pizzamig
Differential Revision:	https://reviews.freebsd.org/D35111
2022-05-10 10:41:13 -07:00

53 lines
1.8 KiB
Text

commit 28207615d3f3d639a71df51be9ceed3033bb17c6
Author: John Baldwin <jhb@FreeBSD.org>
Date: Tue Mar 22 12:05:43 2022 -0700
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.
(cherry picked from commit a3627b54280ba306766f2689fb35442f24c4c313)
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 2bc7937a38b..934fdbad6ef 100644
--- gdb/fbsd-nat.c
+++ 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;
}
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index 6028aebfccc..82f7ee47949 100644
--- gdb/fbsd-nat.h
+++ gdb/fbsd-nat.h
@@ -119,6 +119,10 @@ class fbsd_nat_target : public inf_ptrace_target
virtual void low_delete_thread (thread_info *)
{}
+ /* Hook to call prior to resuming a thread. */
+ virtual void low_prepare_to_resume (thread_info *)
+ {}
+
protected:
void post_startup_inferior (ptid_t) override;