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

(-)Makefile (-2 / +12 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	gdb
4
PORTNAME=	gdb
5
PORTVERSION=	7.11.1
5
PORTVERSION=	7.11.1
6
PORTREVISION=	2
6
PORTREVISION=	3
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	GNU
8
MASTER_SITES=	GNU
9
9
Lines 43-49 Link Here
43
		${FILESDIR}/commit-bb2a62e \
43
		${FILESDIR}/commit-bb2a62e \
44
		${FILESDIR}/commit-8607ea6 \
44
		${FILESDIR}/commit-8607ea6 \
45
		${FILESDIR}/commit-2c5c2a3 \
45
		${FILESDIR}/commit-2c5c2a3 \
46
		${FILESDIR}/commit-ee95032
46
		${FILESDIR}/commit-ee95032 \
47
		${FILESDIR}/commit-bc7b765 \
48
		${FILESDIR}/commit-0064d22 \
49
		${FILESDIR}/commit-da95a26 \
50
		${FILESDIR}/commit-5fa14c6 \
51
		${FILESDIR}/commit-dbaed38
47
52
48
VER=		${PORTVERSION:S/.//g}
53
VER=		${PORTVERSION:S/.//g}
49
PLIST_SUB=	VER=${VER}
54
PLIST_SUB=	VER=${VER}
Lines 84-89 Link Here
84
89
85
.include <bsd.port.options.mk>
90
.include <bsd.port.options.mk>
86
91
92
.if ${OSVERSION} < 1000010
93
# FreeBSD 9.x and earlier do not define SIGLIBRT in <sys/signal.h>
94
CFLAGS+=	-DSIGLIBRT=33
95
.endif
96
87
.if ! ${PORT_OPTIONS:MBUNDLED_READLINE}
97
.if ! ${PORT_OPTIONS:MBUNDLED_READLINE}
88
EXCLUDE+=	readline
98
EXCLUDE+=	readline
89
.endif
99
.endif
(-)files/commit-0064d22 (+83 lines)
Line 0 Link Here
1
commit 0064d22386b99c047bbff3bcc73b6bfce9c29b4c
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Mon Jul 4 19:19:48 2016 -0700
4
5
    Handle version 1a of FreeBSD's NT_PRSINFO.
6
    
7
    Version 1a adds a pr_pid member containing the process ID of the
8
    terminating process.  The presence of pr_pid is inferred from the
9
    note's size.
10
    
11
    bfd/ChangeLog:
12
    
13
    	* elf.c (elfcore_grok_freebsd_psinfo): Check for minimum note size
14
    	and handle pr_pid if present.
15
16
diff --git bfd/elf.c bfd/elf.c
17
index 2cc64e8..ba1774e 100644
18
--- bfd/elf.c
19
+++ bfd/elf.c
20
@@ -9590,27 +9590,36 @@ elfcore_grok_freebsd_psinfo (bfd *abfd, Elf_Internal_Note *note)
21
 {
22
   size_t offset;
23
 
24
-  /* Check for version 1 in pr_version. */
25
-  if (bfd_h_get_32 (abfd, (bfd_byte *) note->descdata) != 1)
26
-    return FALSE;
27
-  offset = 4;
28
-
29
-  /* Skip over pr_psinfosz. */
30
   switch (abfd->arch_info->bits_per_word)
31
     {
32
     case 32:
33
-      offset += 4;
34
+      if (note->descsz < 108)
35
+	return FALSE;
36
       break;
37
 
38
     case 64:
39
-      offset += 4;	/* Padding before pr_psinfosz. */
40
-      offset += 8;
41
+      if (note->descsz < 120)
42
+	return FALSE;
43
       break;
44
 
45
     default:
46
       return FALSE;
47
     }
48
 
49
+  /* Check for version 1 in pr_version.  */
50
+  if (bfd_h_get_32 (abfd, (bfd_byte *) note->descdata) != 1)
51
+    return FALSE;
52
+  offset = 4;
53
+
54
+  /* Skip over pr_psinfosz. */
55
+  if (abfd->arch_info->bits_per_word == 32)
56
+    offset += 4;
57
+  else
58
+    {
59
+      offset += 4;	/* Padding before pr_psinfosz. */
60
+      offset += 8;
61
+    }
62
+
63
   /* pr_fname is PRFNAMESZ (16) + 1 bytes in size.  */
64
   elf_tdata (abfd)->core->program
65
     = _bfd_elfcore_strndup (abfd, note->descdata + offset, 17);
66
@@ -9619,6 +9628,17 @@ elfcore_grok_freebsd_psinfo (bfd *abfd, Elf_Internal_Note *note)
67
   /* pr_psargs is PRARGSZ (80) + 1 bytes in size.  */
68
   elf_tdata (abfd)->core->command
69
     = _bfd_elfcore_strndup (abfd, note->descdata + offset, 81);
70
+  offset += 81;
71
+
72
+  /* Padding before pr_pid.  */
73
+  offset += 2;
74
+
75
+  /* The pr_pid field was added in version "1a".  */
76
+  if (note->descsz < offset + 4)
77
+    return TRUE;
78
+
79
+  elf_tdata (abfd)->core->pid
80
+    = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + offset);
81
 
82
   return TRUE;
83
 }
(-)files/commit-5fa14c6 (+30 lines)
Line 0 Link Here
1
commit 5fa14c6b9789bad6f91dd21889f7b1a0eb75c6d0
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jul 15 17:01:21 2016 -0700
4
5
    Enable ptrace events on new child processes.
6
    
7
    New child processes on FreeBSD do not inherit optional ptrace events
8
    such as fork and LWP events from the parent process.  Instead,
9
    explicitly enable events on new children when reporting a fork
10
    event.
11
    
12
    gdb/ChangeLog:
13
    
14
    	* fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on
15
    	new child processes.
16
17
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
18
index 508ab19..5e4304e 100644
19
--- gdb/fbsd-nat.c
20
+++ gdb/fbsd-nat.c
21
@@ -836,6 +836,9 @@ fbsd_wait (struct target_ops *ops,
22
 		  child_ptid = ptid_build (child, pl.pl_lwpid, 0);
23
 		}
24
 
25
+	      /* Enable additional events on the child process.  */
26
+	      fbsd_enable_proc_events (ptid_get_pid (child_ptid));
27
+
28
 	      /* For vfork, the child process will have the P_PPWAIT
29
 		 flag set.  */
30
 	      fbsd_fetch_kinfo_proc (child, &kp);
(-)files/commit-bc7b765 (+102 lines)
Line 0 Link Here
1
commit bc7b765ab71f967eb2a9c3da111d7529eec46fbe
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sun Jul 3 11:56:21 2016 -0700
4
5
    Pass SIGLIBRT directly to child processes.
6
    
7
    FreeBSD's librt uses SIGLIBRT as an internal signal to implement
8
    SIGEV_THREAD sigevent notifications.  Similar to SIGLWP or SIGCANCEL
9
    this signal should be passed through to child processes by default.
10
    
11
    include/ChangeLog:
12
    
13
    	* signals.def: Add GDB_SIGNAL_LIBRT.
14
    
15
    gdb/ChangeLog:
16
    
17
    	* common/signals.c (gdb_signal_from_host): Handle SIGLIBRT.
18
    	(do_gdb_signal_to_host): Likewise.
19
    	* infrun.c (_initialize_infrun): Pass GDB_SIGNAL_LIBRT through to
20
    	programs.
21
    	* proc-events.c (signal_table): Add entry for SIGLIBRT.
22
23
diff --git gdb/common/signals.c gdb/common/signals.c
24
index 45c0c73..f84935d 100644
25
--- gdb/common/signals.c
26
+++ gdb/common/signals.c
27
@@ -331,6 +331,10 @@ gdb_signal_from_host (int hostsig)
28
   if (hostsig == SIGINFO)
29
     return GDB_SIGNAL_INFO;
30
 #endif
31
+#if defined (SIGLIBRT)
32
+  if (hostsig == SIGLIBRT)
33
+    return GDB_SIGNAL_LIBRT;
34
+#endif
35
 
36
 #if defined (REALTIME_LO)
37
   if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
38
@@ -584,6 +588,10 @@ do_gdb_signal_to_host (enum gdb_signal oursig,
39
     case GDB_SIGNAL_INFO:
40
       return SIGINFO;
41
 #endif
42
+#if defined (SIGLIBRT)
43
+    case GDB_SIGNAL_LIBRT:
44
+      return SIGLIBRT;
45
+#endif
46
 
47
     default:
48
 #if defined (REALTIME_LO)
49
diff --git gdb/infrun.c gdb/infrun.c
50
index 70a0790..257ac8a 100644
51
--- gdb/infrun.c
52
+++ gdb/infrun.c
53
@@ -9409,6 +9409,8 @@ leave it stopped or free to run as needed."),
54
   signal_print[GDB_SIGNAL_WAITING] = 0;
55
   signal_stop[GDB_SIGNAL_CANCEL] = 0;
56
   signal_print[GDB_SIGNAL_CANCEL] = 0;
57
+  signal_stop[GDB_SIGNAL_LIBRT] = 0;
58
+  signal_print[GDB_SIGNAL_LIBRT] = 0;
59
 
60
   /* Update cached state.  */
61
   signal_cache_update (-1);
62
diff --git gdb/proc-events.c gdb/proc-events.c
63
index b291d31..daa6f58 100644
64
--- gdb/proc-events.c
65
+++ gdb/proc-events.c
66
@@ -1536,6 +1536,9 @@ static struct trans signal_table[] =
67
 #ifdef SIGAIO
68
   { SIGAIO, "SIGAIO", "Asynchronous I/O signal" },
69
 #endif
70
+#ifdef SIGLIBRT
71
+  { SIGLIBRT, "SIGLIBRT", "Used by librt" },
72
+#endif
73
 
74
   /* FIXME: add real-time signals.  */
75
 };
76
diff --git include/gdb/ChangeLog include/gdb/ChangeLog
77
index f05ba4b..05f127e 100644
78
--- include/gdb/ChangeLog
79
+++ include/gdb/ChangeLog
80
@@ -1,3 +1,7 @@
81
+2016-07-15  John Baldwin  <jhb@FreeBSD.org>
82
+
83
+	* signals.def: Add GDB_SIGNAL_LIBRT.
84
+
85
 2016-01-06  Mike Frysinger  <vapier@gentoo.org>
86
 
87
 	* remote-sim.h (sim_open): Mark argv const.
88
diff --git include/gdb/signals.def include/gdb/signals.def
89
index 61cc88c..2b30e71 100644
90
--- include/gdb/signals.def
91
+++ include/gdb/signals.def
92
@@ -194,7 +194,9 @@ SET (GDB_EXC_EMULATION, 148, "EXC_EMULATION", "Emulation instruction")
93
 SET (GDB_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception")
94
 SET (GDB_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
95
 
96
+SET (GDB_SIGNAL_LIBRT, 151, "SIGLIBRT", "librt internal signal")
97
+
98
 /* If you are adding a new signal, add it just above this comment.  */
99
 
100
 /* Last and unused enum value, for sizing arrays, etc.  */
101
-SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_LAST")
102
+SET (GDB_SIGNAL_LAST, 152, NULL, "GDB_SIGNAL_LAST")
(-)files/commit-da95a26 (+123 lines)
Line 0 Link Here
1
commit da95a26cc381c0f092f515ffe108075985c16d7f
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jul 15 14:03:10 2016 -0700
4
5
    Consolidate code to enable optional FreeBSD native target event reporting.
6
    
7
    Add a new function to enable optional event reporting for FreeBSD native
8
    targets.  Specifically, use this to enable fork and LWP events.
9
    The bodies of fbsd_enable_follow_fork and fbsd_enable_lwp_events have been
10
    subsumed into the new function.  In addition, use the PT_GET_EVENT_MASK
11
    and PT_EVENT_SET_MASK requests added in FreeBSD 12 when present to enable
12
    these events.
13
    
14
    gdb/ChangeLog:
15
    
16
    	* fbsd-nat.c (fbsd_enable_lwp_events): Remove function.
17
    	(fbsd_enable_proc_events): New function.
18
    	(fbsd_enable_follow_fork): Remove function.
19
    	(fbsd_post_startup_inferior): Use "fbsd_enable_proc_events".
20
    	(fbsd_post_attach): Likewise.
21
22
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
23
index fa9516e..508ab19 100644
24
--- gdb/fbsd-nat.c
25
+++ gdb/fbsd-nat.c
26
@@ -412,22 +412,43 @@ fbsd_thread_name (struct target_ops *self, struct thread_info *thr)
27
 }
28
 #endif
29
 
30
-#ifdef PT_LWP_EVENTS
31
-/* Enable LWP events for a specific process.
32
+/* Enable additional event reporting on new processes.
33
 
34
-   To catch LWP events, PT_LWP_EVENTS is set on every traced process.
35
+   To catch fork events, PTRACE_FORK is set on every traced process
36
+   to enable stops on returns from fork or vfork.  Note that both the
37
+   parent and child will always stop, even if system call stops are
38
+   not enabled.
39
+
40
+   To catch LWP events, PTRACE_EVENTS is set on every traced process.
41
    This enables stops on the birth for new LWPs (excluding the "main" LWP)
42
    and the death of LWPs (excluding the last LWP in a process).  Note
43
    that unlike fork events, the LWP that creates a new LWP does not
44
    report an event.  */
45
 
46
 static void
47
-fbsd_enable_lwp_events (pid_t pid)
48
+fbsd_enable_proc_events (pid_t pid)
49
 {
50
+#ifdef PT_GET_EVENT_MASK
51
+  int events;
52
+
53
+  if (ptrace (PT_GET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3)&events,
54
+	      sizeof (events)) == -1)
55
+    perror_with_name (("ptrace"));
56
+  events |= PTRACE_FORK | PTRACE_LWP;
57
+  if (ptrace (PT_SET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3)&events,
58
+	      sizeof (events)) == -1)
59
+    perror_with_name (("ptrace"));
60
+#else
61
+#ifdef TDP_RFPPWAIT
62
+  if (ptrace (PT_FOLLOW_FORK, pid, (PTRACE_TYPE_ARG3)0, 1) == -1)
63
+    perror_with_name (("ptrace"));
64
+#endif
65
+#ifdef PT_LWP_EVENTS
66
   if (ptrace (PT_LWP_EVENTS, pid, (PTRACE_TYPE_ARG3)0, 1) == -1)
67
     perror_with_name (("ptrace"));
68
-}
69
 #endif
70
+#endif
71
+}
72
 
