diff options
author | Tijl Coosemans <tijl@FreeBSD.org> | 2014-10-07 10:25:42 +0000 |
---|---|---|
committer | Tijl Coosemans <tijl@FreeBSD.org> | 2014-10-07 10:25:42 +0000 |
commit | 86fb2cb5b780b898e40d943fa25f733e25fb3265 (patch) | |
tree | 06eab6100654c17b12ba0217a97e2728d76cdf34 | |
parent | 8cbf159ea12d3798efcc54b9e40dbab22c6436ca (diff) | |
download | ports-86fb2cb5b780b898e40d943fa25f733e25fb3265.tar.gz ports-86fb2cb5b780b898e40d943fa25f733e25fb3265.zip |
Notes
-rw-r--r-- | devel/gdb/Makefile | 2 | ||||
-rw-r--r-- | devel/gdb/files/fbsd-threads.c | 4 | ||||
-rw-r--r-- | devel/gdb/files/patch-gdb-amd64fbsd-nat.c | 51 | ||||
-rw-r--r-- | devel/gdb/files/patch-gdb-configure | 21 |
4 files changed, 66 insertions, 12 deletions
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile index 23bdaaf110e3..0b9db4fb8a7a 100644 --- a/devel/gdb/Makefile +++ b/devel/gdb/Makefile @@ -3,7 +3,7 @@ PORTNAME= gdb PORTVERSION= 7.8 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= GNU diff --git a/devel/gdb/files/fbsd-threads.c b/devel/gdb/files/fbsd-threads.c index 0ab1d5d63630..582188d5cb85 100644 --- a/devel/gdb/files/fbsd-threads.c +++ b/devel/gdb/files/fbsd-threads.c @@ -1188,9 +1188,9 @@ fbsd_find_lwp_name(long lwpid, struct private_thread_info *info) } } - len = strlen(kipp->ki_ocomm); + len = strlen(kipp->ki_ocomm) + 1; lwpstr = xmalloc(len); - strcpy(lwpstr, kipp->ki_ocomm); + strncpy(lwpstr, kipp->ki_ocomm, len); info->lwp_name = lwpstr; break; } diff --git a/devel/gdb/files/patch-gdb-amd64fbsd-nat.c b/devel/gdb/files/patch-gdb-amd64fbsd-nat.c index 5cd5015a89ba..d7308d74ac0d 100644 --- a/devel/gdb/files/patch-gdb-amd64fbsd-nat.c +++ b/devel/gdb/files/patch-gdb-amd64fbsd-nat.c @@ -1,6 +1,6 @@ ---- gdb/amd64fbsd-nat.c.orig 2012-02-09 17:06:44.000000000 +0100 -+++ gdb/amd64fbsd-nat.c 2012-08-30 10:58:55.000000000 +0200 -@@ -21,11 +21,13 @@ +--- gdb/amd64fbsd-nat.c.orig 2014-06-11 18:34:41.000000000 +0200 ++++ gdb/amd64fbsd-nat.c 2014-09-24 18:27:50.618458853 +0200 +@@ -21,13 +21,17 @@ #include "inferior.h" #include "regcache.h" #include "target.h" @@ -13,8 +13,12 @@ +#include <sys/procfs.h> #include <sys/ptrace.h> #include <sys/sysctl.h> ++#include <sys/user.h> ++#include <sys/param.h> #include <machine/reg.h> -@@ -93,6 +95,46 @@ + + #include "fbsd-nat.h" +@@ -93,6 +97,46 @@ }; @@ -60,4 +64,41 @@ + /* Support for debugging kernel virtual memory images. */ - #include <sys/types.h> + #include <machine/pcb.h> +@@ -247,6 +291,10 @@ + + SC_RBP_OFFSET = offset; + ++// Newer versions of FreeBSD provide a better way to locate the signtramp ++#if ( __FreeBSD_version/100000 < 9 ) \ ++ || ( ( __FreeBSD_version/100000 == 9 ) && ( __FreeBSD_version < 902505 ) ) \ ++ || ( ( __FreeBSD_version/100000 == 10 ) && ( __FreeBSD_version < 1000700 ) ) + /* 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 +@@ -267,4 +315,25 @@ + amd64fbsd_sigtramp_end_addr = ps_strings; + } + } ++#else ++ /* 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) ++ { ++ amd64fbsd_sigtramp_start_addr = kst.ksigtramp_start; ++ amd64fbsd_sigtramp_end_addr = kst.ksigtramp_end; ++ } ++ } ++#endif + } diff --git a/devel/gdb/files/patch-gdb-configure b/devel/gdb/files/patch-gdb-configure index 288eb57dad0b..3ec1b2dd381f 100644 --- a/devel/gdb/files/patch-gdb-configure +++ b/devel/gdb/files/patch-gdb-configure @@ -1,6 +1,6 @@ ---- gdb/configure.orig 2012-08-24 14:03:52.000000000 +0200 -+++ gdb/configure 2012-08-24 14:05:06.000000000 +0200 -@@ -10590,7 +10590,8 @@ +--- gdb/configure.orig 2014-07-29 14:37:42.000000000 +0200 ++++ gdb/configure 2014-10-01 14:21:14.902231511 +0200 +@@ -11485,7 +11485,8 @@ # See if <machine/reg.h> supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. @@ -10,7 +10,7 @@ " if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then : -@@ -10600,7 +10601,8 @@ +@@ -11495,7 +11496,8 @@ fi @@ -20,3 +20,16 @@ " if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then : +@@ -13007,10 +13009,9 @@ + + build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ + -Wpointer-sign \ +--Wno-unused -Wunused-value -Wunused-function \ ++-Wno-unused -Wunused-value \ + -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \ +--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \ +--Wold-style-declaration -Wold-style-definition" ++-Wdeclaration-after-statement -Wempty-body -Wold-style-definition" + + # Enable -Wno-format by default when using gcc on mingw since many + # GCC versions complain about %I64. |