summaryrefslogtreecommitdiff
path: root/devel/gdb/files/patch-gdb-i386fbsd-nat.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2015-04-29 13:53:45 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2015-04-29 13:53:45 +0000
commitbc869246e9838943d99c2c0e3f2bda6c325a77d0 (patch)
treed9bb7f99a01d6552a99e35414062781ad97ef441 /devel/gdb/files/patch-gdb-i386fbsd-nat.c
parentdevel/onscripter: unbreak build against lang/lua53 (diff)
Update to 7.9.
- Move changes that have been adopted upstream after 7.9 into extra patches named after the commit to GDB's master branch. This includes previous patches such as the signal trampoline detection fixes and XSAVE support as well as well as new fixes such as fixing 'gcore' to not require procfs. - The tui-io.c patch previously needed with new readline has been accepted upstream. - The remaining patches have been updated to apply cleanly. - The threads target has been fixed to actually pass register requests for LWP-backed threads down to the ptrace backends without detouring via libthread_db which actually fixes AVX with threads. PR: 199451 Differential Revision: https://reviews.freebsd.org/D2293 Approved by: bapt, luca.pizzamiglio@gmail.com (maintainer)
Notes
Notes: svn path=/head/; revision=384978
Diffstat (limited to 'devel/gdb/files/patch-gdb-i386fbsd-nat.c')
-rw-r--r--devel/gdb/files/patch-gdb-i386fbsd-nat.c62
1 files changed, 8 insertions, 54 deletions
diff --git a/devel/gdb/files/patch-gdb-i386fbsd-nat.c b/devel/gdb/files/patch-gdb-i386fbsd-nat.c
index c72894a4f793..062289d0441d 100644
--- a/devel/gdb/files/patch-gdb-i386fbsd-nat.c
+++ b/devel/gdb/files/patch-gdb-i386fbsd-nat.c
@@ -1,58 +1,12 @@
---- gdb/i386fbsd-nat.c.orig 2012-05-24 18:39:09.000000000 +0200
-+++ gdb/i386fbsd-nat.c 2012-08-29 17:19:57.000000000 +0200
-@@ -21,10 +21,12 @@
- #include "inferior.h"
- #include "regcache.h"
- #include "target.h"
-
- #include <sys/types.h>
-+#include <sys/procfs.h>
- #include <sys/ptrace.h>
- #include <sys/sysctl.h>
-+#include <sys/user.h>
-
- #include "fbsd-nat.h"
- #include "i386-tdep.h"
-@@ -140,7 +141,6 @@
- #endif /* HAVE_PT_GETDBREGS */
-
+diff --git gdb/i386fbsd-nat.c gdb/i386fbsd-nat.c
+index 6c43f2c..a205a26 100644
+--- gdb/i386fbsd-nat.c
++++ gdb/i386fbsd-nat.c
+@@ -175,7 +175,6 @@ _initialize_i386fbsd_nat (void)
+ t->to_read_description = i386fbsd_read_description;
+ #endif
- t->to_resume = i386fbsd_resume;
t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
t->to_find_memory_regions = fbsd_find_memory_regions;
- t->to_make_corefile_notes = fbsd_make_corefile_notes;
-@@ -149,13 +149,33 @@ _initialize_i386fbsd_nat (void)
- /* Support debugging kernel virtual memory images. */
- bsd_kvm_add_target (i386fbsd_supply_pcb);
-
-+#ifdef KERN_PROC_SIGTRAMP
-+ /* 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. */
-+ {
-+ int mib[4];
-+ struct kinfo_sigtramp kst;
-+ size_t len;
-+
-+ mib[0] = CTL_KERN;
-+ 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)
-+ {
-+ i386fbsd_sigtramp_start_addr = (uintptr_t)kst.ksigtramp_start;
-+ i386fbsd_sigtramp_end_addr = (uintptr_t)kst.ksigtramp_end;
-+ }
-+ }
-+#elif defined(KERN_PS_STRINGS)
- /* FreeBSD provides a kern.ps_strings 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. */
--#ifdef KERN_PS_STRINGS
- {
- int mib[2];
- u_long ps_strings;
+ add_target (t);