73
 /* Add threads for any new LWPs in a process.
74
 
75
@@ -957,20 +978,6 @@ fbsd_remove_vfork_catchpoint (struct target_ops *self, int pid)
76
 {
77
   return 0;
78
 }
79
-
80
-/* Enable fork tracing for a specific process.
81
-   
82
-   To catch fork events, PT_FOLLOW_FORK is set on every traced process
83
-   to enable stops on returns from fork or vfork.  Note that both the
84
-   parent and child will always stop, even if system call stops are
85
-   not enabled.  */
86
-
87
-static void
88
-fbsd_enable_follow_fork (pid_t pid)
89
-{
90
-  if (ptrace (PT_FOLLOW_FORK, pid, (PTRACE_TYPE_ARG3)0, 1) == -1)
91
-    perror_with_name (("ptrace"));
92
-}
93
 #endif
94
 
95
 /* Implement the "to_post_startup_inferior" target_ops method.  */
96
@@ -978,12 +985,7 @@ fbsd_enable_follow_fork (pid_t pid)
97
 static void
98
 fbsd_post_startup_inferior (struct target_ops *self, ptid_t pid)
99
 {
100
-#ifdef TDP_RFPPWAIT
101
-  fbsd_enable_follow_fork (ptid_get_pid (pid));
102
-#endif
103
-#ifdef PT_LWP_EVENTS
104
-  fbsd_enable_lwp_events (ptid_get_pid (pid));
105
-#endif
106
+  fbsd_enable_proc_events (ptid_get_pid (pid));
107
 }
