--- Makefile (revision 370166) +++ Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= gdb PORTVERSION= 7.8 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= GNU --- files/fbsd-threads.c (revision 370166) +++ files/fbsd-threads.c (working copy) @@ -1188,9 +1188,9 @@ } } - 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; } --- files/patch-gdb-amd64fbsd-nat.c (revision 370166) +++ files/patch-gdb-amd64fbsd-nat.c (working copy) @@ -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 #include #include ++#include ++#include #include -@@ -93,6 +95,46 @@ + + #include "fbsd-nat.h" +@@ -93,6 +97,46 @@ }; @@ -60,4 +64,41 @@ + /* Support for debugging kernel virtual memory images. */ - #include + #include +@@ -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 + } --- files/patch-gdb-configure (revision 370166) +++ files/patch-gdb-configure (working copy) @@ -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 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.