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

(-)Makefile (-2 / +20 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=	1
6
PORTREVISION=	2
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	GNU
8
MASTER_SITES=	GNU
9
9
Lines 30-35 Link Here
30
CFLAGS+=	-DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable
30
CFLAGS+=	-DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable
31
EXCLUDE=	dejagnu expect sim texinfo intl
31
EXCLUDE=	dejagnu expect sim texinfo intl
32
EXTRACT_AFTER_ARGS=	${EXCLUDE:S/^/--exclude /}
32
EXTRACT_AFTER_ARGS=	${EXCLUDE:S/^/--exclude /}
33
EXTRA_PATCHES=	${FILESDIR}/commit-21002a6 \
34
		${FILESDIR}/commit-b00f86d \
35
		${FILESDIR}/commit-aa1ed4a \
36
		${FILESDIR}/commit-7697fc9 \
37
		${FILESDIR}/commit-3350c5f \
38
		${FILESDIR}/commit-2faa344 \
39
		${FILESDIR}/commit-82372b2 \
40
		${FILESDIR}/commit-e6cdd38 \
41
		${FILESDIR}/commit-a3405d1 \
42
		${FILESDIR}/commit-5077bff \
43
		${FILESDIR}/commit-bb2a62e \
44
		${FILESDIR}/commit-8607ea6 \
45
		${FILESDIR}/commit-2c5c2a3 \
46
		${FILESDIR}/commit-ee95032
33
47
34
VER=		${PORTVERSION:S/.//g}
48
VER=		${PORTVERSION:S/.//g}
35
PLIST_SUB=	VER=${VER}
49
PLIST_SUB=	VER=${VER}
Lines 38-44 Link Here
38
52
39
OPTIONS_DEFINE=	DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON TUI
53
OPTIONS_DEFINE=	DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON TUI
40
54
41
OPTIONS_DEFAULT=	GDB_LINK KGDB PYTHON TUI PORT_READLINE
55
OPTIONS_DEFAULT=	EXPAT GDB_LINK KGDB PYTHON TUI PORT_READLINE
42
56
43
OPTIONS_SINGLE=	READLINE
57
OPTIONS_SINGLE=	READLINE
44
OPTIONS_SINGLE_READLINE=	BASE_READLINE BUNDLED_READLINE PORT_READLINE
58
OPTIONS_SINGLE_READLINE=	BASE_READLINE BUNDLED_READLINE PORT_READLINE
Lines 99-104 Link Here
99
do-install-TUI-on:
113
do-install-TUI-on:
100
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
114
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
101
115
116
do-install-EXPAT-on:
117
	(cd ${WRKSRC}/gdb/data-directory ; \
118
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-syscalls )
119
102
do-install-GDB_LINK-on:
120
do-install-GDB_LINK-on:
103
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb
121
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb
104
.if ${PORT_OPTIONS:MKGDB}
122
.if ${PORT_OPTIONS:MKGDB}
(-)files/commit-21002a6 (+102 lines)
Line 0 Link Here
1
commit 21002a635bf3da33367592e3a3ab3cce24fe5299
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Tue Jan 19 11:02:09 2016 -0800
4
5
    Handle void * conversions in FreeBSD/x86 native code to fix C++ build.
6
    
7
    gdb/ChangeLog:
8
    
9
    	* amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Change xstateregs
10
    	to void *.
11
    	(amd64bsd_store_inferior_registers): Likewise.
12
    	* fbsd-nat.c (resume_one_thread_cb): Explicitly cast data to ptid_t *.
13
    	(resume_all_threads_cb): Likewise.
14
    	* i386bsd-nat.c (i386bsd_supply_gregset): Cast gregs to char *.
15
    	(i386bsd_collect_gregset): Likewise.
16
    	(i386bsd_fetch_inferior_registers): Change xstateregs to void *.
17
    	(i386bsd_store_inferior_registers): Likewise.
18
19
diff --git gdb/amd64bsd-nat.c gdb/amd64bsd-nat.c
20
index fb7e4fa..e278a91 100644
21
--- gdb/amd64bsd-nat.c
22
+++ gdb/amd64bsd-nat.c
23
@@ -65,7 +65,7 @@ amd64bsd_fetch_inferior_registers (struct target_ops *ops,
24
     {
25
       struct fpreg fpregs;
26
 #ifdef PT_GETXSTATE_INFO
27
-      char *xstateregs;
28
+      void *xstateregs;
29
 
30
       if (amd64bsd_xsave_len != 0)
31
 	{
32
@@ -118,7 +118,7 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
33
     {
34
       struct fpreg fpregs;
35
 #ifdef PT_GETXSTATE_INFO
36
-      char *xstateregs;
37
+      void *xstateregs;
38
 
39
       if (amd64bsd_xsave_len != 0)
40
 	{
41
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
42
index bdf078e..b582abe 100644
43
--- gdb/fbsd-nat.c
44
+++ gdb/fbsd-nat.c
45
@@ -428,7 +428,7 @@ static void (*super_resume) (struct target_ops *,
46
 static int
47
 resume_one_thread_cb (struct thread_info *tp, void *data)
48
 {
49
-  ptid_t *ptid = data;
50
+  ptid_t *ptid = (ptid_t *) data;
51
   int request;
52
 
53
   if (ptid_get_pid (tp->ptid) != ptid_get_pid (*ptid))
54
@@ -447,7 +447,7 @@ resume_one_thread_cb (struct thread_info *tp, void *data)
55
 static int
56
 resume_all_threads_cb (struct thread_info *tp, void *data)
57
 {
58
-  ptid_t *filter = data;
59
+  ptid_t *filter = (ptid_t *) data;
60
 
61
   if (!ptid_match (tp->ptid, *filter))
62
     return 0;
63
diff --git gdb/i386bsd-nat.c gdb/i386bsd-nat.c
64
index 5d45c33..f5f4a0f 100644
65
--- gdb/i386bsd-nat.c
66
+++ gdb/i386bsd-nat.c
67
@@ -92,7 +92,7 @@ size_t i386bsd_xsave_len;
68
 static void
69
 i386bsd_supply_gregset (struct regcache *regcache, const void *gregs)
70
 {
71
-  const char *regs = gregs;
72
+  const char *regs = (const char *) gregs;
73
   int regnum;
74
 
75
   for (regnum = 0; regnum < ARRAY_SIZE (i386bsd_r_reg_offset); regnum++)
76
@@ -112,7 +112,7 @@ static void
77
 i386bsd_collect_gregset (const struct regcache *regcache,
78
 			 void *gregs, int regnum)
79
 {
80
-  char *regs = gregs;
81
+  char *regs = (char *) gregs;
82
   int i;
83
 
84
   for (i = 0; i < ARRAY_SIZE (i386bsd_r_reg_offset); i++)
85
@@ -157,7 +157,7 @@ i386bsd_fetch_inferior_registers (struct target_ops *ops,
86
 #ifdef PT_GETXSTATE_INFO
87
       if (i386bsd_xsave_len != 0)
88
 	{
89
-	  char *xstateregs;
90
+	  void *xstateregs;
91
 
92
 	  xstateregs = alloca (i386bsd_xsave_len);
93
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
94
@@ -227,7 +227,7 @@ i386bsd_store_inferior_registers (struct target_ops *ops,
95
 #ifdef PT_GETXSTATE_INFO
96
       if (i386bsd_xsave_len != 0)
97
 	{
98
-	  char *xstateregs;
99
+	  void *xstateregs;
100
 
101
 	  xstateregs = alloca (i386bsd_xsave_len);
102
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
(-)files/commit-2c5c2a3 (+214 lines)
Line 0 Link Here
1
commit 2c5c2a3321706c28cbf1b85a970a2e32912eb0c8
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jun 24 21:00:04 2016 -0700
4
5
    Fake VFORK_DONE events when following only the parent after a vfork.
6
    
7
    FreeBSD does not currently report a ptrace event for a parent process
8
    after it resumes due to the child exiting the shared memory region after
9
    a vfork.  Take the same approach used in linux-nat.c in this case of
10
    sleeping for a while and then reporting a fake VFORK_DONE event.
11
    
12
    gdb/ChangeLog:
13
    
14
    	* fbsd-nat.c (struct fbsd_fork_child_info): Rename to ...
15
    	(struct fbsd_fork_info): ... this.
16
    	(struct fbsd_fork_info) <child>: Rename to ...
17
    	(struct fbsd_fork_info) <ptid>: ... this.
18
    	(fbsd_pending_children): Update type.
19
    	(fbsd_remember_child): Update type and field name.
20
    	(fbsd_is_child_pending): Likewise.
21
    	(fbsd_pending_vfork_done): New variable.
22
    	(fbsd_is_vfork_done_pending): New function.
23
    	(fbsd_next_vfork_done): New function.
24
    	(fbsd_resume): Don't resume processes with a pending vfork done
25
    	event.
26
    	(fbsd_wait): Report pending vfork done events.
27
    	(fbsd_follow_fork): Delay and record a pending vfork done event
28
    	for a vfork parent when detaching the child.
29
30
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
31
index daf4580..fcb7ff5 100644
32
--- gdb/fbsd-nat.c
33
+++ gdb/fbsd-nat.c
34
@@ -530,13 +530,13 @@ fbsd_update_thread_list (struct target_ops *ops)
35
   sake.  FreeBSD versions newer than 9.1 contain both fixes.
36
 */
37
 
38
-struct fbsd_fork_child_info
39
+struct fbsd_fork_info
40
 {
41
-  struct fbsd_fork_child_info *next;
42
-  ptid_t child;			/* Pid of new child.  */
43
+  struct fbsd_fork_info *next;
44
+  ptid_t ptid;
45
 };
46
 
47
-static struct fbsd_fork_child_info *fbsd_pending_children;
48
+static struct fbsd_fork_info *fbsd_pending_children;
49
 
50
 /* Record a new child process event that is reported before the
51
    corresponding fork event in the parent.  */
52
@@ -544,9 +544,9 @@ static struct fbsd_fork_child_info *fbsd_pending_children;
53
 static void
54
 fbsd_remember_child (ptid_t pid)
55
 {
56
-  struct fbsd_fork_child_info *info = XCNEW (struct fbsd_fork_child_info);
57
+  struct fbsd_fork_info *info = XCNEW (struct fbsd_fork_info);
58
 
59
-  info->child = pid;
60
+  info->ptid = pid;
61
   info->next = fbsd_pending_children;
62
   fbsd_pending_children = info;
63
 }
64
@@ -557,25 +557,74 @@ fbsd_remember_child (ptid_t pid)
65
 static ptid_t
66
 fbsd_is_child_pending (pid_t pid)
67
 {
68
-  struct fbsd_fork_child_info *info, *prev;
69
+  struct fbsd_fork_info *info, *prev;
70
   ptid_t ptid;
71
 
72
   prev = NULL;
73
   for (info = fbsd_pending_children; info; prev = info, info = info->next)
74
     {
75
-      if (ptid_get_pid (info->child) == pid)
76
+      if (ptid_get_pid (info->ptid) == pid)
77
 	{
78
 	  if (prev == NULL)
79
 	    fbsd_pending_children = info->next;
80
 	  else
81
 	    prev->next = info->next;
82
-	  ptid = info->child;
83
+	  ptid = info->ptid;
84
 	  xfree (info);
85
 	  return ptid;
86
 	}
87
     }
88
   return null_ptid;
89
 }
90
+
91
+static struct fbsd_fork_info *fbsd_pending_vfork_done;
92
+
93
+/* Record a pending vfork done event.  */
94
+
95
+static void
96
+fbsd_add_vfork_done (ptid_t pid)
97
+{
98
+  struct fbsd_fork_info *info = XCNEW (struct fbsd_fork_info);
99
+
100
+  info->ptid = pid;
101
+  info->next = fbsd_pending_vfork_done;
102
+  fbsd_pending_vfork_done = info;
103
+}
104
+
105
+/* Check for a pending vfork done event for a specific PID.  */
106
+
107
+static int
108
+fbsd_is_vfork_done_pending (pid_t pid)
109
+{
110
+  struct fbsd_fork_info *info;
111
+
112
+  for (info = fbsd_pending_vfork_done; info != NULL; info = info->next)
113
+    {
114
+      if (ptid_get_pid (info->ptid) == pid)
115
+	return 1;
116
+    }
117
+  return 0;
118
+}
119
+
120
+/* Check for a pending vfork done event.  If one is found, remove it
121
+   from the list and return the PTID.  */
122
+
123
+static ptid
124
+fbsd_next_vfork_done (void)
125
+{
126
+  struct fbsd_fork_info *info;
127
+  ptid_t ptid;
128
+
129
+  if (fbsd_pending_vfork_done != NULL)
130
+    {
131
+      info = fbsd_pending_vfork_done;
132
+      fbsd_pending_vfork_done = info->next;
133
+      ptid = info->ptid;
134
+      xfree (info);
135
+      return ptid;
136
+    }
137
+  return null_ptid;
138
+}
139
 #endif
140
 
141
 static int
142
@@ -616,6 +665,17 @@ static void
143
 fbsd_resume (struct target_ops *ops,
144
 	     ptid_t ptid, int step, enum gdb_signal signo)
145
 {
146
+#ifdef TDP_RFPPWAIT
147
+  pid_t pid;
148
+
149
+  /* Don't PT_CONTINUE a process which has a pending vfork done event.  */
150
+  if (ptid_equal (minus_one_ptid, ptid))
151
+    pid = ptid_get_pid (inferior_ptid);
152
+  else
153
+    pid = ptid_get_pid (ptid);
154
+  if (fbsd_is_vfork_done_pending (pid))
155
+    return;
156
+#endif
157
 
158
   if (debug_fbsd_lwp)
159
     fprintf_unfiltered (gdb_stdlog,
160
@@ -650,6 +710,12 @@ fbsd_wait (struct target_ops *ops,
161
 
162
   while (1)
163
     {
164
+      wptid = fbsd_next_vfork_done ();
165
+      if (!ptid_equal (wptid, null_ptid))
166
+	{
167
+	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
168
+	  return wptid;
169
+	}
170
       wptid = super_wait (ops, ptid, ourstatus, target_options);
171
       if (ourstatus->kind == TARGET_WAITKIND_STOPPED)
172
 	{
173
@@ -828,6 +894,7 @@ fbsd_follow_fork (struct target_ops *ops, int follow_child,
174
   if (!follow_child && detach_fork)
175
     {
176
       struct thread_info *tp = inferior_thread ();
177
+      int has_vforked = tp->pending_follow.kind == TARGET_WAITKIND_VFORKED;
178
       pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid);
179
 
180
       /* Breakpoints have already been detached from the child by
181
@@ -835,6 +902,33 @@ fbsd_follow_fork (struct target_ops *ops, int follow_child,
182
 
183
       if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3)1, 0) == -1)
184
 	perror_with_name (("ptrace"));
185
+
186
+      if (has_vforked)
187
+	{
188
+	  /* We can't insert breakpoints until the child process has
189
+	     finished with the shared memory region.  The parent
190
+	     process doesn't wait for the child process to exit or
191
+	     exec until after it has been resumed from the ptrace stop
192
+	     to report the fork.  Once it has been resumed it doesn't
193
+	     stop again before returning to userland, so there is no
194
+	     reliable way to wait on the parent.
195
+
196
+	     We can't stay attached to the child to wait for an exec
197
+	     or exit because it may invoke ptrace(PT_TRACE_ME)
198
+	     (e.g. if the parent process is a debugger forking a new
199
+	     child process).
200
+
201
+	     In the end, the best we can do is to make sure it runs
202
+	     for a little while.  Hopefully it will be out of range of
203
+	     any breakpoints we reinsert.  Usually this is only the
204
+	     single-step breakpoint at vfork's return point.  */
205
+
206
+	  usleep (10000);
207
+
208
+	  /* Schedule a fake VFORK_DONE event to report on the next
209
+	     wait.  */
210
+	  fbsd_add_vfork_done (inferior_ptid);
211
+	}
212
     }
213
 
214
   return 0;
(-)files/commit-2faa344 (+397 lines)
Line 0 Link Here
1
commit 2faa34476d9e6120eaf389b7f91b7227183fa2ce
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sat Jun 11 15:51:38 2016 -0700
4
5
    Add a new gdbarch method to print a single AUXV entry.
6
    
7
    Different platforms have different meanings for auxiliary vector
8
    entries.  The 'print_auxv_entry' gdbarch method allows an architecture
9
    to output a suitable description for platform-specific entries.
10
    
11
    A fprint_auxv_entry function is split out of fprint_target_auxv.
12
    This function outputs the description of a single auxiliary vector
13
    entry to the specified file using caller-supplied formatting and
14
    strings to describe the vector type.
15
    
16
    The existing switch on auxiliary vector types is moved out of
17
    fprint_target_auxv into a new default_print_auxv_entry function.
18
    default_print_auxv_entry chooses an appropriate format and description
19
    and calls fprint_single_auxv to describe a single vector entry.
20
    This function is used as the default 'print_auxv_entry' gdbarch method.
21
    
22
    fprint_target_auxv now invokes the gdbarch 'print_auxv_entry' method
23
    on each vector entry.
24
    
25
    gdb/ChangeLog:
26
    
27
    	* auxv.c (fprint_auxv_entry): New function.
28
    	(default_print_auxv_entry): New function.
29
    	(fprint_target_auxv): Use gdbarch_print_auxv_entry.
30
    	* auxv.h (enum auxv_format): New enum.
31
    	(fprint_auxv_entry): Declare.
32
    	(default_print_auxv_entry): Declare.
33
    	* gdbarch.sh (print_auxv_entry): New.
34
    	* gdbarch.c, gdbarch.h: Re-generated.
35
36
diff --git gdb/auxv.c gdb/auxv.c
37
index 396862e..de9205d 100644
38
--- gdb/auxv.c
39
+++ gdb/auxv.c
40
@@ -407,10 +407,126 @@ target_auxv_search (struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
41
 }
42
 
43
 
44
+/* Print the description of a single AUXV entry on the specified file.  */
45
+
46
+void
47
+fprint_auxv_entry (struct ui_file *file, const char *name,
48
+		   const char *description, enum auxv_format format,
49
+		   CORE_ADDR type, CORE_ADDR val)
50
+{
51
+  fprintf_filtered (file, ("%-4s %-20s %-30s "),
52
+		    plongest (type), name, description);
53
+  switch (format)
54
+    {
55
+    case AUXV_FORMAT_DEC:
56
+      fprintf_filtered (file, ("%s\n"), plongest (val));
57
+      break;
58
+    case AUXV_FORMAT_HEX:
59
+      fprintf_filtered (file, ("%s\n"), paddress (target_gdbarch (), val));
60
+      break;
61
+    case AUXV_FORMAT_STR:
62
+      {
63
+	struct value_print_options opts;
64
+
65
+	get_user_print_options (&opts);
66
+	if (opts.addressprint)
67
+	  fprintf_filtered (file, ("%s "), paddress (target_gdbarch (), val));
68
+	val_print_string (builtin_type (target_gdbarch ())->builtin_char,
69
+			  NULL, val, -1, file, &opts);
70
+	fprintf_filtered (file, ("\n"));
71
+      }
72
+      break;
73
+    }
74
+}
75
+
76
+/* The default implementation of gdbarch_print_auxv_entry.  */
77
+
78
+void
79
+default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
80
+			  CORE_ADDR type, CORE_ADDR val)
81
+{
82
+  const char *name = "???";
83
+  const char *description = "";
84
+  enum auxv_format format = AUXV_FORMAT_HEX;
85
+
86
+  switch (type)
87
+    {
88
+#define TAG(tag, text, kind) \
89
+      case tag: name = #tag; description = text; format = kind; break
90
+      TAG (AT_NULL, _("End of vector"), AUXV_FORMAT_HEX);
91
+      TAG (AT_IGNORE, _("Entry should be ignored"), AUXV_FORMAT_HEX);
92
+      TAG (AT_EXECFD, _("File descriptor of program"), AUXV_FORMAT_DEC);
93
+      TAG (AT_PHDR, _("Program headers for program"), AUXV_FORMAT_HEX);
94
+      TAG (AT_PHENT, _("Size of program header entry"), AUXV_FORMAT_DEC);
95
+      TAG (AT_PHNUM, _("Number of program headers"), AUXV_FORMAT_DEC);
96
+      TAG (AT_PAGESZ, _("System page size"), AUXV_FORMAT_DEC);
97
+      TAG (AT_BASE, _("Base address of interpreter"), AUXV_FORMAT_HEX);
98
+      TAG (AT_FLAGS, _("Flags"), AUXV_FORMAT_HEX);
99
+      TAG (AT_ENTRY, _("Entry point of program"), AUXV_FORMAT_HEX);
100
+      TAG (AT_NOTELF, _("Program is not ELF"), AUXV_FORMAT_DEC);
101
+      TAG (AT_UID, _("Real user ID"), AUXV_FORMAT_DEC);
102
+      TAG (AT_EUID, _("Effective user ID"), AUXV_FORMAT_DEC);
103
+      TAG (AT_GID, _("Real group ID"), AUXV_FORMAT_DEC);
104
+      TAG (AT_EGID, _("Effective group ID"), AUXV_FORMAT_DEC);
105
+      TAG (AT_CLKTCK, _("Frequency of times()"), AUXV_FORMAT_DEC);
106
+      TAG (AT_PLATFORM, _("String identifying platform"), AUXV_FORMAT_STR);
107
+      TAG (AT_HWCAP, _("Machine-dependent CPU capability hints"),
108
+	   AUXV_FORMAT_HEX);
109
+      TAG (AT_FPUCW, _("Used FPU control word"), AUXV_FORMAT_DEC);
110
+      TAG (AT_DCACHEBSIZE, _("Data cache block size"), AUXV_FORMAT_DEC);
111
+      TAG (AT_ICACHEBSIZE, _("Instruction cache block size"), AUXV_FORMAT_DEC);
112
+      TAG (AT_UCACHEBSIZE, _("Unified cache block size"), AUXV_FORMAT_DEC);
113
+      TAG (AT_IGNOREPPC, _("Entry should be ignored"), AUXV_FORMAT_DEC);
114
+      TAG (AT_BASE_PLATFORM, _("String identifying base platform"),
115
+	   AUXV_FORMAT_STR);
116
+      TAG (AT_RANDOM, _("Address of 16 random bytes"), AUXV_FORMAT_HEX);
117
+      TAG (AT_HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX);
118
+      TAG (AT_EXECFN, _("File name of executable"), AUXV_FORMAT_STR);
119
+      TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), AUXV_FORMAT_DEC);
120
+      TAG (AT_SYSINFO, _("Special system info/entry points"), AUXV_FORMAT_HEX);
121
+      TAG (AT_SYSINFO_EHDR, _("System-supplied DSO's ELF header"),
122
+	   AUXV_FORMAT_HEX);
123
+      TAG (AT_L1I_CACHESHAPE, _("L1 Instruction cache information"),
124
+	   AUXV_FORMAT_HEX);
125
+      TAG (AT_L1D_CACHESHAPE, _("L1 Data cache information"), AUXV_FORMAT_HEX);
126
+      TAG (AT_L2_CACHESHAPE, _("L2 cache information"), AUXV_FORMAT_HEX);
127
+      TAG (AT_L3_CACHESHAPE, _("L3 cache information"), AUXV_FORMAT_HEX);
128
+      TAG (AT_SUN_UID, _("Effective user ID"), AUXV_FORMAT_DEC);
129
+      TAG (AT_SUN_RUID, _("Real user ID"), AUXV_FORMAT_DEC);
130
+      TAG (AT_SUN_GID, _("Effective group ID"), AUXV_FORMAT_DEC);
131
+      TAG (AT_SUN_RGID, _("Real group ID"), AUXV_FORMAT_DEC);
132
+      TAG (AT_SUN_LDELF, _("Dynamic linker's ELF header"), AUXV_FORMAT_HEX);
133
+      TAG (AT_SUN_LDSHDR, _("Dynamic linker's section headers"),
134
+	   AUXV_FORMAT_HEX);
135
+      TAG (AT_SUN_LDNAME, _("String giving name of dynamic linker"),
136
+	   AUXV_FORMAT_STR);
137
+      TAG (AT_SUN_LPAGESZ, _("Large pagesize"), AUXV_FORMAT_DEC);
138
+      TAG (AT_SUN_PLATFORM, _("Platform name string"), AUXV_FORMAT_STR);
139
+      TAG (AT_SUN_HWCAP, _("Machine-dependent CPU capability hints"),
140
+	   AUXV_FORMAT_HEX);
141
+      TAG (AT_SUN_IFLUSH, _("Should flush icache?"), AUXV_FORMAT_DEC);
142
+      TAG (AT_SUN_CPU, _("CPU name string"), AUXV_FORMAT_STR);
143
+      TAG (AT_SUN_EMUL_ENTRY, _("COFF entry point address"), AUXV_FORMAT_HEX);
144
+      TAG (AT_SUN_EMUL_EXECFD, _("COFF executable file descriptor"),
145
+	   AUXV_FORMAT_DEC);
146
+      TAG (AT_SUN_EXECNAME,
147
+	   _("Canonicalized file name given to execve"), AUXV_FORMAT_STR);
148
+      TAG (AT_SUN_MMU, _("String for name of MMU module"), AUXV_FORMAT_STR);
149
+      TAG (AT_SUN_LDDATA, _("Dynamic linker's data segment address"),
150
+	   AUXV_FORMAT_HEX);
151
+      TAG (AT_SUN_AUXFLAGS,
152
+	   _("AF_SUN_ flags passed from the kernel"), AUXV_FORMAT_HEX);
153
+    }
154
+
155
+  fprint_auxv_entry (file, name, description, format, type, val);
156
+}
157
+
158
 /* Print the contents of the target's AUXV on the specified file.  */
159
+
160
 int
161
 fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
162
 {
163
+  struct gdbarch *gdbarch = target_gdbarch ();
164
   CORE_ADDR type, val;
165
   gdb_byte *data;
166
   gdb_byte *ptr;
167
@@ -426,93 +542,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
168
 
169
   while (target_auxv_parse (ops, &ptr, data + info->length, &type, &val) > 0)
170
     {
171
-      const char *name = "???";
172
-      const char *description = "";
173
-      enum { dec, hex, str } flavor = hex;
174
-
175
-      switch (type)
176
-	{
177
-#define TAG(tag, text, kind) \
178
-	case tag: name = #tag; description = text; flavor = kind; break
179
-	  TAG (AT_NULL, _("End of vector"), hex);
180
-	  TAG (AT_IGNORE, _("Entry should be ignored"), hex);
181
-	  TAG (AT_EXECFD, _("File descriptor of program"), dec);
182
-	  TAG (AT_PHDR, _("Program headers for program"), hex);
183
-	  TAG (AT_PHENT, _("Size of program header entry"), dec);
184
-	  TAG (AT_PHNUM, _("Number of program headers"), dec);
185
-	  TAG (AT_PAGESZ, _("System page size"), dec);
186
-	  TAG (AT_BASE, _("Base address of interpreter"), hex);
187
-	  TAG (AT_FLAGS, _("Flags"), hex);
188
-	  TAG (AT_ENTRY, _("Entry point of program"), hex);
189
-	  TAG (AT_NOTELF, _("Program is not ELF"), dec);
190
-	  TAG (AT_UID, _("Real user ID"), dec);
191
-	  TAG (AT_EUID, _("Effective user ID"), dec);
192
-	  TAG (AT_GID, _("Real group ID"), dec);
193
-	  TAG (AT_EGID, _("Effective group ID"), dec);
194
-	  TAG (AT_CLKTCK, _("Frequency of times()"), dec);
195
-	  TAG (AT_PLATFORM, _("String identifying platform"), str);
196
-	  TAG (AT_HWCAP, _("Machine-dependent CPU capability hints"), hex);
197
-	  TAG (AT_FPUCW, _("Used FPU control word"), dec);
198
-	  TAG (AT_DCACHEBSIZE, _("Data cache block size"), dec);
199
-	  TAG (AT_ICACHEBSIZE, _("Instruction cache block size"), dec);
200
-	  TAG (AT_UCACHEBSIZE, _("Unified cache block size"), dec);
201
-	  TAG (AT_IGNOREPPC, _("Entry should be ignored"), dec);
202
-	  TAG (AT_BASE_PLATFORM, _("String identifying base platform"), str);
203
-	  TAG (AT_RANDOM, _("Address of 16 random bytes"), hex);
204
-	  TAG (AT_HWCAP2, _("Extension of AT_HWCAP"), hex);
205
-	  TAG (AT_EXECFN, _("File name of executable"), str);
206
-	  TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), dec);
207
-	  TAG (AT_SYSINFO, _("Special system info/entry points"), hex);
208
-	  TAG (AT_SYSINFO_EHDR, _("System-supplied DSO's ELF header"), hex);
209
-	  TAG (AT_L1I_CACHESHAPE, _("L1 Instruction cache information"), hex);
210
-	  TAG (AT_L1D_CACHESHAPE, _("L1 Data cache information"), hex);
211
-	  TAG (AT_L2_CACHESHAPE, _("L2 cache information"), hex);
212
-	  TAG (AT_L3_CACHESHAPE, _("L3 cache information"), hex);
213
-	  TAG (AT_SUN_UID, _("Effective user ID"), dec);
214
-	  TAG (AT_SUN_RUID, _("Real user ID"), dec);
215
-	  TAG (AT_SUN_GID, _("Effective group ID"), dec);
216
-	  TAG (AT_SUN_RGID, _("Real group ID"), dec);
217
-	  TAG (AT_SUN_LDELF, _("Dynamic linker's ELF header"), hex);
218
-	  TAG (AT_SUN_LDSHDR, _("Dynamic linker's section headers"), hex);
219
-	  TAG (AT_SUN_LDNAME, _("String giving name of dynamic linker"), str);
220
-	  TAG (AT_SUN_LPAGESZ, _("Large pagesize"), dec);
221
-	  TAG (AT_SUN_PLATFORM, _("Platform name string"), str);
222
-	  TAG (AT_SUN_HWCAP, _("Machine-dependent CPU capability hints"), hex);
223
-	  TAG (AT_SUN_IFLUSH, _("Should flush icache?"), dec);
224
-	  TAG (AT_SUN_CPU, _("CPU name string"), str);
225
-	  TAG (AT_SUN_EMUL_ENTRY, _("COFF entry point address"), hex);
226
-	  TAG (AT_SUN_EMUL_EXECFD, _("COFF executable file descriptor"), dec);
227
-	  TAG (AT_SUN_EXECNAME,
228
-	       _("Canonicalized file name given to execve"), str);
229
-	  TAG (AT_SUN_MMU, _("String for name of MMU module"), str);
230
-	  TAG (AT_SUN_LDDATA, _("Dynamic linker's data segment address"), hex);
231
-	  TAG (AT_SUN_AUXFLAGS,
232
-	       _("AF_SUN_ flags passed from the kernel"), hex);
233
-	}
234
-
235
-      fprintf_filtered (file, "%-4s %-20s %-30s ",
236
-			plongest (type), name, description);
237
-      switch (flavor)
238
-	{
239
-	case dec:
240
-	  fprintf_filtered (file, "%s\n", plongest (val));
241
-	  break;
242
-	case hex:
243
-	  fprintf_filtered (file, "%s\n", paddress (target_gdbarch (), val));
244
-	  break;
245
-	case str:
246
-	  {
247
-	    struct value_print_options opts;
248
-
249
-	    get_user_print_options (&opts);
250
-	    if (opts.addressprint)
251
-	      fprintf_filtered (file, "%s ", paddress (target_gdbarch (), val));
252
-	    val_print_string (builtin_type (target_gdbarch ())->builtin_char,
253
-			      NULL, val, -1, file, &opts);
254
-	    fprintf_filtered (file, "\n");
255
-	  }
256
-	  break;
257
-	}
258
+      gdbarch_print_auxv_entry (gdbarch, file, type, val);
259
       ++ents;
260
       if (type == AT_NULL)
261
 	break;
262
diff --git gdb/auxv.h gdb/auxv.h
263
index 9efe604..916f674 100644
264
--- gdb/auxv.h
265
+++ gdb/auxv.h
266
@@ -46,6 +46,20 @@ extern int target_auxv_parse (struct target_ops *ops,
267
 extern int target_auxv_search (struct target_ops *ops,
268
 			       CORE_ADDR match, CORE_ADDR *valp);
269
 
270
+/* Print a description of a single AUXV entry on the specified file.  */
271
+enum auxv_format { AUXV_FORMAT_DEC, AUXV_FORMAT_HEX, AUXV_FORMAT_STR };
272
+
273
+extern void fprint_auxv_entry (struct ui_file *file, const char *name,
274
+			       const char *description,
275
+			       enum auxv_format format, CORE_ADDR type,
276
+			       CORE_ADDR val);
277
+
278
+/* The default implementation of gdbarch_print_auxv_entry.  */
279
+
280
+extern void default_print_auxv_entry (struct gdbarch *gdbarch,
281
+				      struct ui_file *file, CORE_ADDR type,
282
+				      CORE_ADDR val);
283
+
284
 /* Print the contents of the target's AUXV on the specified file.  */
285
 extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops);
286
 
287
diff --git gdb/gdbarch.c gdb/gdbarch.c
288
index 313502b..af7359e 100644
289
--- gdb/gdbarch.c
290
+++ gdb/gdbarch.c
291
@@ -47,6 +47,7 @@
292
 #include "observer.h"
293
 #include "regcache.h"
294
 #include "objfiles.h"
295
+#include "auxv.h"
296
 
297
 /* Static function declarations */
298
 
299
@@ -328,6 +329,7 @@ struct gdbarch
300
   gdbarch_insn_is_ret_ftype *insn_is_ret;
301
   gdbarch_insn_is_jump_ftype *insn_is_jump;
302
   gdbarch_auxv_parse_ftype *auxv_parse;
303
+  gdbarch_print_auxv_entry_ftype *print_auxv_entry;
304
   gdbarch_vsyscall_range_ftype *vsyscall_range;
305
   gdbarch_infcall_mmap_ftype *infcall_mmap;
306
   gdbarch_infcall_munmap_ftype *infcall_munmap;
307
@@ -432,6 +434,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
308
   gdbarch->insn_is_call = default_insn_is_call;
309
   gdbarch->insn_is_ret = default_insn_is_ret;
310
   gdbarch->insn_is_jump = default_insn_is_jump;
311
+  gdbarch->print_auxv_entry = default_print_auxv_entry;
312
   gdbarch->vsyscall_range = default_vsyscall_range;
313
   gdbarch->infcall_mmap = default_infcall_mmap;
314
   gdbarch->infcall_munmap = default_infcall_munmap;
315
@@ -678,6 +681,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
316
   /* Skip verify of insn_is_ret, invalid_p == 0 */
317
   /* Skip verify of insn_is_jump, invalid_p == 0 */
318
   /* Skip verify of auxv_parse, has predicate.  */
319
+  /* Skip verify of print_auxv_entry, invalid_p == 0 */
320
   /* Skip verify of vsyscall_range, invalid_p == 0 */
321
   /* Skip verify of infcall_mmap, invalid_p == 0 */
322
   /* Skip verify of infcall_munmap, invalid_p == 0 */
323
@@ -1167,6 +1171,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
324
                       "gdbarch_dump: pointer_to_address = <%s>\n",
325
                       host_address_to_string (gdbarch->pointer_to_address));
326
   fprintf_unfiltered (file,
327
+                      "gdbarch_dump: print_auxv_entry = <%s>\n",
328
+                      host_address_to_string (gdbarch->print_auxv_entry));
329
+  fprintf_unfiltered (file,
330
                       "gdbarch_dump: print_float_info = <%s>\n",
331
                       host_address_to_string (gdbarch->print_float_info));
332
   fprintf_unfiltered (file,
333
@@ -4769,6 +4776,23 @@ set_gdbarch_auxv_parse (struct gdbarch *gdbarch,
334
   gdbarch->auxv_parse = auxv_parse;
335
 }
336
 
337
+void
338
+gdbarch_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val)
339
+{
340
+  gdb_assert (gdbarch != NULL);
341
+  gdb_assert (gdbarch->print_auxv_entry != NULL);
342
+  if (gdbarch_debug >= 2)
343
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_print_auxv_entry called\n");
344
+  gdbarch->print_auxv_entry (gdbarch, file, type, val);
345
+}
346
+
347
+void
348
+set_gdbarch_print_auxv_entry (struct gdbarch *gdbarch,
349
+                              gdbarch_print_auxv_entry_ftype print_auxv_entry)
350
+{
351
+  gdbarch->print_auxv_entry = print_auxv_entry;
352
+}
353
+
354
 int
355
 gdbarch_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range)
356
 {
357
diff --git gdb/gdbarch.h gdb/gdbarch.h
358
index a6366fc..bc0f692 100644
359
--- gdb/gdbarch.h
360
+++ gdb/gdbarch.h
361
@@ -1464,6 +1464,13 @@ typedef int (gdbarch_auxv_parse_ftype) (struct gdbarch *gdbarch, gdb_byte **read
362
 extern int gdbarch_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
363
 extern void set_gdbarch_auxv_parse (struct gdbarch *gdbarch, gdbarch_auxv_parse_ftype *auxv_parse);
364
 
365
+/* Print the description of a single auxv entry described by TYPE and VAL
366
+   to FILE. */
367
+
368
+typedef void (gdbarch_print_auxv_entry_ftype) (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
369
+extern void gdbarch_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
370
+extern void set_gdbarch_print_auxv_entry (struct gdbarch *gdbarch, gdbarch_print_auxv_entry_ftype *print_auxv_entry);
371
+
372
 /* Find the address range of the current inferior's vsyscall/vDSO, and
373
    write it to *RANGE.  If the vsyscall's length can't be determined, a
374
    range with zero length is returned.  Returns true if the vsyscall is
375
diff --git gdb/gdbarch.sh gdb/gdbarch.sh
376
index f170c10..d8e0eeb 100755
377
--- gdb/gdbarch.sh
378
+++ gdb/gdbarch.sh
379
@@ -1110,6 +1110,10 @@ m:int:insn_is_jump:CORE_ADDR addr:addr::default_insn_is_jump::0
380
 # Return 1 if an entry was read into *TYPEP and *VALP.
381
 M:int:auxv_parse:gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp:readptr, endptr, typep, valp
382
 
383
+# Print the description of a single auxv entry described by TYPE and VAL
384
+# to FILE.
385
+m:void:print_auxv_entry:struct ui_file *file, CORE_ADDR type, CORE_ADDR val:file, type, val::default_print_auxv_entry::0
386
+
387
 # Find the address range of the current inferior's vsyscall/vDSO, and
388
 # write it to *RANGE.  If the vsyscall's length can't be determined, a
389
 # range with zero length is returned.  Returns true if the vsyscall is
390
@@ -1616,6 +1620,7 @@ cat <<EOF
391
 #include "observer.h"
392
 #include "regcache.h"
393
 #include "objfiles.h"
394
+#include "auxv.h"
395
 
396
 /* Static function declarations */
397
 
(-)files/commit-3350c5f (+39 lines)
Line 0 Link Here
1
commit 3350c5f5de3d2e62dd9de2a76cf2d5d8728d2600
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sun Jun 12 12:34:51 2016 -0700
4
5
    Create a pseudo section for the ELF AUXV core dump note on FreeBSD.
6
    
7
    The procstat AUXV core dump note in FreeBSD consists of 32-bit integer
8
    followed by an array of auxiliary vector entries.
9
    
10
    bfd/ChangeLog:
11
    
12
    	* elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV
13
    	notes.
14
15
diff --git bfd/elf.c bfd/elf.c
16
index cfcafaa..cb4de50 100644
17
--- bfd/elf.c
18
+++ bfd/elf.c
19
@@ -9663,6 +9663,20 @@ elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note)
20
       else
21
 	return TRUE;
22
 
23
+    case NT_FREEBSD_PROCSTAT_AUXV:
24
+      {
25
+	asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv",
26
+							     SEC_HAS_CONTENTS);
27
+
28
+	if (sect == NULL)
29
+	  return FALSE;
30
+	sect->size = note->descsz - 4;
31
+	sect->filepos = note->descpos + 4;
32
+	sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32;
33
+
34
+	return TRUE;
35
+      }
36
+
37
     case NT_X86_XSTATE:
38
       if (note->namesz == 8)
39
 	return elfcore_grok_xstatereg (abfd, note);
(-)files/commit-5077bff (+49 lines)
Line 0 Link Here
1
commit 5077bfff905136e9d9a8fdf0886f6217887622ad
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Mon Jun 27 17:44:58 2016 -0700
4
5
    Set debug registers on all threads belonging to the current inferior.
6
    
7
    gdb/ChangeLog:
8
    
9
    	* x86bsd-nat.c: Include 'gdbthread.h'.
10
    	(x86bsd_dr_set): Set debug registers on all threads belonging to
11
    	the current inferior.
12
13
diff --git gdb/x86bsd-nat.c gdb/x86bsd-nat.c
14
index 0c56848..bde25ab 100644
15
--- gdb/x86bsd-nat.c
16
+++ gdb/x86bsd-nat.c
17
@@ -19,6 +19,7 @@
18
 
19
 #include "defs.h"
20
 #include "inferior.h"
21
+#include "gdbthread.h"
22
 
23
 /* We include <signal.h> to make sure `struct fxsave64' is defined on
24
    NetBSD, since NetBSD's <machine/reg.h> needs it.  */
25
@@ -71,6 +72,7 @@ x86bsd_dr_get (ptid_t ptid, int regnum)
26
 static void
27
 x86bsd_dr_set (int regnum, unsigned long value)
28
 {
29
+  struct thread_info *thread;
30
   struct dbreg dbregs;
31
 
32
   if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
33
@@ -84,9 +86,13 @@ x86bsd_dr_set (int regnum, unsigned long value)
34
 
35
   DBREG_DRX ((&dbregs), regnum) = value;
36
 
37
-  if (ptrace (PT_SETDBREGS, get_ptrace_pid (inferior_ptid),
38
-              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
39
-    perror_with_name (_("Couldn't write debug registers"));
40
+  ALL_NON_EXITED_THREADS (thread)
41
+    if (thread->inf == current_inferior ())
42
+      {
43
+	if (ptrace (PT_SETDBREGS, get_ptrace_pid (thread->ptid),
44
+		    (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
45
+	  perror_with_name (_("Couldn't write debug registers"));
46
+      }
47
 }
48
 
49
 static void
(-)files/commit-7697fc9 (+110 lines)
Line 0 Link Here
1
commit 7697fc9ec3a970f05abb836107653c46ada466ad
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sat Jun 11 15:07:38 2016 -0700
4
5
    Fetch the ELF auxiliary vector from live processes on FreeBSD.
6
    
7
    Use the kern.proc.auxv.<pid> sysctl to fetch the ELF auxiliary vector for
8
    a live process.
9
    
10
    gdb/ChangeLog:
11
    
12
    	* fbsd-nat.c [KERN_PROC_AUXV] New variable super_xfer_partial.
13
    	(fbsd_xfer_partial): New function.
14
    	(fbsd_nat_add_target) [KERN_PROC_AUXV] Set "to_xfer_partial" to
15
    	"fbsd_xfer_partial".
16
17
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
18
index b582abe..dc65e29 100644
19
--- gdb/fbsd-nat.c
20
+++ gdb/fbsd-nat.c
21
@@ -206,6 +206,78 @@ fbsd_find_memory_regions (struct target_ops *self,
22
 }
23
 #endif
24
 
25
+#ifdef KERN_PROC_AUXV
26
+static enum target_xfer_status (*super_xfer_partial) (struct target_ops *ops,
27
+						      enum target_object object,
28
+						      const char *annex,
29
+						      gdb_byte *readbuf,
30
+						      const gdb_byte *writebuf,
31
+						      ULONGEST offset,
32
+						      ULONGEST len,
33
+						      ULONGEST *xfered_len);
34
+
35
+/* Implement the "to_xfer_partial target_ops" method.  */
36
+
37
+static enum target_xfer_status
38
+fbsd_xfer_partial (struct target_ops *ops, enum target_object object,
39
+		   const char *annex, gdb_byte *readbuf,
40
+		   const gdb_byte *writebuf,
41
+		   ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
42
+{
43
+  pid_t pid = ptid_get_pid (inferior_ptid);
44
+
45
+  switch (object)
46
+    {
47
+    case TARGET_OBJECT_AUXV:
48
+      {
49
+	struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
50
+	unsigned char *buf;
51
+	size_t buflen;
52
+	int mib[4];
53
+
54
+	if (writebuf != NULL)
55
+	  return TARGET_XFER_E_IO;
56
+	mib[0] = CTL_KERN;
57
+	mib[1] = KERN_PROC;
58
+	mib[2] = KERN_PROC_AUXV;
59
+	mib[3] = pid;
60
+	if (offset == 0)
61
+	  {
62
+	    buf = readbuf;
63
+	    buflen = len;
64
+	  }
65
+	else
66
+	  {
67
+	    buflen = offset + len;
68
+	    buf = XCNEWVEC (unsigned char, buflen);
69
+	    cleanup = make_cleanup (xfree, buf);
70
+	  }
71
+	if (sysctl (mib, 4, buf, &buflen, NULL, 0) == 0)
72
+	  {
73
+	    if (offset != 0)
74
+	      {
75
+		if (buflen > offset)
76
+		  {
77
+		    buflen -= offset;
78
+		    memcpy (readbuf, buf + offset, buflen);
79
+		  }
80
+		else
81
+		  buflen = 0;
82
+	      }
83
+	    do_cleanups (cleanup);
84
+	    *xfered_len = buflen;
85
+	    return (buflen == 0) ? TARGET_XFER_EOF : TARGET_XFER_OK;
86
+	  }
87
+	do_cleanups (cleanup);
88
+	return TARGET_XFER_E_IO;
89
+      }
90
+    default:
91
+      return super_xfer_partial (ops, object, annex, readbuf, writebuf, offset,
92
+				 len, xfered_len);
93
+    }
94
+}
95
+#endif
96
+
97
 #ifdef PT_LWPINFO
98
 static int debug_fbsd_lwp;
99
 
100
@@ -824,6 +896,10 @@ fbsd_nat_add_target (struct target_ops *t)
101
 {
102
   t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
103
   t->to_find_memory_regions = fbsd_find_memory_regions;
104
+#ifdef KERN_PROC_AUXV
105
+  super_xfer_partial = t->to_xfer_partial;
106
+  t->to_xfer_partial = fbsd_xfer_partial;
107
+#endif
108
 #ifdef PT_LWPINFO
109
   t->to_thread_alive = fbsd_thread_alive;
110
   t->to_pid_to_str = fbsd_pid_to_str;
(-)files/commit-82372b2 (+74 lines)
Line 0 Link Here
1
commit 82372b2f2747d347e24bb10ddc7bc7e828222a42
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Wed Jun 15 21:33:42 2016 -0700
4
5
    Add a gdbarch 'print_auxv_entry' method for FreeBSD ABIs.
6
    
7
    Add a 'print_auxv_entry' method for FreeBSD ABIs that parses
8
    FreeBSD-specific auxiliary vector entries and outputs a suitable
9
    description using fprint_auxv_entry.
10
    
11
    gdb/ChangeLog:
12
    
13
    	* fbsd-tdep.c: Include "auxv.h".
14
    	(fbsd_print_auxv_entry): New function.
15
    	(fbsd_init_abi): Install gdbarch "print_auxv_entry" method.
16
17
diff --git gdb/fbsd-tdep.c gdb/fbsd-tdep.c
18
index 7310ea0..e8f8605 100644
19
--- gdb/fbsd-tdep.c
20
+++ gdb/fbsd-tdep.c
21
@@ -18,6 +18,7 @@
22
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
23
 
24
 #include "defs.h"
25
+#include "auxv.h"
26
 #include "gdbcore.h"
27
 #include "inferior.h"
28
 #include "regcache.h"
29
@@ -283,6 +284,39 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
30
   return note_data;
31
 }
32
 
33
+/* Print descriptions of FreeBSD-specific AUXV entries to FILE.  */
34
+
35
+static void
36
+fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
37
+		       CORE_ADDR type, CORE_ADDR val)
38
+{
39
+  const char *name;
40
+  const char *description;
41
+  enum auxv_format format;
42
+
43
+  switch (type)
44
+    {
45
+#define _TAGNAME(tag) #tag
46
+#define TAGNAME(tag) _TAGNAME(AT_##tag)
47
+#define TAG(tag, text, kind) \
48
+      case AT_FREEBSD_##tag: name = TAGNAME(tag); description = text; format = kind; break
49
+      TAG (EXECPATH, _("Executable path"), AUXV_FORMAT_STR);
50
+      TAG (CANARY, _("Canary for SSP"), AUXV_FORMAT_HEX);
51
+      TAG (CANARYLEN, ("Length of the SSP canary"), AUXV_FORMAT_DEC);
52
+      TAG (OSRELDATE, _("OSRELDATE"), AUXV_FORMAT_DEC);
53
+      TAG (NCPUS, _("Number of CPUs"), AUXV_FORMAT_DEC);
54
+      TAG (PAGESIZES, _("Pagesizes"), AUXV_FORMAT_HEX);
55
+      TAG (PAGESIZESLEN, _("Number of pagesizes"), AUXV_FORMAT_DEC);
56
+      TAG (TIMEKEEP, _("Pointer to timehands"), AUXV_FORMAT_HEX);
57
+      TAG (STACKPROT, _("Initial stack protection"), AUXV_FORMAT_HEX);
58
+    default:
59
+      default_print_auxv_entry (gdbarch, file, type, val);
60
+      return;
61
+    }
62
+
63
+  fprint_auxv_entry (file, name, description, format, type, val);
64
+}
65
+
66
 /* To be called from GDB_OSABI_FREEBSD_ELF handlers. */
67
 
68
 void
69
@@ -291,4 +325,5 @@ fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
70
   set_gdbarch_core_pid_to_str (gdbarch, fbsd_core_pid_to_str);
71
   set_gdbarch_core_thread_name (gdbarch, fbsd_core_thread_name);
72
   set_gdbarch_make_corefile_notes (gdbarch, fbsd_make_corefile_notes);
73
+  set_gdbarch_print_auxv_entry (gdbarch, fbsd_print_auxv_entry);
74
 }
(-)files/commit-8607ea6 (+165 lines)
Line 0 Link Here
1
commit 8607ea632c806235554aa2336cf01bf3758c1264
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jun 24 21:06:36 2016 -0700
4
5
    Move fbsd_resume and related functions below fork following helper code.
6
    
7
    gdb/ChangeLog:
8
    
9
    	* fbsd-nat.c (super_resume): Move earlier next to "super_wait".
10
    	(resume_one_thread_cb): Move below fork following helper code.
11
    	(resume_all_threads_cb): Likewise.
12
    	(fbsd_resume): Likewise.
13
14
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
15
index 0999712..daf4580 100644
16
--- gdb/fbsd-nat.c
17
+++ gdb/fbsd-nat.c
18
@@ -281,6 +281,10 @@ fbsd_xfer_partial (struct target_ops *ops, enum target_object object,
19
 #ifdef PT_LWPINFO
20
 static int debug_fbsd_lwp;
21
 
22
+static void (*super_resume) (struct target_ops *,
23
+			     ptid_t,
24
+			     int,
25
+			     enum gdb_signal);
26
 static ptid_t (*super_wait) (struct target_ops *,
27
 			     ptid_t,
28
 			     struct target_waitstatus *,
29
@@ -492,70 +496,6 @@ fbsd_update_thread_list (struct target_ops *ops)
30
 #endif
31
 }
32
 
33
-static void (*super_resume) (struct target_ops *,
34
-			     ptid_t,
35
-			     int,
36
-			     enum gdb_signal);
37
-
38
-static int
39
-resume_one_thread_cb (struct thread_info *tp, void *data)
40
-{
41
-  ptid_t *ptid = (ptid_t *) data;
42
-  int request;
43
-
44
-  if (ptid_get_pid (tp->ptid) != ptid_get_pid (*ptid))
45
-    return 0;
46
-
47
-  if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (*ptid))
48
-    request = PT_RESUME;
49
-  else
50
-    request = PT_SUSPEND;
51
-
52
-  if (ptrace (request, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
53
-    perror_with_name (("ptrace"));
54
-  return 0;
55
-}
56
-
57
-static int
58
-resume_all_threads_cb (struct thread_info *tp, void *data)
59
-{
60
-  ptid_t *filter = (ptid_t *) data;
61
-
62
-  if (!ptid_match (tp->ptid, *filter))
63
-    return 0;
64
-
65
-  if (ptrace (PT_RESUME, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
66
-    perror_with_name (("ptrace"));
67
-  return 0;
68
-}
69
-
70
-/* Implement the "to_resume" target_ops method.  */
71
-
72
-static void
73
-fbsd_resume (struct target_ops *ops,
74
-	     ptid_t ptid, int step, enum gdb_signal signo)
75
-{
76
-
77
-  if (debug_fbsd_lwp)
78
-    fprintf_unfiltered (gdb_stdlog,
79
-			"FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n",
80
-			ptid_get_pid (ptid), ptid_get_lwp (ptid),
81
-			ptid_get_tid (ptid));
82
-  if (ptid_lwp_p (ptid))
83
-    {
84
-      /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
85
-      iterate_over_threads (resume_one_thread_cb, &ptid);
86
-    }
87
-  else
88
-    {
89
-      /* If ptid is a wildcard, resume all matching threads (they won't run
90
-	 until the process is continued however).  */
91
-      iterate_over_threads (resume_all_threads_cb, &ptid);
92
-      ptid = inferior_ptid;
93
-    }
94
-  super_resume (ops, ptid, step, signo);
95
-}
96
-
97
 #ifdef TDP_RFPPWAIT
98
 /*
99
   To catch fork events, PT_FOLLOW_FORK is set on every traced process
100
@@ -638,6 +578,65 @@ fbsd_is_child_pending (pid_t pid)
101
 }
102
 #endif
103
 
104
+static int
105
+resume_one_thread_cb (struct thread_info *tp, void *data)
106
+{
107
+  ptid_t *ptid = (ptid_t *) data;
108
+  int request;
109
+
110
+  if (ptid_get_pid (tp->ptid) != ptid_get_pid (*ptid))
111
+    return 0;
112
+
113
+  if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (*ptid))
114
+    request = PT_RESUME;
115
+  else
116
+    request = PT_SUSPEND;
117
+
118
+  if (ptrace (request, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
119
+    perror_with_name (("ptrace"));
120
+  return 0;
121
+}
122
+
123
+static int
124
+resume_all_threads_cb (struct thread_info *tp, void *data)
125
+{
126
+  ptid_t *filter = (ptid_t *) data;
127
+
128
+  if (!ptid_match (tp->ptid, *filter))
129
+    return 0;
130
+
131
+  if (ptrace (PT_RESUME, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
132
+    perror_with_name (("ptrace"));
133
+  return 0;
134
+}
135
+
136
+/* Implement the "to_resume" target_ops method.  */
137
+
138
+static void
139
+fbsd_resume (struct target_ops *ops,
140
+	     ptid_t ptid, int step, enum gdb_signal signo)
141
+{
142
+
143
+  if (debug_fbsd_lwp)
144
+    fprintf_unfiltered (gdb_stdlog,
145
+			"FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n",
146
+			ptid_get_pid (ptid), ptid_get_lwp (ptid),
147
+			ptid_get_tid (ptid));
148
+  if (ptid_lwp_p (ptid))
149
+    {
150
+      /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
151
+      iterate_over_threads (resume_one_thread_cb, &ptid);
152
+    }
153
+  else
154
+    {
155
+      /* If ptid is a wildcard, resume all matching threads (they won't run
156
+	 until the process is continued however).  */
157
+      iterate_over_threads (resume_all_threads_cb, &ptid);
158
+      ptid = inferior_ptid;
159
+    }
160
+  super_resume (ops, ptid, step, signo);
161
+}
162
+
163
 /* Wait for the child specified by PTID to do something.  Return the
164
    process ID of the child, or MINUS_ONE_PTID in case of error; store
165
    the status in *OURSTATUS.  */
(-)files/commit-a3405d1 (+827 lines)
Line 0 Link Here
1
commit a3405d124e1388b613a35af49f19f0cc1b8d959d
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Mon Jun 27 13:19:09 2016 -0700
4
5
    Consolidate x86 debug register code for BSD native targets.
6
    
7
    Move the debug register support code from amd64bsd-nat.c and
8
    i386bsd-nat.c into a shared x86bsd-nat.c.
9
    
10
    Instead of setting up x86_dr_low in amd64fbsd-nat.c and
11
    i386fbsd-nat.c, add a x86bsd_target function that creates a new target
12
    that inherits from inf_ptrace and sets up x86 debug registers if
13
    supported.  In addition to initializing x86_dr_low, the x86bsd target
14
    installs a custom mourn_inferior target operation to clean up the
15
    x86 debug register state.  Previously this was only done on amd64.
16
    Now it will be done for both i386 and amd64.  The i386bsd_target and
17
    amd64bsd_target functions create targets that inherit from x86bsd
18
    rather than inf_ptrace.
19
    
20
    gdb/ChangeLog:
21
    
22
    	* Makefile.in [HFILES_NO_SRCDIR]: Replace 'amd64bsd-nat.h' with
23
    	'x86bsd-nat.h'.
24
    	* amd64bsd-nat.c: Include 'x86bsd-nat.h' instead of
25
    	'amd64bsd-nat.h'.
26
    	(amd64bsd_xsave_len): Rename and move to x86bsd-nat.c.
27
    	(amd64bsd_fetch_inferior_registers): Replace 'amd64bsd_xsave_len'
28
    	with 'x86bsd_xsave_len'.
29
    	(amd64bsd_store_inferior_registers): Likewise.
30
    	(amd64bsd_target): Inherit from x86bsd_target.
31
    	(amd64bsd_dr_get): Rename and move to x86bsd-nat.c.
32
    	(amd64bsd_dr_set): Likewise.
33
    	(amd64bsd_dr_set_control): Likewise.
34
    	(amd64bsd_dr_set_addr): Likewise.
35
    	(amd64bsd_dr_get_addr): Likewise.
36
    	(amd64bsd_dr_get_status): Likewise.
37
    	(amd64bsd_dr_get_control): Likewise.
38
    	* amd64fbsd-nat.c: Include 'x86bsd-nat.h' instead of
39
    	'amd64bsd-nat.h'.
40
    	(super_mourn_inferior): Move to x86bsd-nat.c.
41
    	(amd64fbsd_mourn_inferior): Rename and move to x86bsd-nat.c.
42
    	(amd64fbsd_read_description): Replace 'amd64bsd_xsave_len' with
43
    	'x86bsd_xsave_len'.
44
    	(_initialize_amd64fbsd_nat): Remove x86 watchpoint setup and
45
    	mourn_inferior' target op.
46
    	* config/i386/fbsd.mh (NATDEPFILES): Add x86bsd-nat.o.
47
    	* config/i386/fbsd64.mh: Likewise.
48
    	* config/i386/nbsd64.mh: Likewise.
49
    	* config/i386/nbsdelf.mh: Likewise.
50
    	* config/i386/obsd.mh: Likewise.
51
    	* config/i386/obsd64.mh: Likewise.
52
    	* i386bsd-nat.c: Include 'x86bsd-nat.h'.
53
    	(i386bsd_xsave_len): Rename and move to x86bsd-nat.c.
54
    	(i386bsd_fetch_inferior_registers): Replace 'i386bsd_xsave_len'
55
    	with 'x86bsd_xsave_len'.
56
    	(i386bsd_store_inferior_registers): Likewise.
57
    	(i386bsd_target): Inherit from x86bsd_target.
58
    	(i386bsd_dr_get): Rename and move to x86bsd-nat.c.
59
    	(i386bsd_dr_set): Likewise.
60
    	(i386bsd_dr_set_control): Likewise.
61
    	(i386bsd_dr_set_addr): Likewise.
62
    	(i386bsd_dr_get_addr): Likewise.
63
    	(i386bsd_dr_get_status): Likewise.
64
    	(i386bsd_dr_get_control): Likewise.
65
    	* i386bsd-nat.h (i386bsd_xsave_len): Remove.
66
    	(i386bsd_dr_set_control): Remove.
67
    	(i386bsd_dr_set_addr): Remove.
68
    	(i386bsd_dr_get_addr): Remove.
69
    	(i386bsd_dr_get_status): Remove.
70
    	(i386bsd_dr_get_control): Remove.
71
    	* i386fbsd-nat.c: Include 'x86bsd-nat.h'.
72
    	(i386fbsd_read_description): Replace 'i386bsd_xsave_len' with
73
    	'x86bsd_xsave_len'.
74
    	(_initialize_i386fbsd_nat): Remove x86 watchpoint setup and
75
    	mourn_inferior' target op.
76
    	* x86bsd-nat.c: New file.
77
    	* x86bsd-nat.h: New file.
78
79
diff --git gdb/Makefile.in gdb/Makefile.in
80
index 16d5f27..5af6103 100644
81
--- gdb/Makefile.in
82
+++ gdb/Makefile.in
83
@@ -912,7 +912,7 @@ common/gdb_signals.h nat/gdb_thread_db.h common/gdb_vecs.h \
84
 common/x86-xstate.h nat/linux-ptrace.h nat/mips-linux-watch.h \
85
 proc-utils.h aarch64-tdep.h arm-tdep.h ax-gdb.h ppcfbsd-tdep.h \
86
 ppcnbsd-tdep.h cli-out.h gdb_expat.h breakpoint.h infcall.h obsd-tdep.h \
87
-exec.h m32r-tdep.h osabi.h gdbcore.h amd64bsd-nat.h \
88
+exec.h m32r-tdep.h osabi.h gdbcore.h x86bsd-nat.h \
89
 i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
90
 ia64-tdep.h ada-lang.h varobj.h varobj-iter.h frv-tdep.h \
91
 nto-tdep.h serial.h \
92
diff --git gdb/amd64bsd-nat.c gdb/amd64bsd-nat.c
93
index e278a91..b87672a 100644
94
--- gdb/amd64bsd-nat.c
95
+++ gdb/amd64bsd-nat.c
96
@@ -31,14 +31,10 @@
97
 
98
 #include "amd64-tdep.h"
99
 #include "amd64-nat.h"
100
-#include "amd64bsd-nat.h"
101
+#include "x86bsd-nat.h"
102
 #include "inf-ptrace.h"
103
 
104
 
105
-#ifdef PT_GETXSTATE_INFO
106
-size_t amd64bsd_xsave_len;
107
-#endif
108
-
109
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
110
    for all registers (including the floating-point registers).  */
111
 
112
@@ -67,9 +63,9 @@ amd64bsd_fetch_inferior_registers (struct target_ops *ops,
113
 #ifdef PT_GETXSTATE_INFO
114
       void *xstateregs;
115
 
116
-      if (amd64bsd_xsave_len != 0)
117
+      if (x86bsd_xsave_len != 0)
118
 	{
119
-	  xstateregs = alloca (amd64bsd_xsave_len);
120
+	  xstateregs = alloca (x86bsd_xsave_len);
121
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
122
 		      (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
123
 	    perror_with_name (_("Couldn't get extended state status"));
124
@@ -120,9 +116,9 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
125
 #ifdef PT_GETXSTATE_INFO
126
       void *xstateregs;
127
 
128
-      if (amd64bsd_xsave_len != 0)
129
+      if (x86bsd_xsave_len != 0)
130
 	{
131
-	  xstateregs = alloca (amd64bsd_xsave_len);
132
+	  xstateregs = alloca (x86bsd_xsave_len);
133
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
134
 		      (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
135
 	    perror_with_name (_("Couldn't get extended state status"));
136
@@ -130,7 +126,7 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
137
 	  amd64_collect_xsave (regcache, regnum, xstateregs, 0);
138
 
139
 	  if (ptrace (PT_SETXSTATE, get_ptrace_pid (inferior_ptid),
140
-		      (PTRACE_TYPE_ARG3) xstateregs, amd64bsd_xsave_len) == -1)
141
+		      (PTRACE_TYPE_ARG3) xstateregs, x86bsd_xsave_len) == -1)
142
 	    perror_with_name (_("Couldn't write extended state status"));
143
 	  return;
144
 	}
145
@@ -156,80 +152,8 @@ amd64bsd_target (void)
146
 {
147
   struct target_ops *t;
148
 
149
-  t = inf_ptrace_target ();
150
+  t = x86bsd_target ();
151
   t->to_fetch_registers = amd64bsd_fetch_inferior_registers;
152
   t->to_store_registers = amd64bsd_store_inferior_registers;
153
   return t;
154
 }
155
-
156
-
157
-/* Support for debug registers.  */
158
-
159
-#ifdef HAVE_PT_GETDBREGS
160
-
161
-static unsigned long
162
-amd64bsd_dr_get (ptid_t ptid, int regnum)
163
-{
164
-  struct dbreg dbregs;
165
-
166
-  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
167
-	      (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
168
-    perror_with_name (_("Couldn't read debug registers"));
169
-
170
-  return DBREG_DRX ((&dbregs), regnum);
171
-}
172
-
173
-static void
174
-amd64bsd_dr_set (int regnum, unsigned long value)
175
-{
176
-  struct dbreg dbregs;
177
-
178
-  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
179
-              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
180
-    perror_with_name (_("Couldn't get debug registers"));
181
-
182
-  /* For some mysterious reason, some of the reserved bits in the
183
-     debug control register get set.  Mask these off, otherwise the
184
-     ptrace call below will fail.  */
185
-  DBREG_DRX ((&dbregs), 7) &= ~(0xffffffff0000fc00);
186
-
187
-  DBREG_DRX ((&dbregs), regnum) = value;
188
-
189
-  if (ptrace (PT_SETDBREGS, get_ptrace_pid (inferior_ptid),
190
-              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
191
-    perror_with_name (_("Couldn't write debug registers"));
192
-}
193
-
194
-void
195
-amd64bsd_dr_set_control (unsigned long control)
196
-{
197
-  amd64bsd_dr_set (7, control);
198
-}
199
-
200
-void
201
-amd64bsd_dr_set_addr (int regnum, CORE_ADDR addr)
202
-{
203
-  gdb_assert (regnum >= 0 && regnum <= 4);
204
-
205
-  amd64bsd_dr_set (regnum, addr);
206
-}
207
-
208
-CORE_ADDR
209
-amd64bsd_dr_get_addr (int regnum)
210
-{
211
-  return amd64bsd_dr_get (inferior_ptid, regnum);
212
-}
213
-
214
-unsigned long
215
-amd64bsd_dr_get_status (void)
216
-{
217
-  return amd64bsd_dr_get (inferior_ptid, 6);
218
-}
219
-
220
-unsigned long
221
-amd64bsd_dr_get_control (void)
222
-{
223
-  return amd64bsd_dr_get (inferior_ptid, 7);
224
-}
225
-
226
-#endif /* PT_GETDBREGS */
227
diff --git gdb/amd64bsd-nat.h gdb/amd64bsd-nat.h
228
deleted file mode 100644
229
index f6a4022..0000000
230
--- gdb/amd64bsd-nat.h
231
+++ /dev/null
232
@@ -1,38 +0,0 @@
233
-/* Native-dependent code for AMD64 BSD's.
234
-
235
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
236
-
237
-   This file is part of GDB.
238
-
239
-   This program is free software; you can redistribute it and/or modify
240
-   it under the terms of the GNU General Public License as published by
241
-   the Free Software Foundation; either version 3 of the License, or
242
-   (at your option) any later version.
243
-
244
-   This program is distributed in the hope that it will be useful,
245
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
246
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
247
-   GNU General Public License for more details.
248
-
249
-   You should have received a copy of the GNU General Public License
250
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
251
-
252
-#ifndef AMD64BSD_NAT_H
253
-#define AMD64BSD_NAT_H
254
-
255
-/* Low level amd64 XSAVE info.  */
256
-extern size_t amd64bsd_xsave_len;
257
-
258
-/* Low level amd64 debug register functions.  */
259
-
260
-extern void amd64bsd_dr_set_control (unsigned long control);
261
-
262
-extern void amd64bsd_dr_set_addr (int regnum, CORE_ADDR addr);
263
-
264
-extern CORE_ADDR amd64bsd_dr_get_addr (int regnum);
265
-
266
-extern unsigned long amd64bsd_dr_get_status (void);
267
-
268
-extern unsigned long amd64bsd_dr_get_control (void);
269
-
270
-#endif /* amd64bsd-nat.h */
271
diff --git gdb/amd64fbsd-nat.c gdb/amd64fbsd-nat.c
272
index 63a7197..66c374c 100644
273
--- gdb/amd64fbsd-nat.c
274
+++ gdb/amd64fbsd-nat.c
275
@@ -32,7 +32,7 @@
276
 #include "fbsd-nat.h"
277
 #include "amd64-tdep.h"
278
 #include "amd64-nat.h"
279
-#include "amd64bsd-nat.h"
280
+#include "x86bsd-nat.h"
281
 #include "x86-nat.h"
282
 
283
 
284
@@ -140,17 +140,6 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
285
 }
286
 
287
 
288
-static void (*super_mourn_inferior) (struct target_ops *ops);
289
-
290
-static void
291
-amd64fbsd_mourn_inferior (struct target_ops *ops)
292
-{
293
-#ifdef HAVE_PT_GETDBREGS
294
-  x86_cleanup_dregs ();
295
-#endif
296
-  super_mourn_inferior (ops);
297
-}
298
-
299
 /* Implement the to_read_description method.  */
300
 
301
 static const struct target_desc *
302
@@ -175,13 +164,13 @@ amd64fbsd_read_description (struct target_ops *ops)
303
       if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid),
304
 		  (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0)
305
 	{
306
-	  amd64bsd_xsave_len = info.xsave_len;
307
+	  x86bsd_xsave_len = info.xsave_len;
308
 	  xcr0 = info.xsave_mask;
309
 	}
310
       xsave_probed = 1;
311
     }
312
 
313
-  if (amd64bsd_xsave_len != 0)
314
+  if (x86bsd_xsave_len != 0)
315
     {
316
       if (is64)
317
 	return amd64_target_description (xcr0);
318
@@ -209,22 +198,6 @@ _initialize_amd64fbsd_nat (void)
319
 
320
   /* Add some extra features to the common *BSD/i386 target.  */
321
   t = amd64bsd_target ();
322
-
323
-#ifdef HAVE_PT_GETDBREGS
324
-
325
-  x86_use_watchpoints (t);
326
-
327
-  x86_dr_low.set_control = amd64bsd_dr_set_control;
328
-  x86_dr_low.set_addr = amd64bsd_dr_set_addr;
329
-  x86_dr_low.get_addr = amd64bsd_dr_get_addr;
330
-  x86_dr_low.get_status = amd64bsd_dr_get_status;
331
-  x86_dr_low.get_control = amd64bsd_dr_get_control;
332
-  x86_set_debug_register_length (8);
333
-
334
-#endif /* HAVE_PT_GETDBREGS */
335
-
336
-  super_mourn_inferior = t->to_mourn_inferior;
337
-  t->to_mourn_inferior = amd64fbsd_mourn_inferior;
338
   t->to_read_description = amd64fbsd_read_description;
339
 
340
   fbsd_nat_add_target (t);
341
diff --git gdb/config/i386/fbsd.mh gdb/config/i386/fbsd.mh
342
index e5bff3a..1db6660 100644
343
--- gdb/config/i386/fbsd.mh
344
+++ gdb/config/i386/fbsd.mh
345
@@ -1,7 +1,7 @@
346
 # Host: FreeBSD/i386
347
 NATDEPFILES= fork-child.o inf-ptrace.o \
348
-	fbsd-nat.o x86-nat.o x86-dregs.o i386bsd-nat.o i386fbsd-nat.o \
349
-	bsd-kvm.o
350
+	fbsd-nat.o x86-nat.o x86-dregs.o x86bsd-nat.o i386bsd-nat.o \
351
+	i386fbsd-nat.o bsd-kvm.o
352
 NAT_FILE= nm-fbsd.h
353
 HAVE_NATIVE_GCORE_HOST = 1
354
 
355
diff --git gdb/config/i386/fbsd64.mh gdb/config/i386/fbsd64.mh
356
index 329c526..e196c00 100644
357
--- gdb/config/i386/fbsd64.mh
358
+++ gdb/config/i386/fbsd64.mh
359
@@ -1,7 +1,7 @@
360
 # Host: FreeBSD/amd64
361
 NATDEPFILES= fork-child.o inf-ptrace.o \
362
 	fbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
363
-	bsd-kvm.o x86-nat.o x86-dregs.o
364
+	bsd-kvm.o x86-nat.o x86-dregs.o x86bsd-nat.o
365
 HAVE_NATIVE_GCORE_HOST = 1
366
 
367
 LOADLIBES= -lkvm
368
diff --git gdb/config/i386/nbsd64.mh gdb/config/i386/nbsd64.mh
369
index 5de8cf5..5fa369f 100644
370
--- gdb/config/i386/nbsd64.mh
371
+++ gdb/config/i386/nbsd64.mh
372
@@ -1,3 +1,3 @@
373
 # Host: NetBSD/amd64
374
 NATDEPFILES= fork-child.o inf-ptrace.o \
375
-	nbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
376
+	nbsd-nat.o amd64-nat.o x86bsd-nat.o amd64bsd-nat.o amd64nbsd-nat.o
377
diff --git gdb/config/i386/nbsdelf.mh gdb/config/i386/nbsdelf.mh
378
index d27c842..f8b9d6c 100644
379
--- gdb/config/i386/nbsdelf.mh
380
+++ gdb/config/i386/nbsdelf.mh
381
@@ -1,5 +1,5 @@
382
 # Host: NetBSD/i386 ELF
383
 NATDEPFILES= fork-child.o inf-ptrace.o \
384
-	nbsd-nat.o i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
385
+	nbsd-nat.o x86bsd-nat.o i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
386
 
387
 LOADLIBES= -lkvm
388
diff --git gdb/config/i386/obsd.mh gdb/config/i386/obsd.mh
389
index a9041f4..3845d26 100644
390
--- gdb/config/i386/obsd.mh
391
+++ gdb/config/i386/obsd.mh
392
@@ -1,5 +1,5 @@
393
 # Host: OpenBSD/i386 ELF
394
 NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
395
-	i386bsd-nat.o i386obsd-nat.o bsd-kvm.o
396
+	x86bsd-nat.o i386bsd-nat.o i386obsd-nat.o bsd-kvm.o
397
 
398
 LOADLIBES= -lkvm
399
diff --git gdb/config/i386/obsd64.mh gdb/config/i386/obsd64.mh
400
index 386a582..2a8c42c 100644
401
--- gdb/config/i386/obsd64.mh
402
+++ gdb/config/i386/obsd64.mh
403
@@ -1,5 +1,5 @@
404
 # Host: OpenBSD/amd64
405
 NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
406
-	amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
407
+	amd64-nat.o x86bsd-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
408
 
409
 LOADLIBES= -lkvm
410
diff --git gdb/i386bsd-nat.c gdb/i386bsd-nat.c
411
index f5f4a0f..b6b143b 100644
412
--- gdb/i386bsd-nat.c
413
+++ gdb/i386bsd-nat.c
414
@@ -29,6 +29,7 @@
415
 
416
 #include "i386-tdep.h"
417
 #include "i387-tdep.h"
418
+#include "x86bsd-nat.h"
419
 #include "i386bsd-nat.h"
420
 #include "inf-ptrace.h"
421
 
422
@@ -81,10 +82,6 @@ static int i386bsd_r_reg_offset[] =
423
    so that we try PT_GETXMMREGS the first time around.  */
424
 static int have_ptrace_xmmregs = -1;
425
 #endif
426
-
427
-#ifdef PT_GETXSTATE_INFO
428
-size_t i386bsd_xsave_len;
429
-#endif
430
 
431
 
432
 /* Supply the general-purpose registers in GREGS, to REGCACHE.  */
433
@@ -155,11 +152,11 @@ i386bsd_fetch_inferior_registers (struct target_ops *ops,
434
 #endif
435
 
436
 #ifdef PT_GETXSTATE_INFO
437
-      if (i386bsd_xsave_len != 0)
438
+      if (x86bsd_xsave_len != 0)
439
 	{
440
 	  void *xstateregs;
441
 
442
-	  xstateregs = alloca (i386bsd_xsave_len);
443
+	  xstateregs = alloca (x86bsd_xsave_len);
444
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
445
 		      (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
446
 	    perror_with_name (_("Couldn't get extended state status"));
447
@@ -225,11 +222,11 @@ i386bsd_store_inferior_registers (struct target_ops *ops,
448
 #endif
449
 
450
 #ifdef PT_GETXSTATE_INFO
451
-      if (i386bsd_xsave_len != 0)
452
+      if (x86bsd_xsave_len != 0)
453
 	{
454
 	  void *xstateregs;
455
 
456
-	  xstateregs = alloca (i386bsd_xsave_len);
457
+	  xstateregs = alloca (x86bsd_xsave_len);
458
 	  if (ptrace (PT_GETXSTATE, get_ptrace_pid (inferior_ptid),
459
 		      (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
460
 	    perror_with_name (_("Couldn't get extended state status"));
461
@@ -237,7 +234,7 @@ i386bsd_store_inferior_registers (struct target_ops *ops,
462
 	  i387_collect_xsave (regcache, -1, xstateregs, 0);
463
 
464
 	  if (ptrace (PT_SETXSTATE, get_ptrace_pid (inferior_ptid),
465
-		      (PTRACE_TYPE_ARG3) xstateregs, i386bsd_xsave_len) == -1)
466
+		      (PTRACE_TYPE_ARG3) xstateregs, x86bsd_xsave_len) == -1)
467
 	    perror_with_name (_("Couldn't write extended state status"));
468
 	  return;
469
 	}
470
@@ -283,91 +280,13 @@ i386bsd_target (void)
471
 {
472
   struct target_ops *t;
473
 
474
-  t = inf_ptrace_target ();
475
+  t = x86bsd_target ();
476
   t->to_fetch_registers = i386bsd_fetch_inferior_registers;
477
   t->to_store_registers = i386bsd_store_inferior_registers;
478
   return t;
479
 }
480
 
481
 
482
-/* Support for debug registers.  */
483
-
484
-#ifdef HAVE_PT_GETDBREGS
485
-
486
-/* Not all versions of FreeBSD/i386 that support the debug registers
487
-   have this macro.  */
488
-#ifndef DBREG_DRX
489
-#define DBREG_DRX(d, x) ((&d->dr0)[x])
490
-#endif
491
-
492
-static unsigned long
493
-i386bsd_dr_get (ptid_t ptid, int regnum)
494
-{
495
-  struct dbreg dbregs;
496
-
497
-  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
498
-	      (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
499
-    perror_with_name (_("Couldn't read debug registers"));
500
-
501
-  return DBREG_DRX ((&dbregs), regnum);
502
-}
503
-
504
-static void
505
-i386bsd_dr_set (int regnum, unsigned int value)
506
-{
507
-  struct dbreg dbregs;
508
-
509
-  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
510
-              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
511
-    perror_with_name (_("Couldn't get debug registers"));
512
-
513
-  /* For some mysterious reason, some of the reserved bits in the
514
-     debug control register get set.  Mask these off, otherwise the
515
-     ptrace call below will fail.  */
516
-  DBREG_DRX ((&dbregs), 7) &= ~(0x0000fc00);
517
-
518
-  DBREG_DRX ((&dbregs), regnum) = value;
519
-
520
-  if (ptrace (PT_SETDBREGS, get_ptrace_pid (inferior_ptid),
521
-              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
522
-    perror_with_name (_("Couldn't write debug registers"));
523
-}
524
-
525
-void
526
-i386bsd_dr_set_control (unsigned long control)
527
-{
528
-  i386bsd_dr_set (7, control);
529
-}
530
-
531
-void
532
-i386bsd_dr_set_addr (int regnum, CORE_ADDR addr)
533
-{
534
-  gdb_assert (regnum >= 0 && regnum <= 4);
535
-
536
-  i386bsd_dr_set (regnum, addr);
537
-}
538
-
539
-CORE_ADDR
540
-i386bsd_dr_get_addr (int regnum)
541
-{
542
-  return i386bsd_dr_get (inferior_ptid, regnum);
543
-}
544
-
545
-unsigned long
546
-i386bsd_dr_get_status (void)
547
-{
548
-  return i386bsd_dr_get (inferior_ptid, 6);
549
-}
550
-
551
-unsigned long
552
-i386bsd_dr_get_control (void)
553
-{
554
-  return i386bsd_dr_get (inferior_ptid, 7);
555
-}
556
-
557
-#endif /* PT_GETDBREGS */
558
-
559
-
560
 /* Provide a prototype to silence -Wmissing-prototypes.  */
561
 void _initialize_i386bsd_nat (void);
562
 
563
diff --git gdb/i386bsd-nat.h gdb/i386bsd-nat.h
564
index 78ea551..1b51d19 100644
565
--- gdb/i386bsd-nat.h
566
+++ gdb/i386bsd-nat.h
567
@@ -25,19 +25,4 @@
568
 
569
 extern struct target_ops *i386bsd_target (void);
570
 
571
-/* Low level i386 XSAVE info.  */
572
-extern size_t i386bsd_xsave_len;
573
-
574
-/* low level i386 debug register functions used in i386fbsd-nat.c.  */
575
-
576
-extern void i386bsd_dr_set_control (unsigned long control);
577
-
578
-extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr);
579
-
580
-extern CORE_ADDR i386bsd_dr_get_addr (int regnum);
581
-
582
-extern unsigned long i386bsd_dr_get_status (void);
583
-
584
-extern unsigned long i386bsd_dr_get_control (void);
585
-
586
 #endif /* i386bsd-nat.h */
587
diff --git gdb/i386fbsd-nat.c gdb/i386fbsd-nat.c
588
index 7d371a6..716b513 100644
589
--- gdb/i386fbsd-nat.c
590
+++ gdb/i386fbsd-nat.c
591
@@ -30,6 +30,7 @@
592
 #include "fbsd-nat.h"
593
 #include "i386-tdep.h"
594
 #include "x86-nat.h"
595
+#include "x86bsd-nat.h"
596
 #include "i386bsd-nat.h"
597
 
598
 /* Resume execution of the inferior process.  If STEP is nonzero,
599
@@ -132,13 +133,13 @@ i386fbsd_read_description (struct target_ops *ops)
600
       if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid),
601
 		  (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0)
602
 	{
603
-	  i386bsd_xsave_len = info.xsave_len;
604
+	  x86bsd_xsave_len = info.xsave_len;
605
 	  xcr0 = info.xsave_mask;
606
 	}
607
       xsave_probed = 1;
608
     }
609
 
610
-  if (i386bsd_xsave_len != 0)
611
+  if (x86bsd_xsave_len != 0)
612
     {
613
       return i386_target_description (xcr0);
614
     }
615
@@ -158,19 +159,6 @@ _initialize_i386fbsd_nat (void)
616
   /* Add some extra features to the common *BSD/i386 target.  */
617
   t = i386bsd_target ();
618
 
619
-#ifdef HAVE_PT_GETDBREGS
620
-
621
-  x86_use_watchpoints (t);
622
-
623
-  x86_dr_low.set_control = i386bsd_dr_set_control;
624
-  x86_dr_low.set_addr = i386bsd_dr_set_addr;
625
-  x86_dr_low.get_addr = i386bsd_dr_get_addr;
626
-  x86_dr_low.get_status = i386bsd_dr_get_status;
627
-  x86_dr_low.get_control = i386bsd_dr_get_control;
628
-  x86_set_debug_register_length (4);
629
-
630
-#endif /* HAVE_PT_GETDBREGS */
631
-
632
 #ifdef PT_GETXSTATE_INFO
633
   t->to_read_description = i386fbsd_read_description;
634
 #endif
635
diff --git gdb/x86bsd-nat.c gdb/x86bsd-nat.c
636
new file mode 100644
637
index 0000000..0c56848
638
--- /dev/null
639
+++ gdb/x86bsd-nat.c
640
@@ -0,0 +1,150 @@
641
+/* Native-dependent code for X86 BSD's.
642
+
643
+   Copyright (C) 2003-2016 Free Software Foundation, Inc.
644
+
645
+   This file is part of GDB.
646
+
647
+   This program is free software; you can redistribute it and/or modify
648
+   it under the terms of the GNU General Public License as published by
649
+   the Free Software Foundation; either version 3 of the License, or
650
+   (at your option) any later version.
651
+
652
+   This program is distributed in the hope that it will be useful,
653
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
654
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
655
+   GNU General Public License for more details.
656
+
657
+   You should have received a copy of the GNU General Public License
658
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
659
+
660
+#include "defs.h"
661
+#include "inferior.h"
662
+
663
+/* We include <signal.h> to make sure `struct fxsave64' is defined on
664
+   NetBSD, since NetBSD's <machine/reg.h> needs it.  */
665
+#include <signal.h>
666
+#include <sys/types.h>
667
+#include <sys/ptrace.h>
668
+#include <machine/reg.h>
669
+
670
+#include "x86-nat.h"
671
+#include "x86bsd-nat.h"
672
+#include "inf-ptrace.h"
673
+
674
+
675
+#ifdef PT_GETXSTATE_INFO
676
+size_t x86bsd_xsave_len;
677
+#endif
678
+
679
+/* Support for debug registers.  */
680
+
681
+#ifdef HAVE_PT_GETDBREGS
682
+static void (*super_mourn_inferior) (struct target_ops *ops);
683
+
684
+/* Implement the "to_mourn_inferior" target_ops method.  */
685
+
686
+static void
687
+x86bsd_mourn_inferior (struct target_ops *ops)
688
+{
689
+  x86_cleanup_dregs ();
690
+  super_mourn_inferior (ops);
691
+}
692
+
693
+/* Not all versions of FreeBSD/i386 that support the debug registers
694
+   have this macro.  */
695
+#ifndef DBREG_DRX
696
+#define DBREG_DRX(d, x) ((&d->dr0)[x])
697
+#endif
698
+
699
+static unsigned long
700
+x86bsd_dr_get (ptid_t ptid, int regnum)
701
+{
702
+  struct dbreg dbregs;
703
+
704
+  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
705
+	      (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
706
+    perror_with_name (_("Couldn't read debug registers"));
707
+
708
+  return DBREG_DRX ((&dbregs), regnum);
709
+}
710
+
711
+static void
712
+x86bsd_dr_set (int regnum, unsigned long value)
713
+{
714
+  struct dbreg dbregs;
715
+
716
+  if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
717
+              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
718
+    perror_with_name (_("Couldn't get debug registers"));
719
+
720
+  /* For some mysterious reason, some of the reserved bits in the
721
+     debug control register get set.  Mask these off, otherwise the
722
+     ptrace call below will fail.  */
723
+  DBREG_DRX ((&dbregs), 7) &= ~(0xffffffff0000fc00);
724
+
725
+  DBREG_DRX ((&dbregs), regnum) = value;
726
+
727
+  if (ptrace (PT_SETDBREGS, get_ptrace_pid (inferior_ptid),
728
+              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
729
+    perror_with_name (_("Couldn't write debug registers"));
730
+}
731
+
732
+static void
733
+x86bsd_dr_set_control (unsigned long control)
734
+{
735
+  x86bsd_dr_set (7, control);
736
+}
737
+
738
+static void
739
+x86bsd_dr_set_addr (int regnum, CORE_ADDR addr)
740
+{
741
+  gdb_assert (regnum >= 0 && regnum <= 4);
742
+
743
+  x86bsd_dr_set (regnum, addr);
744
+}
745
+
746
+static CORE_ADDR
747
+x86bsd_dr_get_addr (int regnum)
748
+{
749
+  return x86bsd_dr_get (inferior_ptid, regnum);
750
+}
751
+
752
+static unsigned long
753
+x86bsd_dr_get_status (void)
754
+{
755
+  return x86bsd_dr_get (inferior_ptid, 6);
756
+}
757
+
758
+static unsigned long
759
+x86bsd_dr_get_control (void)
760
+{
761
+  return x86bsd_dr_get (inferior_ptid, 7);
762
+}
763
+
764
+#endif /* PT_GETDBREGS */
765
+
766
+/* Create a prototype *BSD/x86 target.  The client can override it
767
+   with local methods.  */
768
+
769
+struct target_ops *
770
+x86bsd_target (void)
771
+{
772
+  struct target_ops *t;
773
+
774
+  t = inf_ptrace_target ();
775
+
776
+#ifdef HAVE_PT_GETDBREGS
777
+  x86_use_watchpoints (t);
778
+
779
+  x86_dr_low.set_control = x86bsd_dr_set_control;
780
+  x86_dr_low.set_addr = x86bsd_dr_set_addr;
781
+  x86_dr_low.get_addr = x86bsd_dr_get_addr;
782
+  x86_dr_low.get_status = x86bsd_dr_get_status;
783
+  x86_dr_low.get_control = x86bsd_dr_get_control;
784
+  x86_set_debug_register_length (sizeof (void *));
785
+  super_mourn_inferior = t->to_mourn_inferior;
786
+  t->to_mourn_inferior = x86bsd_mourn_inferior;
787
+#endif /* HAVE_PT_GETDBREGS */
788
+
789
+  return t;
790
+}
791
diff --git gdb/x86bsd-nat.h gdb/x86bsd-nat.h
792
new file mode 100644
793
index 0000000..6d39697
794
--- /dev/null
795
+++ gdb/x86bsd-nat.h
796
@@ -0,0 +1,31 @@
797
+/* Native-dependent code for x86 BSD's.
798
+
799
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
800
+
801
+   This file is part of GDB.
802
+
803
+   This program is free software; you can redistribute it and/or modify
804
+   it under the terms of the GNU General Public License as published by
805
+   the Free Software Foundation; either version 3 of the License, or
806
+   (at your option) any later version.
807
+
808
+   This program is distributed in the hope that it will be useful,
809
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
810
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
811
+   GNU General Public License for more details.
812
+
813
+   You should have received a copy of the GNU General Public License
814
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
815
+
816
+#ifndef X86BSD_NAT_H
817
+#define X86BSD_NAT_H
818
+
819
+/* Low level x86 XSAVE info.  */
820
+extern size_t x86bsd_xsave_len;
821
+
822
+/* Create a prototype *BSD/x86 target.  The client can override it
823
+   with local methods.  */
824
+
825
+extern struct target_ops *x86bsd_target (void);
826
+
827
+#endif /* x86bsd-nat.h */
(-)files/commit-aa1ed4a (+191 lines)
Line 0 Link Here
1
commit aa1ed4a93a2eb0fb90d274c15288f3aad1791f60
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sun Jun 12 08:56:31 2016 -0700
4
5
    Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes.
6
    
7
    Move parsing of FreeBSD-specific ELF core notes out of elfcore_grok_note
8
    into a new elfcore_grok_freebsd_note function.  Add core note grok routines
9
    for FreeBSD's psinfo and prstatus notes while here rather than depending
10
    on the native handling in elfcore_grok_note.
11
    
12
    bfd/ChangeLog:
13
    
14
    	* elf.c (elfcore_grok_note): Remove handling of NT_X86_XSTATE for
15
    	FreeBSD.  Remove case for NT_FREEBSD_THRMISC.
16
    	(elfcore_grok_freebsd_psinfo): New function.
17
    	(elfcore_grok_freebsd_prstatus): New function.
18
    	(elfcore_grok_freebsd_note): New function.
19
    	(elf_parse_notes): Use "elfcore_grok_freebsd_note" for "FreeBSD"
20
    	notes.
21
22
diff --git bfd/elf.c bfd/elf.c
23
index aaf2b53..cfcafaa 100644
24
--- bfd/elf.c
25
+++ bfd/elf.c
26
@@ -9327,9 +9327,6 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
27
       if (note->namesz == 6
28
 	  && strcmp (note->namedata, "LINUX") == 0)
29
 	return elfcore_grok_xstatereg (abfd, note);
30
-      else if (note->namesz == 8
31
-	  && strcmp (note->namedata, "FreeBSD") == 0)
32
-	return elfcore_grok_xstatereg (abfd, note);
33
       else
34
 	return TRUE;
35
 
36
@@ -9485,12 +9482,6 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
37
       return elfcore_make_note_pseudosection (abfd, ".note.linuxcore.siginfo",
38
 					      note);
39
 
40
-    case NT_FREEBSD_THRMISC:
41
-      if (note->namesz == 8
42
-	  && strcmp (note->namedata, "FreeBSD") == 0)
43
-	return elfcore_make_note_pseudosection (abfd, ".thrmisc", note);
44
-      else
45
-	return TRUE;
46
     }
47
 }
48
 
49
@@ -9556,6 +9547,134 @@ elfobj_grok_stapsdt_note (bfd *abfd, Elf_Internal_Note *note)
50
 }
51
 
52
 static bfd_boolean
53
+elfcore_grok_freebsd_psinfo (bfd *abfd, Elf_Internal_Note *note)
54
+{
55
+  size_t offset;
56
+
57
+  /* Check for version 1 in pr_version. */
58
+  if (bfd_h_get_32 (abfd, (bfd_byte *) note->descdata) != 1)
59
+    return FALSE;
60
+  offset = 4;
61
+
62
+  /* Skip over pr_psinfosz. */
63
+  switch (abfd->arch_info->bits_per_word)
64
+    {
65
+    case 32:
66
+      offset += 4;
67
+      break;
68
+
69
+    case 64:
70
+      offset += 4;	/* Padding before pr_psinfosz. */
71
+      offset += 8;
72
+      break;
73
+
74
+    default:
75
+      return FALSE;
76
+    }
77
+
78
+  /* pr_fname is PRFNAMESZ (16) + 1 bytes in size.  */
79
+  elf_tdata (abfd)->core->program
80
+    = _bfd_elfcore_strndup (abfd, note->descdata + offset, 17);
81
+  offset += 17;
82
+
83
+  /* pr_psargs is PRARGSZ (80) + 1 bytes in size.  */
84
+  elf_tdata (abfd)->core->command
85
+    = _bfd_elfcore_strndup (abfd, note->descdata + offset, 81);
86
+
87
+  return TRUE;
88
+}
89
+
90
+static bfd_boolean
91
+elfcore_grok_freebsd_prstatus (bfd *abfd, Elf_Internal_Note *note)
92
+{
93
+  size_t offset;
94
+  size_t size;
95
+
96
+  /* Check for version 1 in pr_version. */
97
+  if (bfd_h_get_32 (abfd, (bfd_byte *) note->descdata) != 1)
98
+    return FALSE;
99
+  offset = 4;
100
+
101
+  /* Skip over pr_statussz.  */
102
+  switch (abfd->arch_info->bits_per_word)
103
+    {
104
+    case 32:
105
+      offset += 4;
106
+      break;
107
+
108
+    case 64:
109
+      offset += 4;	/* Padding before pr_statussz. */
110
+      offset += 8;
111
+      break;
112
+
113
+    default:
114
+      return FALSE;
115
+    }
116
+
117
+  /* Extract size of pr_reg from pr_gregsetsz.  */
118
+  if (abfd->arch_info->bits_per_word == 32)
119
+    size = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + offset);
120
+  else
121
+    size = bfd_h_get_64 (abfd, (bfd_byte *) note->descdata + offset);
122
+
123
+  /* Skip over pr_gregsetsz and pr_fpregsetsz. */
124
+  offset += (abfd->arch_info->bits_per_word / 8) * 2;
125
+
126
+  /* Skip over pr_osreldate. */
127
+  offset += 4;
128
+
129
+  /* Read signal from pr_cursig. */
130
+  if (elf_tdata (abfd)->core->signal == 0)
131
+    elf_tdata (abfd)->core->signal
132
+      = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + offset);
133
+  offset += 4;
134
+
135
+  /* Read TID from pr_pid. */
136
+  elf_tdata (abfd)->core->lwpid
137
+      = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + offset);
138
+  offset += 4;
139
+
140
+  /* Padding before pr_reg. */
141
+  if (abfd->arch_info->bits_per_word == 64)
142
+    offset += 4;
143
+
144
+  /* Make a ".reg/999" section and a ".reg" section.  */
145
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
146
+					  size, note->descpos + offset);
147
+}
148
+
149
+static bfd_boolean
150
+elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note)
151
+{
152
+  switch (note->type)
153
+    {
154
+    case NT_PRSTATUS:
155
+      return elfcore_grok_freebsd_prstatus (abfd, note);
156
+
157
+    case NT_FPREGSET:
158
+      return elfcore_grok_prfpreg (abfd, note);
159
+
160
+    case NT_PRPSINFO:
161
+      return elfcore_grok_freebsd_psinfo (abfd, note);
162
+
163
+    case NT_FREEBSD_THRMISC:
164
+      if (note->namesz == 8)
165
+	return elfcore_make_note_pseudosection (abfd, ".thrmisc", note);
166
+      else
167
+	return TRUE;
168
+
169
+    case NT_X86_XSTATE:
170
+      if (note->namesz == 8)
171
+	return elfcore_grok_xstatereg (abfd, note);
172
+      else
173
+	return TRUE;
174
+
175
+    default:
176
+      return TRUE;
177
+    }
178
+}
179
+
180
+static bfd_boolean
181
 elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp)
182
 {
183
   char *cp;
184
@@ -10467,6 +10586,7 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
185
 	    grokers[] =
186
 	    {
187
 	      GROKER_ELEMENT ("", elfcore_grok_note),
188
+	      GROKER_ELEMENT ("FreeBSD", elfcore_grok_freebsd_note),
189
 	      GROKER_ELEMENT ("NetBSD-CORE", elfcore_grok_netbsd_note),
190
 	      GROKER_ELEMENT ( "OpenBSD", elfcore_grok_openbsd_note),
191
 	      GROKER_ELEMENT ("QNX", elfcore_grok_nto_note),
(-)files/commit-b00f86d (+34 lines)
Line 0 Link Here
1
commit b00f86d0720d2cf44f3edb6101682074da1abe5d
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Wed Jun 15 22:44:11 2016 -0700
4
5
    Add constants for FreeBSD-specific auxiliary vector entry types.
6
    
7
    include/ChangeLog:
8
    
9
    	* elf/common.h (AT_FREEBSD_EXECPATH, AT_FREEBSD_CANARY)
10
    	(AT_FREEBSD_CANARYLEN, AT_FREEBSD_OSRELDATE, AT_FREEBSD_NCPUS)
11
    	(AT_FREEBSD_PAGESIZES, AT_FREEBSD_PAGESIZESLEN)
12
    	(AT_FREEBSD_TIMEKEEP, AT_FREEBSD_STACKPROT): Define.
13
14
diff --git include/elf/common.h include/elf/common.h
15
index 087d876..d2da009d 100644
16
--- include/elf/common.h
17
+++ include/elf/common.h
18
@@ -1012,6 +1012,16 @@
19
 #define AT_L2_CACHESHAPE  36
20
 #define AT_L3_CACHESHAPE  37
21
 
22
+#define AT_FREEBSD_EXECPATH     15      /* Path to the executable. */
23
+#define AT_FREEBSD_CANARY       16      /* Canary for SSP. */
24
+#define AT_FREEBSD_CANARYLEN    17      /* Length of the canary. */
25
+#define AT_FREEBSD_OSRELDATE    18      /* OSRELDATE. */
26
+#define AT_FREEBSD_NCPUS        19      /* Number of CPUs. */
27
+#define AT_FREEBSD_PAGESIZES    20      /* Pagesizes. */
28
+#define AT_FREEBSD_PAGESIZESLEN 21      /* Number of pagesizes. */
29
+#define AT_FREEBSD_TIMEKEEP     22      /* Pointer to timehands. */
30
+#define AT_FREEBSD_STACKPROT    23      /* Initial stack protection. */
31
+
32
 #define AT_SUN_UID      2000    /* Effective user ID.  */
33
 #define AT_SUN_RUID     2001    /* Real user ID.  */
34
 #define AT_SUN_GID      2002    /* Effective group ID.  */
(-)files/commit-bb2a62e (+27 lines)
Line 0 Link Here
1
commit bb2a62e694953c099c41d49f59947d3d91cc7c27
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jun 24 18:24:21 2016 -0700
4
5
    Honor detach-on-fork on FreeBSD.
6
    
7
    Only detach from the new child process in the follow fork callback
8
    if detach_fork is true.
9
    
10
    gdb/ChangeLog:
11
    
12
    	* fbsd-nat.c (fbsd_follow_fork): Only detach child if
13
    	"detach_fork" is true.
14
15
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
16
index c9548e9..0999712 100644
17
--- gdb/fbsd-nat.c
18
+++ gdb/fbsd-nat.c
19
@@ -826,7 +826,7 @@ static int
20
 fbsd_follow_fork (struct target_ops *ops, int follow_child,
21
 			int detach_fork)
22
 {
23
-  if (!follow_child)
24
+  if (!follow_child && detach_fork)
25
     {
26
       struct thread_info *tp = inferior_thread ();
27
       pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid);
(-)files/commit-e6cdd38 (+644 lines)
Line 0 Link Here
1
commit e6cdd38e8f0fead14cd3c528e9a4b666e1871752
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Sun Jun 12 21:24:42 2016 -0700
4
5
    Add support for catching system calls to native FreeBSD targets.
6
    
7
    All platforms on FreeBSD use a shared system call table, so use a
8
    single XML file to describe the system calls available on each FreeBSD
9
    platform.
10
    
11
    Recent versions of FreeBSD include the identifier of the current
12
    system call when reporting a system call entry or exit event in the
13
    ptrace_lwpinfo structure obtained via PT_LWPINFO in fbsd_wait.  As
14
    such, FreeBSD native targets do not use the gdbarch method to fetch
15
    the system call code.  In addition, FreeBSD register sets fetched via
16
    ptrace do not include an equivalent of 'orig_rax' (on amd64 for
17
    example), so the system call code cannot be extracted from the
18
    available registers during a system call exit.  However, GDB assumes
19
    that system call catch points are not supported if the gdbarch method
20
    is not present.  As a workaround, FreeBSD ABIs install a dummy gdbarch
21
    method that throws an internal_error if it is ever invoked.
22
    
23
    gdb/ChangeLog:
24
    
25
    	* configure.ac: Check for support for system call LWP fields on
26
    	FreeBSD.
27
    	* config.in, configure: Rebuild.
28
    	* data-directory/Makefile.in (SYSCALLS_FILES): Add freebsd.xml.
29
    	* fbsd-nat.c (fbsd_wait) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
30
    	Report system call events.
31
    	[HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]
32
    	(fbsd_set_syscall_catchpoint): New function.
33
    	(fbsd_nat_add_target) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]:
34
    	Set "to_set_syscall_catchpoint" to "fbsd_set_syscall_catchpoint".
35
    	* fbsd-tdep.c: Include xml-syscall.h
36
    	(fbsd_get_syscall_number): New function.
37
    	(fbsd_init_abi): Set XML system call file name.
38
    	Add "get_syscall_number" gdbarch method.
39
    	* syscalls/freebsd.xml: New file.
40
41
diff --git gdb/config.in gdb/config.in
42
index 905caf0..c82a5b4 100644
43
--- gdb/config.in
44
+++ gdb/config.in
45
@@ -456,6 +456,9 @@
46
 /* Define to 1 if `struct ptrace_lwpinfo' is a member of `pl_tdname'. */
47
 #undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
48
 
49
+/* Define to 1 if `struct ptrace_lwpinfo' is a member of `pl_syscall_code'. */
50
+#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
51
+
52
 /* Define to 1 if your system has struct reg in <machine/reg.h>. */
53
 #undef HAVE_STRUCT_REG
54
 
55
diff --git gdb/configure gdb/configure
56
index 60ea884..ea11b50 100755
57
--- gdb/configure
58
+++ gdb/configure
59
@@ -12927,6 +12927,20 @@ _ACEOF
60
 fi
61
 
62
 
63
+# See if <sys/ptrace.h> supports syscall fields on FreeBSD.  The
64
+# pl_syscall_code member of `struct ptrace_lwpinfo' was added in
65
+# FreeBSD 10.3.
66
+ac_fn_c_check_member "$LINENO" "struct ptrace_lwpinfo" "pl_syscall_code" "ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" "#include <sys/ptrace.h>
67
+"
68
+if test "x$ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" = x""yes; then :
69
+
70
+cat >>confdefs.h <<_ACEOF
71
+#define HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE 1
72
+_ACEOF
73
+
74
+
75
+fi
76
+
77
 
78
 # Detect which type of /proc is in use, such as for Solaris.
79
 
80
diff --git gdb/configure.ac gdb/configure.ac
81
index 6a72f72..920c228 100644
82
--- gdb/configure.ac
83
+++ gdb/configure.ac
84
@@ -1526,6 +1526,11 @@ fi
85
 AC_CHECK_MEMBERS([struct ptrace_lwpinfo.pl_tdname], [], [],
86
                  [#include <sys/ptrace.h>])
87
 
88
+# See if <sys/ptrace.h> supports syscall fields on FreeBSD.  The
89
+# pl_syscall_code member of `struct ptrace_lwpinfo' was added in
90
+# FreeBSD 10.3.
91
+AC_CHECK_MEMBERS([struct ptrace_lwpinfo.pl_syscall_code], [], [],
92
+                 [#include <sys/ptrace.h>])
93
 
94
 # Detect which type of /proc is in use, such as for Solaris.
95
 
96
diff --git gdb/data-directory/Makefile.in gdb/data-directory/Makefile.in
97
index c05f379..0beca55 100644
98
--- gdb/data-directory/Makefile.in
99
+++ gdb/data-directory/Makefile.in
100
@@ -51,7 +51,8 @@ SYSCALLS_FILES = \
101
 	i386-linux.xml amd64-linux.xml \
102
 	sparc-linux.xml sparc64-linux.xml \
103
 	mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
104
-	s390-linux.xml s390x-linux.xml
105
+	s390-linux.xml s390x-linux.xml \
106
+	freebsd.xml
107
 
108
 PYTHON_DIR = python
109
 PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
110
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
111
index dc65e29..c9548e9 100644
112
--- gdb/fbsd-nat.c
113
+++ gdb/fbsd-nat.c
114
@@ -779,6 +779,40 @@ fbsd_wait (struct target_ops *ops,
115
 	      return wptid;
116
 	    }
117
 #endif
118
+
119
+	  /* Note that PL_FLAG_SCE is set for any event reported while
120
+	     a thread is executing a system call in the kernel.  In
121
+	     particular, signals that interrupt a sleep in a system
122
+	     call will report this flag as part of their event.  Stops
123
+	     explicitly for system call entry and exit always use
124
+	     SIGTRAP, so only treat SIGTRAP events as system call
125
+	     entry/exit events.  */
126
+	  if (pl.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)
127
+	      && ourstatus->value.sig == SIGTRAP)
128
+	    {
129
+#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
130
+	      if (catch_syscall_enabled ())
131
+		{
132
+		  if (catching_syscall_number (pl.pl_syscall_code))
133
+		    {
134
+		      if (pl.pl_flags & PL_FLAG_SCE)
135
+			ourstatus->kind = TARGET_WAITKIND_SYSCALL_ENTRY;
136
+		      else
137
+			ourstatus->kind = TARGET_WAITKIND_SYSCALL_RETURN;
138
+		      ourstatus->value.syscall_number = pl.pl_syscall_code;
139
+		      return wptid;
140
+		    }
141
+		}
142
+#endif
143
+	      /* If the core isn't interested in this event, just
144
+		 continue the process explicitly and wait for another
145
+		 event.  Note that PT_SYSCALL is "sticky" on FreeBSD
146
+		 and once system call stops are enabled on a process
147
+		 it stops for all system call entries and exits.  */
148
+	      if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1)
149
+		perror_with_name (("ptrace"));
150
+	      continue;
151
+	    }
152
 	}
153
       return wptid;
154
     }
155
@@ -889,6 +923,19 @@ fbsd_remove_exec_catchpoint (struct target_ops *self, int pid)
156
   return 0;
157
 }
158
 #endif
159
+
160
+#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
161
+static int
162
+fbsd_set_syscall_catchpoint (struct target_ops *self, int pid, int needed,
163
+			     int any_count, int table_size, int *table)
164
+{
165
+
166
+  /* Ignore the arguments.  inf-ptrace.c will use PT_SYSCALL which
167
+     will catch all system call entries and exits.  The system calls
168
+     are filtered by GDB rather than the kernel.  */
169
+  return 0;
170
+}
171
+#endif
172
 #endif
173
 
174
 void
175
@@ -925,6 +972,9 @@ fbsd_nat_add_target (struct target_ops *t)
176
   t->to_insert_exec_catchpoint = fbsd_insert_exec_catchpoint;
177
   t->to_remove_exec_catchpoint = fbsd_remove_exec_catchpoint;
178
 #endif
179
+#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
180
+  t->to_set_syscall_catchpoint = fbsd_set_syscall_catchpoint;
181
+#endif
182
 #endif
183
   add_target (t);
184
 }
185
diff --git gdb/fbsd-tdep.c gdb/fbsd-tdep.c
186
index e8f8605..4329f97 100644
187
--- gdb/fbsd-tdep.c
188
+++ gdb/fbsd-tdep.c
189
@@ -24,6 +24,7 @@
190
 #include "regcache.h"
191
 #include "regset.h"
192
 #include "gdbthread.h"
193
+#include "xml-syscall.h"
194
 
195
 #include "elf-bfd.h"
196
 #include "fbsd-tdep.h"
197
@@ -317,6 +318,22 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
198
   fprint_auxv_entry (file, name, description, format, type, val);
199
 }
200
 
201
+/* Implement the "get_syscall_number" gdbarch method.  */
202
+
203
+static LONGEST
204
+fbsd_get_syscall_number (struct gdbarch *gdbarch,
205
+			 ptid_t ptid)
206
+{
207
+
208
+  /* FreeBSD doesn't use gdbarch_get_syscall_number since FreeBSD
209
+     native targets fetch the system call number from the
210
+     'pl_syscall_code' member of struct ptrace_lwpinfo in fbsd_wait.
211
+     However, system call catching requires this function to be
212
+     set.  */
213
+
214
+  internal_error (__FILE__, __LINE__, _("fbsd_get_sycall_number called"));
215
+}
216
+
217
 /* To be called from GDB_OSABI_FREEBSD_ELF handlers. */
218
 
219
 void
220
@@ -326,4 +343,8 @@ fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
221
   set_gdbarch_core_thread_name (gdbarch, fbsd_core_thread_name);
222
   set_gdbarch_make_corefile_notes (gdbarch, fbsd_make_corefile_notes);
223
   set_gdbarch_print_auxv_entry (gdbarch, fbsd_print_auxv_entry);
224
+
225
+  /* `catch syscall' */
226
+  set_xml_syscall_file_name (gdbarch, "syscalls/freebsd.xml");
227
+  set_gdbarch_get_syscall_number (gdbarch, fbsd_get_syscall_number);
228
 }
229
diff --git gdb/syscalls/freebsd.xml gdb/syscalls/freebsd.xml
230
new file mode 100644
231
index 0000000..fb7c38b
232
--- /dev/null
233
+++ gdb/syscalls/freebsd.xml
234
@@ -0,0 +1,410 @@
235
+<?xml version="1.0"?>
236
+<!-- Copyright (C) 2009-2016 Free Software Foundation, Inc.
237
+
238
+     Copying and distribution of this file, with or without modification,
239
+     are permitted in any medium without royalty provided the copyright
240
+     notice and this notice are preserved.  -->
241
+
242
+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
243
+
244
+<!-- This file was generated using the following file:
245
+
246
+     /usr/src/sys/sys/syscall.h
247
+
248
+     The file mentioned above belongs to the FreeBSD Kernel.  -->
249
+
250
+<syscalls_info>
251
+  <syscall name="syscall" number="0"/>
252
+  <syscall name="exit" number="1"/>
253
+  <syscall name="fork" number="2"/>
254
+  <syscall name="read" number="3"/>
255
+  <syscall name="write" number="4"/>
256
+  <syscall name="open" number="5"/>
257
+  <syscall name="close" number="6"/>
258
+  <syscall name="wait4" number="7"/>
259
+  <syscall name="link" number="9"/>
260
+  <syscall name="unlink" number="10"/>
261
+  <syscall name="chdir" number="12"/>
262
+  <syscall name="fchdir" number="13"/>
263
+  <syscall name="mknod" number="14"/>
264
+  <syscall name="chmod" number="15"/>
265
+  <syscall name="chown" number="16"/>
266
+  <syscall name="break" number="17"/>
267
+  <syscall name="getpid" number="20"/>
268
+  <syscall name="mount" number="21"/>
269
+  <syscall name="unmount" number="22"/>
270
+  <syscall name="setuid" number="23"/>
271
+  <syscall name="getuid" number="24"/>
272
+  <syscall name="geteuid" number="25"/>
273
+  <syscall name="ptrace" number="26"/>
274
+  <syscall name="recvmsg" number="27"/>
275
+  <syscall name="sendmsg" number="28"/>
276
+  <syscall name="recvfrom" number="29"/>
277
+  <syscall name="accept" number="30"/>
278
+  <syscall name="getpeername" number="31"/>
279
+  <syscall name="getsockname" number="32"/>
280
+  <syscall name="access" number="33"/>
281
+  <syscall name="chflags" number="34"/>
282
+  <syscall name="fchflags" number="35"/>
283
+  <syscall name="sync" number="36"/>
284
+  <syscall name="kill" number="37"/>
285
+  <syscall name="getppid" number="39"/>
286
+  <syscall name="dup" number="41"/>
287
+  <syscall name="pipe" number="42"/>
288
+  <syscall name="getegid" number="43"/>
289
+  <syscall name="profil" number="44"/>
290
+  <syscall name="ktrace" number="45"/>
291
+  <syscall name="getgid" number="47"/>
292
+  <syscall name="getlogin" number="49"/>
293
+  <syscall name="setlogin" number="50"/>
294
+  <syscall name="acct" number="51"/>
295
+  <syscall name="sigaltstack" number="53"/>
296
+  <syscall name="ioctl" number="54"/>
297
+  <syscall name="reboot" number="55"/>
298
+  <syscall name="revoke" number="56"/>
299
+  <syscall name="symlink" number="57"/>
300
+  <syscall name="readlink" number="58"/>
301
+  <syscall name="execve" number="59"/>
302
+  <syscall name="umask" number="60"/>
303
+  <syscall name="chroot" number="61"/>
304
+  <syscall name="msync" number="65"/>
305
+  <syscall name="vfork" number="66"/>
306
+  <syscall name="sbrk" number="69"/>
307
+  <syscall name="sstk" number="70"/>
308
+  <syscall name="vadvise" number="72"/>
309
+  <syscall name="munmap" number="73"/>
310
+  <syscall name="mprotect" number="74"/>
311
+  <syscall name="madvise" number="75"/>
312
+  <syscall name="mincore" number="78"/>
313
+  <syscall name="getgroups" number="79"/>
314
+  <syscall name="setgroups" number="80"/>
315
+  <syscall name="getpgrp" number="81"/>
316
+  <syscall name="setpgid" number="82"/>
317
+  <syscall name="setitimer" number="83"/>
318
+  <syscall name="swapon" number="85"/>
319
+  <syscall name="getitimer" number="86"/>
320
+  <syscall name="getdtablesize" number="89"/>
321
+  <syscall name="dup2" number="90"/>
322
+  <syscall name="fcntl" number="92"/>
323
+  <syscall name="select" number="93"/>
324
+  <syscall name="fsync" number="95"/>
325
+  <syscall name="setpriority" number="96"/>
326
+  <syscall name="socket" number="97"/>
327
+  <syscall name="connect" number="98"/>
328
+  <syscall name="getpriority" number="100"/>
329
+  <syscall name="bind" number="104"/>
330
+  <syscall name="setsockopt" number="105"/>
331
+  <syscall name="listen" number="106"/>
332
+  <syscall name="gettimeofday" number="116"/>
333
+  <syscall name="getrusage" number="117"/>
334
+  <syscall name="getsockopt" number="118"/>
335
+  <syscall name="readv" number="120"/>
336
+  <syscall name="writev" number="121"/>
337
+  <syscall name="settimeofday" number="122"/>
338
+  <syscall name="fchown" number="123"/>
339
+  <syscall name="fchmod" number="124"/>
340
+  <syscall name="setreuid" number="126"/>
341
+  <syscall name="setregid" number="127"/>
342
+  <syscall name="rename" number="128"/>
343
+  <syscall name="flock" number="131"/>
344
+  <syscall name="mkfifo" number="132"/>
345
+  <syscall name="sendto" number="133"/>
346
+  <syscall name="shutdown" number="134"/>
347
+  <syscall name="socketpair" number="135"/>
348
+  <syscall name="mkdir" number="136"/>
349
+  <syscall name="rmdir" number="137"/>
350
+  <syscall name="utimes" number="138"/>
351
+  <syscall name="adjtime" number="140"/>
352
+  <syscall name="setsid" number="147"/>
353
+  <syscall name="quotactl" number="148"/>
354
+  <syscall name="nlm_syscall" number="154"/>
355
+  <syscall name="nfssvc" number="155"/>
356
+  <syscall name="lgetfh" number="160"/>
357
+  <syscall name="getfh" number="161"/>
358
+  <syscall name="sysarch" number="165"/>
359
+  <syscall name="rtprio" number="166"/>
360
+  <syscall name="semsys" number="169"/>
361
+  <syscall name="msgsys" number="170"/>
362
+  <syscall name="shmsys" number="171"/>
363
+  <syscall name="setfib" number="175"/>
364
+  <syscall name="ntp_adjtime" number="176"/>
365
+  <syscall name="setgid" number="181"/>
366
+  <syscall name="setegid" number="182"/>
367
+  <syscall name="seteuid" number="183"/>
368
+  <syscall name="stat" number="188"/>
369
+  <syscall name="fstat" number="189"/>
370
+  <syscall name="lstat" number="190"/>
371
+  <syscall name="pathconf" number="191"/>
372
+  <syscall name="fpathconf" number="192"/>
373
+  <syscall name="getrlimit" number="194"/>
374
+  <syscall name="setrlimit" number="195"/>
375
+  <syscall name="getdirentries" number="196"/>
376
+  <syscall name="__syscall" number="198"/>
377
+  <syscall name="__sysctl" number="202"/>
378
+  <syscall name="mlock" number="203"/>
379
+  <syscall name="munlock" number="204"/>
380
+  <syscall name="undelete" number="205"/>
381
+  <syscall name="futimes" number="206"/>
382
+  <syscall name="getpgid" number="207"/>
383
+  <syscall name="poll" number="209"/>
384
+  <syscall name="freebsd7___semctl" number="220"/>
385
+  <syscall name="semget" number="221"/>
386
+  <syscall name="semop" number="222"/>
387
+  <syscall name="freebsd7_msgctl" number="224"/>
388
+  <syscall name="msgget" number="225"/>
389
+  <syscall name="msgsnd" number="226"/>
390
+  <syscall name="msgrcv" number="227"/>
391
+  <syscall name="shmat" number="228"/>
392
+  <syscall name="freebsd7_shmctl" number="229"/>
393
+  <syscall name="shmdt" number="230"/>
394
+  <syscall name="shmget" number="231"/>
395
+  <syscall name="clock_gettime" number="232"/>
396
+  <syscall name="clock_settime" number="233"/>
397
+  <syscall name="clock_getres" number="234"/>
398
+  <syscall name="ktimer_create" number="235"/>
399
+  <syscall name="ktimer_delete" number="236"/>
400
+  <syscall name="ktimer_settime" number="237"/>
401
+  <syscall name="ktimer_gettime" number="238"/>
402
+  <syscall name="ktimer_getoverrun" number="239"/>
403
+  <syscall name="nanosleep" number="240"/>
404
+  <syscall name="ffclock_getcounter" number="241"/>
405
+  <syscall name="ffclock_setestimate" number="242"/>
406
+  <syscall name="ffclock_getestimate" number="243"/>
407
+  <syscall name="clock_getcpuclockid2" number="247"/>
408
+  <syscall name="ntp_gettime" number="248"/>
409
+  <syscall name="minherit" number="250"/>
410
+  <syscall name="rfork" number="251"/>
411
+  <syscall name="openbsd_poll" number="252"/>
412
+  <syscall name="issetugid" number="253"/>
413
+  <syscall name="lchown" number="254"/>
414
+  <syscall name="aio_read" number="255"/>
415
+  <syscall name="aio_write" number="256"/>
416
+  <syscall name="lio_listio" number="257"/>
417
+  <syscall name="getdents" number="272"/>
418
+  <syscall name="lchmod" number="274"/>
419
+  <syscall name="netbsd_lchown" number="275"/>
420
+  <syscall name="lutimes" number="276"/>
421
+  <syscall name="netbsd_msync" number="277"/>
422
+  <syscall name="nstat" number="278"/>
423
+  <syscall name="nfstat" number="279"/>
424
+  <syscall name="nlstat" number="280"/>
425
+  <syscall name="preadv" number="289"/>
426
+  <syscall name="pwritev" number="290"/>
427
+  <syscall name="fhopen" number="298"/>
428
+  <syscall name="fhstat" number="299"/>
429
+  <syscall name="modnext" number="300"/>
430
+  <syscall name="modstat" number="301"/>
431
+  <syscall name="modfnext" number="302"/>
432
+  <syscall name="modfind" number="303"/>
433
+  <syscall name="kldload" number="304"/>
434
+  <syscall name="kldunload" number="305"/>
435
+  <syscall name="kldfind" number="306"/>
436
+  <syscall name="kldnext" number="307"/>
437
+  <syscall name="kldstat" number="308"/>
438
+  <syscall name="kldfirstmod" number="309"/>
439
+  <syscall name="getsid" number="310"/>
440
+  <syscall name="setresuid" number="311"/>
441
+  <syscall name="setresgid" number="312"/>
442
+  <syscall name="aio_return" number="314"/>
443
+  <syscall name="aio_suspend" number="315"/>
444
+  <syscall name="aio_cancel" number="316"/>
445
+  <syscall name="aio_error" number="317"/>
446
+  <syscall name="yield" number="321"/>
447
+  <syscall name="mlockall" number="324"/>
448
+  <syscall name="munlockall" number="325"/>
449
+  <syscall name="__getcwd" number="326"/>
450
+  <syscall name="sched_setparam" number="327"/>
451
+  <syscall name="sched_getparam" number="328"/>
452
+  <syscall name="sched_setscheduler" number="329"/>
453
+  <syscall name="sched_getscheduler" number="330"/>
454
+  <syscall name="sched_yield" number="331"/>
455
+  <syscall name="sched_get_priority_max" number="332"/>
456
+  <syscall name="sched_get_priority_min" number="333"/>
457
+  <syscall name="sched_rr_get_interval" number="334"/>
458
+  <syscall name="utrace" number="335"/>
459
+  <syscall name="kldsym" number="337"/>
460
+  <syscall name="jail" number="338"/>
461
+  <syscall name="nnpfs_syscall" number="339"/>
462
+  <syscall name="sigprocmask" number="340"/>
463
+  <syscall name="sigsuspend" number="341"/>
464
+  <syscall name="sigpending" number="343"/>
465
+  <syscall name="sigtimedwait" number="345"/>
466
+  <syscall name="sigwaitinfo" number="346"/>
467
+  <syscall name="__acl_get_file" number="347"/>
468
+  <syscall name="__acl_set_file" number="348"/>
469
+  <syscall name="__acl_get_fd" number="349"/>
470
+  <syscall name="__acl_set_fd" number="350"/>
471
+  <syscall name="__acl_delete_file" number="351"/>
472
+  <syscall name="__acl_delete_fd" number="352"/>
473
+  <syscall name="__acl_aclcheck_file" number="353"/>
474
+  <syscall name="__acl_aclcheck_fd" number="354"/>
475
+  <syscall name="extattrctl" number="355"/>
476
+  <syscall name="extattr_set_file" number="356"/>
477
+  <syscall name="extattr_get_file" number="357"/>
478
+  <syscall name="extattr_delete_file" number="358"/>
479
+  <syscall name="aio_waitcomplete" number="359"/>
480
+  <syscall name="getresuid" number="360"/>
481
+  <syscall name="getresgid" number="361"/>
482
+  <syscall name="kqueue" number="362"/>
483
+  <syscall name="kevent" number="363"/>
484
+  <syscall name="extattr_set_fd" number="371"/>
485
+  <syscall name="extattr_get_fd" number="372"/>
486
+  <syscall name="extattr_delete_fd" number="373"/>
487
+  <syscall name="__setugid" number="374"/>
488
+  <syscall name="eaccess" number="376"/>
489
+  <syscall name="afs3_syscall" number="377"/>
490
+  <syscall name="nmount" number="378"/>
491
+  <syscall name="__mac_get_proc" number="384"/>
492
+  <syscall name="__mac_set_proc" number="385"/>
493
+  <syscall name="__mac_get_fd" number="386"/>
494
+  <syscall name="__mac_get_file" number="387"/>
495
+  <syscall name="__mac_set_fd" number="388"/>
496
+  <syscall name="__mac_set_file" number="389"/>
497
+  <syscall name="kenv" number="390"/>
498
+  <syscall name="lchflags" number="391"/>
499
+  <syscall name="uuidgen" number="392"/>
500
+  <syscall name="sendfile" number="393"/>
501
+  <syscall name="mac_syscall" number="394"/>
502
+  <syscall name="getfsstat" number="395"/>
503
+  <syscall name="statfs" number="396"/>
504
+  <syscall name="fstatfs" number="397"/>
505
+  <syscall name="fhstatfs" number="398"/>
506
+  <syscall name="ksem_close" number="400"/>
507
+  <syscall name="ksem_post" number="401"/>
508
+  <syscall name="ksem_wait" number="402"/>
509
+  <syscall name="ksem_trywait" number="403"/>
510
+  <syscall name="ksem_init" number="404"/>
511
+  <syscall name="ksem_open" number="405"/>
512
+  <syscall name="ksem_unlink" number="406"/>
513
+  <syscall name="ksem_getvalue" number="407"/>
514
+  <syscall name="ksem_destroy" number="408"/>
515
+  <syscall name="__mac_get_pid" number="409"/>
516
+  <syscall name="__mac_get_link" number="410"/>
517
+  <syscall name="__mac_set_link" number="411"/>
518
+  <syscall name="extattr_set_link" number="412"/>
519
+  <syscall name="extattr_get_link" number="413"/>
520
+  <syscall name="extattr_delete_link" number="414"/>
521
+  <syscall name="__mac_execve" number="415"/>
522
+  <syscall name="sigaction" number="416"/>
523
+  <syscall name="sigreturn" number="417"/>
524
+  <syscall name="getcontext" number="421"/>
525
+  <syscall name="setcontext" number="422"/>
526
+  <syscall name="swapcontext" number="423"/>
527
+  <syscall name="swapoff" number="424"/>
528
+  <syscall name="__acl_get_link" number="425"/>
529
+  <syscall name="__acl_set_link" number="426"/>
530
+  <syscall name="__acl_delete_link" number="427"/>
531
+  <syscall name="__acl_aclcheck_link" number="428"/>
532
+  <syscall name="sigwait" number="429"/>
533
+  <syscall name="thr_create" number="430"/>
534
+  <syscall name="thr_exit" number="431"/>
535
+  <syscall name="thr_self" number="432"/>
536
+  <syscall name="thr_kill" number="433"/>
537
+  <syscall name="jail_attach" number="436"/>
538
+  <syscall name="extattr_list_fd" number="437"/>
539
+  <syscall name="extattr_list_file" number="438"/>
540
+  <syscall name="extattr_list_link" number="439"/>
541
+  <syscall name="ksem_timedwait" number="441"/>
542
+  <syscall name="thr_suspend" number="442"/>
543
+  <syscall name="thr_wake" number="443"/>
544
+  <syscall name="kldunloadf" number="444"/>
545
+  <syscall name="audit" number="445"/>
546
+  <syscall name="auditon" number="446"/>
547
+  <syscall name="getauid" number="447"/>
548
+  <syscall name="setauid" number="448"/>
549
+  <syscall name="getaudit" number="449"/>
550
+  <syscall name="setaudit" number="450"/>
551
+  <syscall name="getaudit_addr" number="451"/>
552
+  <syscall name="setaudit_addr" number="452"/>
553
+  <syscall name="auditctl" number="453"/>
554
+  <syscall name="_umtx_op" number="454"/>
555
+  <syscall name="thr_new" number="455"/>
556
+  <syscall name="sigqueue" number="456"/>
557
+  <syscall name="kmq_open" number="457"/>
558
+  <syscall name="kmq_setattr" number="458"/>
559
+  <syscall name="kmq_timedreceive" number="459"/>
560
+  <syscall name="kmq_timedsend" number="460"/>
561
+  <syscall name="kmq_notify" number="461"/>
562
+  <syscall name="kmq_unlink" number="462"/>
563
+  <syscall name="abort2" number="463"/>
564
+  <syscall name="thr_set_name" number="464"/>
565
+  <syscall name="aio_fsync" number="465"/>
566
+  <syscall name="rtprio_thread" number="466"/>
567
+  <syscall name="sctp_peeloff" number="471"/>
568
+  <syscall name="sctp_generic_sendmsg" number="472"/>
569
+  <syscall name="sctp_generic_sendmsg_iov" number="473"/>
570
+  <syscall name="sctp_generic_recvmsg" number="474"/>
571
+  <syscall name="pread" number="475"/>
572
+  <syscall name="pwrite" number="476"/>
573
+  <syscall name="mmap" number="477"/>
574
+  <syscall name="lseek" number="478"/>
575
+  <syscall name="truncate" number="479"/>
576
+  <syscall name="ftruncate" number="480"/>
577
+  <syscall name="thr_kill2" number="481"/>
578
+  <syscall name="shm_open" number="482"/>
579
+  <syscall name="shm_unlink" number="483"/>
580
+  <syscall name="cpuset" number="484"/>
581
+  <syscall name="cpuset_setid" number="485"/>
582
+  <syscall name="cpuset_getid" number="486"/>
583
+  <syscall name="cpuset_getaffinity" number="487"/>
584
+  <syscall name="cpuset_setaffinity" number="488"/>
585
+  <syscall name="faccessat" number="489"/>
586
+  <syscall name="fchmodat" number="490"/>
587
+  <syscall name="fchownat" number="491"/>
588
+  <syscall name="fexecve" number="492"/>
589
+  <syscall name="fstatat" number="493"/>
590
+  <syscall name="futimesat" number="494"/>
591
+  <syscall name="linkat" number="495"/>
592
+  <syscall name="mkdirat" number="496"/>
593
+  <syscall name="mkfifoat" number="497"/>
594
+  <syscall name="mknodat" number="498"/>
595
+  <syscall name="openat" number="499"/>
596
+  <syscall name="readlinkat" number="500"/>
597
+  <syscall name="renameat" number="501"/>
598
+  <syscall name="symlinkat" number="502"/>
599
+  <syscall name="unlinkat" number="503"/>
600
+  <syscall name="posix_openpt" number="504"/>
601
+  <syscall name="gssd_syscall" number="505"/>
602
+  <syscall name="jail_get" number="506"/>
603
+  <syscall name="jail_set" number="507"/>
604
+  <syscall name="jail_remove" number="508"/>
605
+  <syscall name="closefrom" number="509"/>
606
+  <syscall name="__semctl" number="510"/>
607
+  <syscall name="msgctl" number="511"/>
608
+  <syscall name="shmctl" number="512"/>
609
+  <syscall name="lpathconf" number="513"/>
610
+  <syscall name="__cap_rights_get" number="515"/>
611
+  <syscall name="cap_enter" number="516"/>
612
+  <syscall name="cap_getmode" number="517"/>
613
+  <syscall name="pdfork" number="518"/>
614
+  <syscall name="pdkill" number="519"/>
615
+  <syscall name="pdgetpid" number="520"/>
616
+  <syscall name="pselect" number="522"/>
617
+  <syscall name="getloginclass" number="523"/>
618
+  <syscall name="setloginclass" number="524"/>
619
+  <syscall name="rctl_get_racct" number="525"/>
620
+  <syscall name="rctl_get_rules" number="526"/>
621
+  <syscall name="rctl_get_limits" number="527"/>
622
+  <syscall name="rctl_add_rule" number="528"/>
623
+  <syscall name="rctl_remove_rule" number="529"/>
624
+  <syscall name="posix_fallocate" number="530"/>
625
+  <syscall name="posix_fadvise" number="531"/>
626
+  <syscall name="wait6" number="532"/>
627
+  <syscall name="cap_rights_limit" number="533"/>
628
+  <syscall name="cap_ioctls_limit" number="534"/>
629
+  <syscall name="cap_ioctls_get" number="535"/>
630
+  <syscall name="cap_fcntls_limit" number="536"/>
631
+  <syscall name="cap_fcntls_get" number="537"/>
632
+  <syscall name="bindat" number="538"/>
633
+  <syscall name="connectat" number="539"/>
634
+  <syscall name="chflagsat" number="540"/>
635
+  <syscall name="accept4" number="541"/>
636
+  <syscall name="pipe2" number="542"/>
637
+  <syscall name="aio_mlock" number="543"/>
638
+  <syscall name="procctl" number="544"/>
639
+  <syscall name="ppoll" number="545"/>
640
+  <syscall name="futimens" number="546"/>
641
+  <syscall name="utimensat" number="547"/>
642
+  <syscall name="numa_getaffinity" number="548"/>
643
+  <syscall name="numa_setaffinity" number="549"/>
644
+</syscalls_info>
(-)files/commit-ee95032 (+24 lines)
Line 0 Link Here
1
commit ee950322ca2c77494b1742f304632f667ed6ce79
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jul 1 10:18:50 2016 -0700
4
5
    Use 'ptid_t' instead of 'ptid' for fbsd_next_vfork_done's return type.
6
    
7
    'ptid' compiles in C++, but not C.
8
    
9
    gdb/ChangeLog:
10
    	* fbsd-nat.c (fbsd_is_vfork_done_pending): Fix return type.
11
12
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
13
index fcb7ff5..fa9516e 100644
14
--- gdb/fbsd-nat.c
15
+++ gdb/fbsd-nat.c
16
@@ -609,7 +609,7 @@ fbsd_is_vfork_done_pending (pid_t pid)
17
 /* Check for a pending vfork done event.  If one is found, remove it
18
    from the list and return the PTID.  */
19
 
20
-static ptid
21
+static ptid_t
22
 fbsd_next_vfork_done (void)
23
 {
24
   struct fbsd_fork_info *info;
(-)files/commit-xxxxxxx (+38 lines)
Line 0 Link Here
1
commit ba0383f93263a9f4251d050f929478de102b1023
2
Author: John Baldwin <jhb@FreeBSD.org>
3
Date:   Fri Jul 1 10:18:50 2016 -0700
4
5
    Use 'ptid_t' instead of 'ptid' for fbsd_next_vfork_done's return type.
6
    
7
    'ptid' compiles in C++, but not C.
8
    
9
    gdb/ChangeLog:
10
    	* fbsd-nat.c (fbsd_is_vfork_done_pending): Fix return type.
11
12
diff --git gdb/ChangeLog gdb/ChangeLog
13
index 58c9c78..e959c8c 100644
14
--- gdb/ChangeLog
15
+++ gdb/ChangeLog
16
@@ -1,5 +1,9 @@
17
 2016-07-01  John Baldwin  <jhb@FreeBSD.org>
18
 
19
+	* fbsd-nat.c (fbsd_is_vfork_done_pending): Fix return type.
20
+
21
+2016-07-01  John Baldwin  <jhb@FreeBSD.org>
22
+
23
 	* fbsd-nat.c (struct fbsd_fork_child_info): Rename to ...
24
 	(struct fbsd_fork_info): ... this.
25
 	(struct fbsd_fork_info) <child>: Rename to ...
26
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
27
index fcb7ff5..fa9516e 100644
28
--- gdb/fbsd-nat.c
29
+++ gdb/fbsd-nat.c
30
@@ -609,7 +609,7 @@ fbsd_is_vfork_done_pending (pid_t pid)
31
 /* Check for a pending vfork done event.  If one is found, remove it
32
    from the list and return the PTID.  */
33
 
34
-static ptid
35
+static ptid_t
36
 fbsd_next_vfork_done (void)
37
 {
38
   struct fbsd_fork_info *info;
(-)pkg-plist (+15 lines)
Lines 40-42 Link Here
40
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/support.scm
40
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/support.scm
41
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.go
41
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.go
42
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.scm
42
%%GUILE%%%%DATADIR%%%%VER%%/guile/gdb/types.scm
43
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/aarch64-linux.xml
44
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/amd64-linux.xml
45
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/arm-linux.xml
46
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/freebsd.xml
47
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/gdb-syscalls.dtd
48
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/i386-linux.xml
49
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/mips-n32-linux.xml
50
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/mips-n64-linux.xml
51
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/mips-o32-linux.xml
52
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/ppc-linux.xml
53
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/ppc64-linux.xml
54
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/s390-linux.xml
55
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/s390x-linux.xml
56
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/sparc-linux.xml
57
%%EXPAT%%%%DATADIR%%%%VER%%/syscalls/sparc64-linux.xml

Return to bug 210874