108
 
109
 /* Implement the "to_post_attach" target_ops method.  */
110
@@ -991,12 +993,7 @@ fbsd_post_startup_inferior (struct target_ops *self, ptid_t pid)
111
 static void
112
 fbsd_post_attach (struct target_ops *self, int pid)
113
 {
114
-#ifdef TDP_RFPPWAIT
115
-  fbsd_enable_follow_fork (pid);
116
-#endif
117
-#ifdef PT_LWP_EVENTS
118
-  fbsd_enable_lwp_events (pid);
119
-#endif
120
+  fbsd_enable_proc_events (pid);
121
   fbsd_add_threads (pid);
122
 }
123
 
(-)files/commit-dbaed38 (+157 lines)
Line 0 Link Here
1
commit dbaed3853474e7bd824a25bc454a8f2fdd71d2b3
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sat Jul 16 10:14:08 2016 -0700
4
5
    Use a real vfork done event on FreeBSD when available.
6
    
7
    FreeBSD 12 recently added a new ptrace event to indicate when the vfork
8
    parent resumes after the child process stops sharing the address space.
9
    Use this event to report a proper TARGET_WAITKIND_VFORK_DONE rather than
10
    faking a vfork done event after a delay.
11
    
12
    gdb/ChangeLog:
13
    
