View | Details | Raw Unified | Return to bug 194190
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	gdb
4
PORTNAME=	gdb
5
PORTVERSION=	7.8
5
PORTVERSION=	7.8
6
PORTREVISION=	2
6
PORTREVISION=	3
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	GNU
8
MASTER_SITES=	GNU
9
9
(-)files/fbsd-threads.c (-2 / +2 lines)
Lines 1188-1196 Link Here
1188
                }
1188
                }
1189
            }
1189
            }
1190
1190
1191
          len = strlen(kipp->ki_ocomm);
1191
          len = strlen(kipp->ki_ocomm) + 1;
1192
          lwpstr = xmalloc(len);
1192
          lwpstr = xmalloc(len);
1193
          strcpy(lwpstr, kipp->ki_ocomm);
1193
          strncpy(lwpstr, kipp->ki_ocomm, len);
1194
          info->lwp_name = lwpstr;
1194
          info->lwp_name = lwpstr;
1195
          break;
1195
          break;
1196
        }
1196
        }
(-)files/patch-gdb-amd64fbsd-nat.c (-5 / +46 lines)
Lines 1-6 Link Here
1
--- gdb/amd64fbsd-nat.c.orig	2012-02-09 17:06:44.000000000 +0100
1
--- gdb/amd64fbsd-nat.c.orig	2014-06-11 18:34:41.000000000 +0200
2
+++ gdb/amd64fbsd-nat.c	2012-08-30 10:58:55.000000000 +0200
2
+++ gdb/amd64fbsd-nat.c	2014-09-24 18:27:50.618458853 +0200
3
@@ -21,11 +21,13 @@
3
@@ -21,13 +21,17 @@
4
 #include "inferior.h"
4
 #include "inferior.h"
5
 #include "regcache.h"
5
 #include "regcache.h"
6
 #include "target.h"
6
 #include "target.h"
Lines 13-20 Link Here
13
+#include <sys/procfs.h>
13
+#include <sys/procfs.h>
14
 #include <sys/ptrace.h>
14
 #include <sys/ptrace.h>
15
 #include <sys/sysctl.h>
15
 #include <sys/sysctl.h>
16
+#include <sys/user.h>
17
+#include <sys/param.h>
16
 #include <machine/reg.h>
18
 #include <machine/reg.h>
17
@@ -93,6 +95,46 @@
19
 
20
 #include "fbsd-nat.h"
21
@@ -93,6 +97,46 @@
18
 };
22
 };
19
 
23
 
20
 
24
 
Lines 60-63 Link Here
60
+
64
+
61
 /* Support for debugging kernel virtual memory images.  */
65
 /* Support for debugging kernel virtual memory images.  */
62
 
66
 
63
 #include <sys/types.h>
67
 #include <machine/pcb.h>
68
@@ -247,6 +291,10 @@
69
 
70
   SC_RBP_OFFSET = offset;
71
 
72
+// Newer versions of FreeBSD provide a better way to locate the signtramp
73
+#if ( __FreeBSD_version/100000 < 9 ) \
74
+	|| ( ( __FreeBSD_version/100000 == 9 ) && ( __FreeBSD_version < 902505 ) ) \
75
+	|| ( ( __FreeBSD_version/100000 == 10 ) && ( __FreeBSD_version < 1000700 ) )
76
   /* FreeBSD provides a kern.ps_strings sysctl that we can use to
77
      locate the sigtramp.  That way we can still recognize a sigtramp
78
      if its location is changed in a new kernel.  Of course this is
79
@@ -267,4 +315,25 @@
80
 	amd64fbsd_sigtramp_end_addr = ps_strings;
81
       }
82
   }
83
+#else
84
+  /* FreeBSD provides a kern.proc.sigtramp sysctl that we can use to
85
+     locate the sigtramp.  That way we can still recognize a sigtramp
86
+     if its location is changed in a new kernel. */
87
+  {
88
+    int mib[4];
89
+    struct kinfo_sigtramp kst;
90
+    size_t len;
91
+
92
+    mib[0] = CTL_KERN;
93
+    mib[1] = KERN_PROC;
94
+    mib[2] = KERN_PROC_SIGTRAMP;
95
+    mib[3] = getpid();
96
+    len = sizeof (kst);
97
+    if (sysctl (mib, sizeof(mib)/sizeof(mib[0]), &kst, &len, NULL, 0) == 0)
98
+      {
99
+	amd64fbsd_sigtramp_start_addr = kst.ksigtramp_start;
100
+	amd64fbsd_sigtramp_end_addr = kst.ksigtramp_end;
101
+      }
102
+  }
103
+#endif
104
 }
(-)files/patch-gdb-configure (-4 / +17 lines)
Lines 1-6 Link Here
1
--- gdb/configure.orig	2012-08-24 14:03:52.000000000 +0200
1
--- gdb/configure.orig	2014-07-29 14:37:42.000000000 +0200
2
+++ gdb/configure	2012-08-24 14:05:06.000000000 +0200
2
+++ gdb/configure	2014-10-01 14:21:14.902231511 +0200
3
@@ -10590,7 +10590,8 @@
3
@@ -11485,7 +11485,8 @@
4
 
4
 
5
 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
5
 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
6
 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
6
 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
Lines 10-16 Link Here
10
 "
10
 "
11
 if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then :
11
 if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then :
12
 
12
 
13
@@ -10600,7 +10601,8 @@
13
@@ -11495,7 +11496,8 @@
14
 
14
 
15
 
15
 
16
 fi
16
 fi
Lines 20-22 Link Here
20
 "
20
 "
21
 if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then :
21
 if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then :
22
 
22
 
23
@@ -13007,10 +13009,9 @@
24
 
25
 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
26
 -Wpointer-sign \
27
--Wno-unused -Wunused-value -Wunused-function \
28
+-Wno-unused -Wunused-value \
29
 -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
30
--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
31
--Wold-style-declaration -Wold-style-definition"
32
+-Wdeclaration-after-statement -Wempty-body -Wold-style-definition"
33
 
34
 # Enable -Wno-format by default when using gcc on mingw since many
35
 # GCC versions complain about %I64.

Return to bug 194190