diff options
Diffstat (limited to 'devel/gdb/files/patch-gdb-i386fbsd-nat.c')
-rw-r--r-- | devel/gdb/files/patch-gdb-i386fbsd-nat.c | 62 |
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); |