14
    	* fbsd-nat.c (fbsd_enable_proc_events): Enable "PTRACE_VFORK"
15
    	events.
16
    	(fbsd_pending_vfork_done): Only define if "PTRACE_VFORK" is not
17
    	defined.
18
    	(fbsd_add_vfork_done): Likewise.
19
    	(fbsd_is_vfork_done_pending): Likewise.
20
    	(fbsd_next_vfork_done): Likewise.
21
    	(fbsd_resume): Only ignore pending vfork done events if
22
    	"PTRACE_VFORK" is not defined.
23
    	(fbsd_wait): Only look for pending vfork done events if
24
    	"PTRACE_VFORK" is not defined.
25
    	[PTRACE_VFORK]: Handle "PL_FLAG_VFORKED" and "PL_FLAG_VFORK_DONE"
26
    	events.
27
    	(fbsd_follow_fork): Only fake a vfork done event if "PTRACE_VFORK"
28
    	is not defined.
29
30
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
31
index 5e4304e..ade62f1 100644
32
--- gdb/fbsd-nat.c
33
+++ gdb/fbsd-nat.c
34
@@ -435,6 +435,9 @@ fbsd_enable_proc_events (pid_t pid)
35
 	      sizeof (events)) == -1)
36
     perror_with_name (("ptrace"));
