summaryrefslogtreecommitdiffstats
path: root/contrib/gdb
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-12-03 19:42:46 +0000
committerkib <kib@FreeBSD.org>2013-12-03 19:42:46 +0000
commit34987b9cca442013bcdc692d57a6d3b05b355a62 (patch)
tree13b5a4104f5d55e5d97b919c01f855d51fb56b60 /contrib/gdb
parent9934b5683d427d9de7457fc6b743dd7eb0fe35ab (diff)
downloadFreeBSD-src-34987b9cca442013bcdc692d57a6d3b05b355a62.zip
FreeBSD-src-34987b9cca442013bcdc692d57a6d3b05b355a62.tar.gz
MFC r258663:
Use sysctl KERN_PROC_SIGTRAMP to retrieve the signal trampoline location for the native amd64 ABI. This fixes unwinding over the signal frame after trampoline was moved to the shared page. Approved by: re (gjb)
Diffstat (limited to 'contrib/gdb')
-rw-r--r--contrib/gdb/gdb/amd64fbsd-nat.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/gdb/gdb/amd64fbsd-nat.c b/contrib/gdb/gdb/amd64fbsd-nat.c
index f083734..dacd4a3 100644
--- a/contrib/gdb/gdb/amd64fbsd-nat.c
+++ b/contrib/gdb/gdb/amd64fbsd-nat.c
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include <sys/user.h>
#include <machine/reg.h>
#ifdef HAVE_SYS_PROCFS_H
@@ -212,24 +213,23 @@ Please report this to <bug-gdb@gnu.org>.",
SC_RBP_OFFSET = offset;
- /* FreeBSD provides a kern.ps_strings sysctl that we can use to
+ /* FreeBSD provides a kern.proc.sigtramp sysctl that we can use to
locate the sigtramp. That way we can still recognize a sigtramp
- if its location is changed in a new kernel. Of course this is
- still based on the assumption that the sigtramp is placed
- directly under the location where the program arguments and
- environment can be found. */
+ if its location is changed in a new kernel. */
{
- int mib[2];
- long ps_strings;
+ int mib[4];
+ struct kinfo_sigtramp kst;
size_t len;
mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof (ps_strings);
- if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_SIGTRAMP;
+ mib[3] = getpid();
+ len = sizeof (kst);
+ if (sysctl (mib, sizeof(mib) / sizeof(mib[0]), &kst, &len, NULL, 0) == 0)
{
- amd64fbsd_sigtramp_start_addr = ps_strings - 32;
- amd64fbsd_sigtramp_end_addr = ps_strings;
+ amd64fbsd_sigtramp_start_addr = kst.ksigtramp_start;
+ amd64fbsd_sigtramp_end_addr = kst.ksigtramp_end;
}
}
}
OpenPOWER on IntegriCloud