37
   events |= PTRACE_FORK | PTRACE_LWP;
38
+#ifdef PTRACE_VFORK
39
+  events |= PTRACE_VFORK;
40
+#endif
41
   if (ptrace (PT_SET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3)&events,
42
 	      sizeof (events)) == -1)
43
     perror_with_name (("ptrace"));
44
@@ -598,6 +601,7 @@ fbsd_is_child_pending (pid_t pid)
45
   return null_ptid;
46
 }
47
 
48
+#ifndef PTRACE_VFORK
49
 static struct fbsd_fork_info *fbsd_pending_vfork_done;
50
 
51
 /* Record a pending vfork done event.  */
52
@@ -647,6 +651,7 @@ fbsd_next_vfork_done (void)
53
   return null_ptid;
54
 }
55
 #endif
56
+#endif
57
 
58
 static int
59
 resume_one_thread_cb (struct thread_info *tp, void *data)
60
@@ -686,7 +691,7 @@ static void
61
 fbsd_resume (struct target_ops *ops,
62
 	     ptid_t ptid, int step, enum gdb_signal signo)
63
 {
64
-#ifdef TDP_RFPPWAIT
65
+#if defined(TDP_RFPPWAIT) && !defined(PTRACE_VFORK)
66
   pid_t pid;
67
 
68
   /* Don't PT_CONTINUE a process which has a pending vfork done event.  */
69
@@ -731,12 +736,14 @@ fbsd_wait (struct target_ops *ops,
70
 
71
   while (1)
72
     {
73
+#ifndef PTRACE_VFORK
74
       wptid = fbsd_next_vfork_done ();
75
       if (!ptid_equal (wptid, null_ptid))
76
 	{
77
 	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
78
 	  return wptid;
79
 	}
80
+#endif
81
       wptid = super_wait (ops, ptid, ourstatus, target_options);
82
       if (ourstatus->kind == TARGET_WAITKIND_STOPPED)
83
 	{
84
@@ -812,12 +819,18 @@ fbsd_wait (struct target_ops *ops,
85
 #ifdef TDP_RFPPWAIT
86
 	  if (pl.pl_flags & PL_FLAG_FORKED)
87
 	    {
88
+#ifndef PTRACE_VFORK
89
 	      struct kinfo_proc kp;
90
+#endif
91
 	      ptid_t child_ptid;
92
 	      pid_t child;
93
 
94
 	      child = pl.pl_child_pid;
95
 	      ourstatus->kind = TARGET_WAITKIND_FORKED;
96
+#ifdef PTRACE_VFORK
97
+	      if (pl.pl_flags & PL_FLAG_VFORKED)
98
+		ourstatus->kind = TARGET_WAITKIND_VFORKED;
99
+#endif
100
 
101
 	      /* Make sure the other end of the fork is stopped too.  */
102
 	      child_ptid = fbsd_is_child_pending (child);
103
@@ -839,11 +852,13 @@ fbsd_wait (struct target_ops *ops,
104
 	      /* Enable additional events on the child process.  */
105
 	      fbsd_enable_proc_events (ptid_get_pid (child_ptid));
106
 
107
+#ifndef PTRACE_VFORK
108
 	      /* For vfork, the child process will have the P_PPWAIT
109
 		 flag set.  */
110
 	      fbsd_fetch_kinfo_proc (child, &kp);
111
 	      if (kp.ki_flag & P_PPWAIT)
112
 		ourstatus->kind = TARGET_WAITKIND_VFORKED;
113
+#endif
114
 	      ourstatus->value.related_pid = child_ptid;
115
 
116
 	      return wptid;
117
@@ -857,6 +872,14 @@ fbsd_wait (struct target_ops *ops,
118
 	      fbsd_remember_child (wptid);
119
 	      continue;
120
 	    }
121
+
122
+#ifdef PTRACE_VFORK
123
+	  if (pl.pl_flags & PL_FLAG_VFORK_DONE)
124
+	    {
125
+	      ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
126
+	      return wptid;
127
+	    }
128
+#endif
129
 #endif
130
 
131
 #ifdef PL_FLAG_EXEC
132
@@ -918,7 +941,6 @@ fbsd_follow_fork (struct target_ops *ops, int follow_child,
133
   if (!follow_child && detach_fork)
134
     {
135
       struct thread_info *tp = inferior_thread ();
136
-      int has_vforked = tp->pending_follow.kind == TARGET_WAITKIND_VFORKED;
137
       pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid);
138
 
139
       /* Breakpoints have already been detached from the child by
140
@@ -927,7 +949,8 @@ fbsd_follow_fork (struct target_ops *ops, int follow_child,
141
       if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3)1, 0) == -1)
142
 	perror_with_name (("ptrace"));
143
 
144
-      if (has_vforked)
145
+#ifndef PTRACE_VFORK
146
+      if (tp->pending_follow.kind == TARGET_WAITKIND_VFORKED)
147
 	{
148
 	  /* We can't insert breakpoints until the child process has
149
 	     finished with the shared memory region.  The parent
150
@@ -953,6 +976,7 @@ fbsd_follow_fork (struct target_ops *ops, int follow_child,
151
 	     wait.  */
152
 	  fbsd_add_vfork_done (inferior_ptid);
153
 	}
154
+#endif
155
     }
156
 
157
   return 0;
(-)files/patch-sigev (-65 lines)
Lines 1-65 Link Here
1
diff --git gdb/common/signals.c gdb/common/signals.c
2
index d4cf953..019371e 100644
3
--- gdb/common/signals.c
4
+++ gdb/common/signals.c
5
@@ -41,6 +41,12 @@ struct gdbarch;
6
 # endif
7
 #endif
8
 
9
+#ifdef __FreeBSD__
10
+# ifndef SIGLIBRT
11
+#  define SIGLIBRT 33 /* Older versions do not define the constant */
12
+# endif
13
+#endif
14
+
15
 /* This table must match in order and size the signals in enum
16
    gdb_signal.  */
17
 
18
@@ -332,6 +338,11 @@ gdb_signal_from_host (int hostsig)
19
     return GDB_SIGNAL_INFO;
20
 #endif
21
 
22
+#if defined (SIGLIBRT)
23
+  if ( hostsig == SIGLIBRT )
24
+    return GDB_SIGNAL_FBSD_LIBRT;
25
+#endif
26
+
27
 #if defined (REALTIME_LO)
28
   if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
29
     {
30
@@ -585,6 +596,11 @@ do_gdb_signal_to_host (enum gdb_signal oursig,
31
       return SIGINFO;
32
 #endif
33
 
34
+#if defined (SIGLIBRT)
35
+    case GDB_SIGNAL_FBSD_LIBRT:
36
+      return SIGLIBRT;
37
+#endif
38
+
39
     default:
40
 #if defined (REALTIME_LO)
41
       retsig = 0;
42
diff --git gdb/infrun.c gdb/infrun.c
43
index 11dcc0e..6ec4d0b 100644
44
--- gdb/infrun.c
45
+++ gdb/infrun.c
46
@@ -7715,6 +7715,8 @@ leave it stopped or free to run as needed."),
47
   signal_print[GDB_SIGNAL_WINCH] = 0;
48
   signal_stop[GDB_SIGNAL_PRIO] = 0;
49
   signal_print[GDB_SIGNAL_PRIO] = 0;
50
+  signal_stop[GDB_SIGNAL_FBSD_LIBRT] = 0;
51
+  signal_print[GDB_SIGNAL_FBSD_LIBRT] = 0;
52
 
53
   /* These signals are used internally by user-level thread
54
      implementations.  (See signal(5) on Solaris.)  Like the above
55
diff --git include/gdb/signals.def include/gdb/signals.def
56
index 3f49980..857c69d 100644
57
--- include/gdb/signals.def
58
+++ include/gdb/signals.def
59
@@ -197,4 +197,5 @@ SET (GDB_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
60
 /* If you are adding a new signal, add it just above this comment.  */
61
 
62
 /* Last and unused enum value, for sizing arrays, etc.  */
63
-SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_LAST")
64
+SET (GDB_SIGNAL_FBSD_LIBRT, 151, "SIGLIBRT", "GDB_SIGNAL_FBSD_LIBRT")
65
+SET (GDB_SIGNAL_LAST, 152, NULL, "GDB_SIGNAL_MAGIC")

Return to bug 211254