CVS commit: src/external/gpl3/gdb/dist/gnulib/import

2021-07-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jul  6 12:41:00 UTC 2021

Modified Files:
src/external/gpl3/gdb/dist/gnulib/import: canonicalize-lgpl.c

Log Message:
Remote -O0 hack for alpha; root cause has been addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c
diff -u src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.2 src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.3
--- src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.2	Sat May  8 12:23:47 2021
+++ src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c	Tue Jul  6 12:41:00 2021
@@ -114,13 +114,6 @@ alloc_failed (void)
holds the same value as the value returned.  */
 
 char *
-#ifdef __alpha__
-/*
- * toolchain/56153
- * GCC 10 and 9 miscompile malloca() macro for alpha.
- */
-__attribute__((optimize("O0")))
-#endif
 __realpath (const char *name, char *resolved)
 {
   char *rpath, *dest, *extra_buf = NULL;



CVS commit: src/external/gpl3/gdb/dist/gdb

2021-06-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jun  4 01:42:14 UTC 2021

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c

Log Message:
Add missing nbsd_init_abi() call to aarch64_nbsd_init_abi().

Fix tests/usr.bin/gdb/t_regress:pie on aarch64eb (types of auxv was
misinterpreted), and hopefully other strange behaviors on aarch64{,eb}.

This is a regression introduced in GDB11. Neither gdb.old nor release
branches are affected.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.7 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.7	Fri Dec 11 18:23:25 2020
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Jun  4 01:42:14 2021
@@ -182,6 +182,8 @@ aarch64_nbsd_init_abi (struct gdbarch_in
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
+  nbsd_init_abi (info, gdbarch);
+
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
 	 svr4_lp64_fetch_link_map_offsets);
 



CVS commit: src/external/gpl3/gdb/dist/gnulib/import

2021-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May  8 12:23:47 UTC 2021

Modified Files:
src/external/gpl3/gdb/dist/gnulib/import: canonicalize-lgpl.c

Log Message:
PR/56153: Rin Okuyama: alpha miscompiles malloca() macro.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c
diff -u src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.1.1.1 src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.2
--- src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c:1.1.1.1	Mon Sep 14 21:43:50 2020
+++ src/external/gpl3/gdb/dist/gnulib/import/canonicalize-lgpl.c	Sat May  8 08:23:47 2021
@@ -114,6 +114,13 @@ alloc_failed (void)
holds the same value as the value returned.  */
 
 char *
+#ifdef __alpha__
+/*
+ * toolchain/56153
+ * GCC 10 and 9 miscompile malloca() macro for alpha.
+ */
+__attribute__((optimize("O0")))
+#endif
 __realpath (const char *name, char *resolved)
 {
   char *rpath, *dest, *extra_buf = NULL;



CVS commit: src/external/gpl3/gdb/dist

2021-04-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 25 23:18:42 UTC 2021

Modified Files:
src/external/gpl3/gdb/dist: config.sub

Log Message:
add mipsn64 targets


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/config.sub

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/config.sub
diff -u src/external/gpl3/gdb/dist/config.sub:1.12 src/external/gpl3/gdb/dist/config.sub:1.13
--- src/external/gpl3/gdb/dist/config.sub:1.12	Mon Sep 14 22:05:15 2020
+++ src/external/gpl3/gdb/dist/config.sub	Sun Apr 25 19:18:42 2021
@@ -1191,6 +1191,7 @@ case $cpu-$vendor in
 			| mips | mipsbe | mipseb | mipsel | mipsle \
 			| mips16 \
 			| mips64 | mips64eb | mips64el \
+			| mipsn64 | mipsn64eb | mipsn64el \
 			| mips64octeon | mips64octeonel \
 			| mips64orion | mips64orionel \
 			| mips64r5900 | mips64r5900el \



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 14 12:34:07 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
Initialize namelen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/c-exp.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.3 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.4
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.3	Sun Dec 13 16:50:47 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Mon Dec 14 12:34:07 2020
@@ -2614,7 +2614,7 @@ get_namelen (const char *tokstart, bool 
   int c;
   int namelen;
 
-  for (c = tokstart[namelen];
+  for (namelen = 0, c = tokstart[namelen];
(c == '_' || c == '$' || (dot && c == '.') || c_ident_is_alnum (c) || c == '<');)
 {
   /* Template parameter lists are part of the name.



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 14 02:05:08 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Add some precautions for platforms without PT_STEP support.

"nat/gdb_ptrace.h" defines PT_STEP as 9, if it is not defined. nat-ptrace.c
depends on this; inf_ptrace_target::resume() uses PT_STEP unconditionally
when its ``step'' argument is non-zero. Therefore,

- Add comment that nbsd-nat.c should include  directly,
  instead of "nat/gdb_ptrace.h".

- Add gdb_assert(step == 0) in nbsd_nat_target::resume() ifndef PT_STEP,
  before calling inf_ptrace_target::resume().


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.21 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.22
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.21	Mon Dec 14 02:01:03 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Mon Dec 14 02:05:07 2020
@@ -27,6 +27,9 @@
 #include "gdbarch.h"
 
 #include 
+/* Use  directly, instead of "nat/gdb_ptrace.h".  Otherwise,
+   PT_STEP will be defined unintentionally, which breaks platforms without
+   PT_STEP support.  */
 #include 
 #include 
 #include 
@@ -539,6 +542,7 @@ nbsd_nat_target::resume (ptid_t ptid, in
 	nbsd_resume (this, ptid_t (inf->pid, 0, 0), step, signal);
 }
 #else
+gdb_assert(step == 0);
 if (ptid.pid () == -1)
   ptid = inferior_ptid;
 inf_ptrace_target::resume (ptid, step, signal); 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 14 02:01:03 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Revert previous as per request from kamil; now, arm/ptrace.h does not
expose unimplemented PT_STEP.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.20 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.21
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.20	Thu Dec 10 07:14:58 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Mon Dec 14 02:01:03 2020
@@ -458,7 +458,7 @@ nbsd_nat_target::info_proc (const char *
   return true;
 }
 
-#if defined(PT_STEP) && !defined(__arm__)
+#ifdef PT_STEP
 /* Resume execution of a specified PTID, that points to a process or a thread
within a process.  If one thread is specified, all other threads are
suspended.  If STEP is nonzero, single-step it.  If SIGNAL is nonzero,
@@ -530,7 +530,7 @@ nbsd_resume(nbsd_nat_target *target, pti
 void
 nbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
 {
-#if defined(PT_STEP) && !defined(__arm__)
+#ifdef PT_STEP
   if (minus_one_ptid != ptid)
 nbsd_resume (this, ptid, step, signal);
   else



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 13 16:50:47 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
Improve previous: generated names end with .[[:digits:]] so look for that
instead.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/c-exp.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.3
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2	Fri Dec 11 13:25:45 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Sun Dec 13 11:50:47 2020
@@ -2608,7 +2608,63 @@ static bool last_was_structop;
 /* Depth of parentheses.  */
 static int paren_depth;
 
-static const char PART[] = ".part.";
+static int
+get_namelen (const char *tokstart, bool dot)
+{
+  int c;
+  int namelen;
+
+  for (c = tokstart[namelen];
+   (c == '_' || c == '$' || (dot && c == '.') || c_ident_is_alnum (c) || c == '<');)
+{
+  /* Template parameter lists are part of the name.
+	 FIXME: This mishandles `print $a<4&&$a>3'.  */
+
+  if (c == '<')
+	{
+	  if (! is_cast_operator (tokstart, namelen))
+	{
+	  /* Scan ahead to get rest of the template specification.  Note
+		 that we look ahead only when the '<' adjoins non-whitespace
+		 characters; for comparison expressions, e.g. "a < b > c",
+		 there must be spaces before the '<', etc. */
+	  const char *p = find_template_name_end (tokstart + namelen);
+
+	  if (p)
+		namelen = p - tokstart;
+	}
+	  break;
+	}
+  c = tokstart[++namelen];
+}
+  return namelen;
+}
+
+static bool is_generated_symbol (const char *symbol)
+{
+  /* generated symbol are of the form:
+
+ .
+ .isra.
+ .part.
+
+So we see if the symbol ends with .
+   */
+
+  int len = get_namelen (symbol, true);
+  int ndigits;
+
+  if (len-- == 0)
+return false;
+
+  for (ndigits = 0; ndigits <= len && ISDIGIT(symbol[len - ndigits]); ndigits++)
+continue;
+
+  if (ndigits == 0)
+return false;
+
+  return symbol[len - ndigits] == '.';
+}
 
 /* Read one token, getting characters through lexptr.  */
 
@@ -2725,13 +2781,6 @@ lex_one_token (struct parser_state *par_
   return c;
 
 case '.':
-  /* Gross! recognize .part.N */
-  if (strncmp(pstate->lexptr, PART, sizeof(PART) - 1) == 0 &&
-	ISDIGIT(pstate->lexptr[sizeof(PART) - 1]) &&
-	pstate->lexptr[sizeof(PART)] == '\0')
-	{
-	  break;
-	}
   /* Might be a floating point number.  */
   if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
 	{
@@ -2895,30 +2944,7 @@ lex_one_token (struct parser_state *par_
 error (_("Invalid character '%c' in expression."), c);
 
   /* It's a name.  See how long it is.  */
-  namelen = 0;
-  for (c = tokstart[namelen];
-   (c == '_' || c == '$' || c == '.' || c_ident_is_alnum (c) || c == '<');)
-{
-  /* Template parameter lists are part of the name.
-	 FIXME: This mishandles `print $a<4&&$a>3'.  */
-
-  if (c == '<')
-	{
-	  if (! is_cast_operator (tokstart, namelen))
-	{
-	  /* Scan ahead to get rest of the template specification.  Note
-		 that we look ahead only when the '<' adjoins non-whitespace
-		 characters; for comparison expressions, e.g. "a < b > c",
-		 there must be spaces before the '<', etc. */
-	  const char *p = find_template_name_end (tokstart + namelen);
-
-	  if (p)
-		namelen = p - tokstart;
-	}
-	  break;
-	}
-  c = tokstart[++namelen];
-}
+  namelen = get_namelen (tokstart, is_generated_symbol (tokstart));
 
   /* The token "if" terminates the expression and is NOT removed from
  the input stream.  It doesn't count if it appears in the



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 11 18:25:45 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
PR/55851: Martin Husemann: recognize .part. names
This is gross; perhaps we should hide them completely (not print them
in stack traces etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/c-exp.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9	Mon Sep 14 21:43:28 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Fri Dec 11 13:25:45 2020
@@ -2608,6 +2608,8 @@ static bool last_was_structop;
 /* Depth of parentheses.  */
 static int paren_depth;
 
+static const char PART[] = ".part.";
+
 /* Read one token, getting characters through lexptr.  */
 
 static int
@@ -2723,6 +2725,13 @@ lex_one_token (struct parser_state *par_
   return c;
 
 case '.':
+  /* Gross! recognize .part.N */
+  if (strncmp(pstate->lexptr, PART, sizeof(PART) - 1) == 0 &&
+	ISDIGIT(pstate->lexptr[sizeof(PART) - 1]) &&
+	pstate->lexptr[sizeof(PART)] == '\0')
+	{
+	  break;
+	}
   /* Might be a floating point number.  */
   if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
 	{
@@ -2888,7 +2897,7 @@ lex_one_token (struct parser_state *par_
   /* It's a name.  See how long it is.  */
   namelen = 0;
   for (c = tokstart[namelen];
-   (c == '_' || c == '$' || c_ident_is_alnum (c) || c == '<');)
+   (c == '_' || c == '$' || c == '.' || c_ident_is_alnum (c) || c == '<');)
 {
   /* Template parameter lists are part of the name.
 	 FIXME: This mishandles `print $a<4&&$a>3'.  */



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 11 18:23:25 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: Makefile.in aarch64-nbsd-tdep.c

Log Message:
fix aarch64 crossgdb


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/Makefile.in
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/Makefile.in
diff -u src/external/gpl3/gdb/dist/gdb/Makefile.in:1.4 src/external/gpl3/gdb/dist/gdb/Makefile.in:1.5
--- src/external/gpl3/gdb/dist/gdb/Makefile.in:1.4	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/Makefile.in	Fri Dec 11 13:23:25 2020
@@ -667,6 +667,7 @@ TARGET_OBS = @TARGET_OBS@
 ALL_64_TARGET_OBS = \
 	aarch64-fbsd-tdep.o \
 	aarch64-linux-tdep.o \
+	aarch64-nbsd-tdep.o \
 	aarch64-newlib-tdep.o \
 	aarch64-ravenscar-thread.o \
 	aarch64-tdep.o \

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.6	Sat Jul 13 17:55:52 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Dec 11 13:23:25 2020
@@ -194,6 +194,7 @@ aarch64_nbsd_init_abi (struct gdbarch_in
 (gdbarch, aarch64_nbsd_iterate_over_regset_sections);
 }
 
+void _initialize_aarch64_nbsd_tdep (void);
 void
 _initialize_aarch64_nbsd_tdep (void)
 {



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 10 16:07:26 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: sh-nbsd-tdep.c

Log Message:
Avoid an unused variable (breaking the build)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.10 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.11
--- src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.10	Sun Dec  6 04:08:51 2020
+++ src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c	Thu Dec 10 16:07:26 2020
@@ -170,7 +170,7 @@ shnbsd_sigtramp_cache_init (const struct
 			CORE_ADDR func)
 {
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  // struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int sp_regnum = gdbarch_sp_regnum (gdbarch);
   CORE_ADDR sp = get_frame_register_unsigned (next_frame, sp_regnum);
   CORE_ADDR base;



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Dec 10 07:27:37 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-tdep.c

Log Message:
Fix armeb; CORE_ADDR is uint64_t but 2nd argument of raw_supply() is
expected to be the same size as PC. Therefore, PC was always read as
zero for big-endian.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.7 src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.7	Sat Dec  5 22:14:44 2020
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c	Thu Dec 10 07:27:37 2020
@@ -72,7 +72,7 @@ arm_nbsd_supply_gregset (const struct re
 
   if (regnum == -1 || regnum == ARM_PC_REGNUM)
 {
-  CORE_ADDR r_pc = gdbarch_addr_bits_remove (regcache->arch (), gregset->pc);
+  uint32_t r_pc = gdbarch_addr_bits_remove (regcache->arch (), gregset->pc);
   regcache->raw_supply (ARM_PC_REGNUM, (char *) _pc);
 }
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Dec 10 07:14:58 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Fix arm, for which PT_STEP is defined but unimplemented.

XXX
Stop exposing PT_STEP to userland for arm?


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.19 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.20
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.19	Sat Dec  5 22:14:44 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Thu Dec 10 07:14:58 2020
@@ -458,7 +458,7 @@ nbsd_nat_target::info_proc (const char *
   return true;
 }
 
-#ifdef PT_STEP
+#if defined(PT_STEP) && !defined(__arm__)
 /* Resume execution of a specified PTID, that points to a process or a thread
within a process.  If one thread is specified, all other threads are
suspended.  If STEP is nonzero, single-step it.  If SIGNAL is nonzero,
@@ -530,7 +530,7 @@ nbsd_resume(nbsd_nat_target *target, pti
 void
 nbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
 {
-#ifdef PT_STEP
+#if defined(PT_STEP) && !defined(__arm__)
   if (minus_one_ptid != ptid)
 nbsd_resume (this, ptid, step, signal);
   else



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec  8 13:56:38 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc64-nbsd-nat.c

Log Message:
include gdbarch.h


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.8	Mon Sep 14 22:05:19 2020
+++ src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c	Tue Dec  8 08:56:38 2020
@@ -18,6 +18,7 @@
along with this program.  If not, see .  */
 
 #include "defs.h"
+#include "gdbarch.h"
 #include "gdbcore.h"
 #include "regcache.h"
 #include "inferior.h"



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec  7 20:28:53 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc-nbsd-tdep.c

Log Message:
make function static (fixes crossgdb build, reported by martin@)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c:1.6	Mon Sep 14 22:05:19 2020
+++ src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c	Mon Dec  7 15:28:53 2020
@@ -315,7 +315,7 @@ sparc32nbsd_init_abi (struct gdbarch_inf
   frame_unwind_append_unwinder (gdbarch, _sigcontext_frame_unwind);
 }
 
-void
+static void
 sparc32nbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   sparc32nbsd_init_abi (info, gdbarch);



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  6 03:29:03 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: m68k-bsd-nat.c ppc-nbsd-nat.c
sparc-tdep.h vax-bsd-nat.c

Log Message:
fix m68k, ppc, sparc, vax


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/sparc-tdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.8	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c	Sat Dec  5 22:29:03 2020
@@ -18,7 +18,6 @@
along with this program.  If not, see .  */
 
 /* We define this to get types like register_t.  */
-#define _KERNTYPES
 #include "defs.h"
 #include "gdbcore.h"
 #include "inferior.h"
Index: src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.8	Mon Sep 14 22:05:19 2020
+++ src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c	Sat Dec  5 22:29:03 2020
@@ -18,7 +18,6 @@
along with this program.  If not, see .  */
 
 /* We define this to get types like register_t.  */
-#define _KERNTYPES
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
@@ -59,7 +58,7 @@ static void
 vaxbsd_collect_gregset (const struct regcache *regcache,
 			void *gregs, int regnum)
 {
-  gdb_byte *regs = (void *)gregs;
+  gdb_byte *regs = (gdb_byte *)gregs;
   int i;
 
   for (i = 0; i <= VAX_NUM_REGS; i++)

Index: src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.10 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.11
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.10	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c	Sat Dec  5 22:29:03 2020
@@ -20,7 +20,6 @@
along with this program.  If not, see .  */
 
 /* We define this to get types like register_t.  */
-#define _KERNTYPES
 #include "defs.h"
 
 #include 
@@ -33,8 +32,6 @@
 #include "inferior.h"
 #include "regcache.h"
 
-#include "common/gdb_assert.h"
-
 #include "nbsd-nat.h"
 #include "ppc-tdep.h"
 #include "ppc-nbsd-tdep.h"

Index: src/external/gpl3/gdb/dist/gdb/sparc-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/sparc-tdep.h:1.4 src/external/gpl3/gdb/dist/gdb/sparc-tdep.h:1.5
--- src/external/gpl3/gdb/dist/gdb/sparc-tdep.h:1.4	Mon Sep 14 22:05:19 2020
+++ src/external/gpl3/gdb/dist/gdb/sparc-tdep.h	Sat Dec  5 22:29:03 2020
@@ -255,9 +255,6 @@ extern const struct sparc_gregmap sparc3
 extern CORE_ADDR sparcnbsd_step_trap (struct frame_info *frame,
   unsigned long insn);
 
-extern void sparc32nbsd_init_abi (struct gdbarch_info info,
-  struct gdbarch *gdbarch);
-
 extern struct trad_frame_saved_reg *
   sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  5 22:24:26 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
fix arm build


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.14 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.15
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.14	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Sat Dec  5 17:24:26 2020
@@ -18,7 +18,6 @@
along with this program.  If not, see .  */
 
 /* We define this to get types like register_t.  */
-#define _KERNTYPES
 #include "defs.h"
 #include "gdbcore.h"
 #include "inferior.h"
@@ -52,7 +51,7 @@ public:
   const struct target_desc *read_description () override;
 };
 
-static arm_nbsd_nat_target the_arm_nbsd_nat_target;
+static arm_netbsd_nat_target the_arm_netbsd_nat_target;
 
 /* Determine if PT_GETREGS fetches REGNUM.  */
 
@@ -72,8 +71,6 @@ getfpregs_supplies (int regnum)
 	  || regnum == ARM_FPSCR_REGNUM);
 }
 
-extern int arm_apcs_32;
-
 static int
 armnbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {
@@ -142,18 +139,16 @@ fetch_register (struct regcache *regcach
   pid_t pid = ptid.pid ();
   int lwp = ptid.lwp ();
   int ret;
-  int lwp = regcache->ptid ().lwp ();
 
   ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
-		(PTRACE_TYPE_ARG3) _registers, lwp);
+		(PTRACE_TYPE_ARG3) , lwp);
 
   if (ret < 0)
 {
   warning (_("unable to fetch general register"));
   return;
 }
-  arm_nbsd_supply_gregset (nullptr, regcache, regno, _registers,
-			   sizeof (inferior_registers));
+  arm_nbsd_supply_gregset (nullptr, regcache, regno, , sizeof (regs));
 }
 
 static void
@@ -229,15 +224,14 @@ static void
 store_register (const struct regcache *regcache, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
-  struct reg inferior_registers;
-  int lwp = regcache->ptid ().lwp ();
+  struct reg regs;
   int ret;
   ptid_t ptid = regcache->ptid ();
   pid_t pid = ptid.pid ();
   int lwp = ptid.lwp ();
 
   ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
-		(PTRACE_TYPE_ARG3) _registers, lwp);
+		(PTRACE_TYPE_ARG3) , lwp);
 
   if (ret < 0)
 {
@@ -291,7 +285,7 @@ store_register (const struct regcache *r
 }
 
   ret = ptrace (PT_SETREGS, regcache->ptid ().pid (),
-		(PTRACE_TYPE_ARG3) _registers, lwp);
+		(PTRACE_TYPE_ARG3) , lwp);
 
   if (ret < 0)
 warning (_("unable to write register %d to inferior"), regno);
@@ -301,7 +295,7 @@ static void
 store_regs (const struct regcache *regcache)
 {
   struct gdbarch *gdbarch = regcache->arch ();
-  struct reg inferior_registers;
+  struct reg regs;
   int lwp = regcache->ptid ().lwp ();
   int ret;
   int regno;
@@ -333,7 +327,7 @@ store_regs (const struct regcache *regca
 }
 
   ret = ptrace (PT_SETREGS, regcache->ptid ().pid (),
-		(PTRACE_TYPE_ARG3) _registers, lwp);
+		(PTRACE_TYPE_ARG3) , lwp);
 
   if (ret < 0)
 warning (_("unable to store general registers"));
@@ -438,5 +432,6 @@ _initialize_arm_netbsd_nat ()
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (armnbsd_supply_pcb);
 
+/*###436 [cc] note: suggested alternative: 'the_arm_nbsd_nat_target'%%%*/
   add_inf_child_target (_arm_netbsd_nat_target);
 }



CVS commit: src/external/gpl3/gdb/dist

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  5 21:26:43 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gas: configure.tgt
src/external/gpl3/gdb/dist/ld: configure.tgt
Added Files:
src/external/gpl3/gdb/dist/ld/emulparams: aarch64nbsd.sh
aarch64nbsdb.sh armelf_nbsd_eabi.sh armelf_nbsd_eabihf.sh
armelfb_nbsd_eabi.sh armelfb_nbsd_eabihf.sh elf32_x86_64_nacl.sh
elf32or1k_nbsd.sh elf32ppc_nbsd.sh elf_i386_nacl.sh
elf_x86_64_nacl.sh ppclynx.sh ppcpe.sh tic30aout.sh

Log Message:
add aarch64 bits


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gas/configure.tgt
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/ld/configure.tgt
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/dist/ld/emulparams/aarch64nbsd.sh \
src/external/gpl3/gdb/dist/ld/emulparams/aarch64nbsdb.sh \
src/external/gpl3/gdb/dist/ld/emulparams/armelf_nbsd_eabi.sh \
src/external/gpl3/gdb/dist/ld/emulparams/armelf_nbsd_eabihf.sh \
src/external/gpl3/gdb/dist/ld/emulparams/armelfb_nbsd_eabi.sh \
src/external/gpl3/gdb/dist/ld/emulparams/armelfb_nbsd_eabihf.sh \
src/external/gpl3/gdb/dist/ld/emulparams/elf32_x86_64_nacl.sh \
src/external/gpl3/gdb/dist/ld/emulparams/elf32or1k_nbsd.sh \
src/external/gpl3/gdb/dist/ld/emulparams/elf32ppc_nbsd.sh \
src/external/gpl3/gdb/dist/ld/emulparams/elf_i386_nacl.sh \
src/external/gpl3/gdb/dist/ld/emulparams/elf_x86_64_nacl.sh \
src/external/gpl3/gdb/dist/ld/emulparams/ppclynx.sh \
src/external/gpl3/gdb/dist/ld/emulparams/ppcpe.sh \
src/external/gpl3/gdb/dist/ld/emulparams/tic30aout.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gas/configure.tgt
diff -u src/external/gpl3/gdb/dist/gas/configure.tgt:1.1.1.1 src/external/gpl3/gdb/dist/gas/configure.tgt:1.2
--- src/external/gpl3/gdb/dist/gas/configure.tgt:1.1.1.1	Mon Sep 14 21:42:20 2020
+++ src/external/gpl3/gdb/dist/gas/configure.tgt	Sat Dec  5 16:26:43 2020
@@ -123,6 +123,7 @@ generic_target=${cpu_type}-$vendor-$os
 case ${generic_target} in
   aarch64*-*-elf*)			fmt=elf;;
   aarch64*-*-fuchsia*)			fmt=elf;;
+  aarch64*-*-netbsd*)   fmt=elf em=nbsd ;;
   aarch64*-*-linux*)			fmt=elf em=linux
 case ${cpu}-${os} in
   aarch64*-linux-gnu_ilp32)		arch=aarch64:32 ;;

Index: src/external/gpl3/gdb/dist/ld/configure.tgt
diff -u src/external/gpl3/gdb/dist/ld/configure.tgt:1.1.1.1 src/external/gpl3/gdb/dist/ld/configure.tgt:1.2
--- src/external/gpl3/gdb/dist/ld/configure.tgt:1.1.1.1	Mon Sep 14 21:43:59 2020
+++ src/external/gpl3/gdb/dist/ld/configure.tgt	Sat Dec  5 16:26:43 2020
@@ -77,6 +77,12 @@ aarch64-*-linux*)	targ_emul=aarch64linux
 			targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
 			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
 			;;
+aarch64_be-*-netbsd*)	targ_emul=aarch64nbsdb
+			targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb"
+			;;
+aarch64-*-netbsd*)	targ_emul=aarch64nbsd
+			targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb"
+			;;
 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
 			targ_emul=elf64alpha_fbsd
 			targ_extra_emuls="elf64alpha alpha"

Added files:

Index: src/external/gpl3/gdb/dist/ld/emulparams/aarch64nbsd.sh
diff -u /dev/null src/external/gpl3/gdb/dist/ld/emulparams/aarch64nbsd.sh:1.1
--- /dev/null	Sat Dec  5 16:26:43 2020
+++ src/external/gpl3/gdb/dist/ld/emulparams/aarch64nbsd.sh	Sat Dec  5 16:26:43 2020
@@ -0,0 +1,37 @@
+ARCH=aarch64
+MACHINE=
+NOP=0
+
+SCRIPT_NAME=elf
+ELFSIZE=64
+OUTPUT_FORMAT="elf64-littleaarch64"
+BIG_OUTPUT_FORMAT="elf64-bigaarch64"
+LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"
+NO_REL_RELOCS=yes
+
+TEMPLATE_NAME=elf
+EXTRA_EM_FILE=aarch64elf
+
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+SEPARATE_GOTPLT=24
+IREL_IN_PLT=
+
+TEXT_START_ADDR=0x20010
+
+DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
+
+# AArch64 does not support .s* sections.
+NO_SMALL_DATA=yes
+
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
+# Ensure each PLT entry is aligned to a cache line.
+PLT=".plt  ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
Index: 

CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 24 23:06:15 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
Now that we are adding the thread in the bsd_kvm_ops target namespace,
make sure that the inferior's top namespace is that too.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.18 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.19
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.18	Mon Sep 14 22:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Sat Oct 24 19:06:15 2020
@@ -140,6 +140,7 @@ bsd_kvm_target_open (const char *arg, in
   push_target (_kvm_ops);
 
   inf = add_inferior_silent (bsd_kvm_ptid.pid ());
+  inf->push_target (_kvm_ops);
   inf->aspace = maybe_new_address_space ();
   inf->pspace = new program_space (inf->aspace);
 



CVS commit: src/external/gpl3/gdb/dist/gdb/nat

2020-10-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 14 14:02:43 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb/nat: fork-inferior.c

Log Message:
Limit the switch_to_thread() calls in startup_inferior()

Do not jump over the threads during the startup unless we encounter
TARGET_WAITKIND_STOPPED with SIGTRAP or TARGET_WAITKIND_EXECD.

Otherwise whenever a startup-with-shell processes signals on the
startup stage, it might indicate to switch to a non-existing
thread or a special-thread number (target lwp=0 on NetBSD means
that a signal was directed to all threads within a process).

This caused a crash with tcsh on NetBSD, where the tcsh shell
runs startup detection of the hostname. This action involves
spwaning a new process through fork.

GDB crashes this way:
$ SHELL=tcsh /usr/bin/gdb echo
(gdb) r
Starting program: /bin/echo
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309:
internal-error: void switch_to_thread(thread_info*):
Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

This patch has been submitted upstream for review:

https://sourceware.org/pipermail/gdb-patches/2020-October/172558.html


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c
diff -u src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c:1.1.1.2 src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c:1.2
--- src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c:1.1.1.2	Tue Sep 15 01:43:40 2020
+++ src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c	Wed Oct 14 14:02:43 2020
@@ -503,7 +503,6 @@ startup_inferior (process_stratum_target
 	  case TARGET_WAITKIND_SYSCALL_ENTRY:
 	  case TARGET_WAITKIND_SYSCALL_RETURN:
 	/* Ignore gracefully during startup of the inferior.  */
-	switch_to_thread (proc_target, event_ptid);
 	break;
 
 	  case TARGET_WAITKIND_SIGNALLED:
@@ -536,7 +535,9 @@ startup_inferior (process_stratum_target
 
 	  case TARGET_WAITKIND_STOPPED:
 	resume_signal = ws.value.sig;
-	switch_to_thread (proc_target, event_ptid);
+	/* Ignore gracefully the !TRAP signals intercepted from the shell.  */
+	if (resume_signal == GDB_SIGNAL_TRAP)
+	  switch_to_thread (proc_target, event_ptid);
 	break;
 	}
 



CVS commit: src/external/gpl3/gdb/dist/bfd

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 23:28:13 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/bfd: config.bfd

Log Message:
Replace local patches adding NetBSD/aarch64 support with the upstream one

Cherry-pick:

>From c0b313441717b65569edb01bf9984d2066d899de Mon Sep 17 00:00:00 2001
From: Nick Clifton 
Date: Mon, 5 Oct 2020 14:56:42 +0100
Subject: [PATCH] Add NetBSD AArch64 Little Endian and Big Endian BFD support.

bfd  * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gdb/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/config.bfd
diff -u src/external/gpl3/gdb/dist/bfd/config.bfd:1.22 src/external/gpl3/gdb/dist/bfd/config.bfd:1.23
--- src/external/gpl3/gdb/dist/bfd/config.bfd:1.22	Tue Sep 15 02:05:16 2020
+++ src/external/gpl3/gdb/dist/bfd/config.bfd	Tue Oct  6 23:28:13 2020
@@ -247,11 +247,6 @@ case "${targ}" in
 targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
 want64=true
 ;;
-  aarch64-*-netbsd*)
-targ_defvec=aarch64_elf64_le_vec
-targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
-want64=true
-;;
   aarch64-*-fuchsia*)
 targ_defvec=aarch64_elf64_le_vec
 targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
@@ -262,22 +257,12 @@ case "${targ}" in
 targ_selvecs=aarch64_elf64_be_cloudabi_vec
 want64=true
 ;;
-  aarch64-*-linux*)
-targ_defvec=aarch64_elf64_le_vec
-targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
-want64=true
-;;
-  aarch64_be-*-linux*)
-targ_defvec=aarch64_elf64_be_vec
-targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
-want64=true
-;;
-  aarch64-*-netbsd*)
+  aarch64-*-linux* | aarch64-*-netbsd*)
 targ_defvec=aarch64_elf64_le_vec
 targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
 want64=true
 ;;
-  aarch64_be-*-netbsd*)
+  aarch64_be-*-linux* | aarch64_be-*-netbsd*)
 targ_defvec=aarch64_elf64_be_vec
 targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
 want64=true



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 23:14:47 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c nbsd-nat.c

Log Message:
Undo local patches

They are no longer needed (and are wrong).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.21 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.22
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.21	Tue Sep 15 02:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Tue Oct  6 23:14:47 2020
@@ -263,12 +263,10 @@ get_ptrace_pid (ptid_t ptid)
 {
   pid_t pid;
 
-#ifndef __NetBSD__
   /* If we have an LWPID to work with, use it.  Otherwise, we're
  dealing with a non-threaded program/target.  */
   pid = ptid.lwp ();
   if (pid == 0)
-#endif
 pid = ptid.pid ();
   return pid;
 }
@@ -293,7 +291,6 @@ inf_ptrace_target::resume (ptid_t ptid, 
   else
 request = PT_CONTINUE;
 
-  int sig;
   if (step)
 {
   /* If this system does not support PT_STEP, a higher level
@@ -302,23 +299,13 @@ inf_ptrace_target::resume (ptid_t ptid, 
 	 all possible successor instructions), so we don't have to
 	 worry about that here.  */
   request = PT_STEP;
-#if __NetBSD__
-  /*
-   * On NetBSD the data field of PT_STEP contains the thread
-   * to be stepped; all other threads are continued if this value is > 0
-   */
-  sig = ptid.lwp ();
-#else
-  sig = 0;
-#endif
-} else
-  sig = gdb_signal_to_host (signal);
+}
 
   /* An address of (PTRACE_TYPE_ARG3)1 tells ptrace to continue from
  where it was.  If GDB wanted it to start some other way, we have
  already written a new program counter value to the child.  */
   errno = 0;
-  gdb_ptrace (request, ptid, (PTRACE_TYPE_ARG3)1, sig);
+  gdb_ptrace (request, ptid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal));
   if (errno != 0)
 perror_with_name (("ptrace"));
 }
@@ -476,15 +463,6 @@ inf_ptrace_target::xfer_partial (enum ta
 	/* If the PT_IO request is somehow not supported, fallback on
 	   using PT_WRITE_D/PT_READ_D.  Otherwise we will return zero
 	   to indicate failure.  */
-	if (errno == EACCES)
-	  {
-	fprintf_unfiltered (gdb_stderr, "Cannot %s process at %p (%s). "
-"Is PaX MPROTECT active? See security(7), "
-"sysctl(7), paxctl(8)\n", writebuf ? "write to" :
-"read from", piod.piod_offs,
-strerror(errno));
-	return TARGET_XFER_E_IO;	/* Some other error perhaps? */
-	  }
 	if (errno != EINVAL)
 	  return TARGET_XFER_EOF;
   }

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.17 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.18
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.17	Sat Sep 19 21:45:45 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Tue Oct  6 23:14:47 2020
@@ -587,9 +587,6 @@ nbsd_nat_target::wait (ptid_t ptid, stru
   siginfo_t *si = _siginfo;
 
   int lwp = psi.psi_lwpid;
-  // XXX: should the kernel return this?
-  if (lwp == 0)
-lwp = pid;
 
   int signo = si->si_signo;
   const int code = si->si_code;



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 22:17:42 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-tdep.c

Log Message:
Remove NFC local delta


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.5	Tue Sep 15 02:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c	Tue Oct  6 22:17:42 2020
@@ -3,9 +3,9 @@
Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
Contributed by Wasabi Systems, Inc.
-
+  
This file is part of GDB.
-
+  
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 22:14:41 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: ppc-nbsd-tdep.c

Log Message:
Fix typo

Remove delta with upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.5	Tue Sep 15 02:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c	Tue Oct  6 22:14:41 2020
@@ -199,7 +199,7 @@ _initialize_ppcnbsd_tdep ()
 			  ppcnbsd_init_abi);
 
   /* Avoid initializing the register offsets again if they were
- already initailized by ppcnbsd-nat.c.  */
+ already initialized by ppcnbsd-nat.c.  */
   if (ppcnbsd_reg_offsets.pc_offset == 0)
 {
   /* General-purpose registers.  */



CVS commit: src/external/gpl3/gdb/dist/gdbsupport

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 22:04:09 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdbsupport: agent.cc

Log Message:
Replace local patch with fix from upstream

Cherry-pick:

>From e2a2a24a8e78427ff8667d625f5befbe88c328bb Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski 
Date: Wed, 23 Sep 2020 04:20:05 +0200
Subject: [PATCH] Preinitialize the sockaddr_un variable to zero

Don't pass random sun_len for the BSD's,
zero the whole structure as recommended for portability.

Reported by Coverity.

gdbsupport/ChangeLog:

* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdbsupport/agent.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdbsupport/agent.cc
diff -u src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.2 src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.3
--- src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.2	Sun Sep 20 21:18:45 2020
+++ src/external/gpl3/gdb/dist/gdbsupport/agent.cc	Tue Oct  6 22:04:09 2020
@@ -138,7 +138,7 @@ static int
 gdb_connect_sync_socket (int pid)
 {
 #ifdef HAVE_SYS_UN_H
-  struct sockaddr_un addr;
+  struct sockaddr_un addr = {};
   int res, fd;
   char path[UNIX_PATH_MAX];
 
@@ -153,7 +153,6 @@ gdb_connect_sync_socket (int pid)
   return -1;
 }
 
-  memset(, 0, sizeof(addr));
   addr.sun_family = AF_UNIX;
 
   res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path);



CVS commit: src/external/gpl3/gdb/dist/gnulib/import/m4

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 21:54:01 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gnulib/import/m4: mbrtowc.m4

Log Message:
Undo local NFC patch


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4
diff -u src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.3 src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.4
--- src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.3	Sun Sep 20 16:00:56 2020
+++ src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4	Tue Oct  6 21:54:01 2020
@@ -754,6 +754,7 @@ changequote(,)dnl
   case "$host_os" in
   # Guess no on AIX and glibc systems.
 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+  # Guess yes on native Windows.
 mingw*)   gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
 *)gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
   esac



CVS commit: src/external/gpl3/gdb/dist/libiberty

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 21:49:22 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/libiberty: make-temp-file.c

Log Message:
Undo local patch having no impact

/tmp is picked from P_tmpdir earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/dist/libiberty/make-temp-file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/libiberty/make-temp-file.c
diff -u src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.6 src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.7
--- src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.6	Tue Sep 15 02:05:28 2020
+++ src/external/gpl3/gdb/dist/libiberty/make-temp-file.c	Tue Oct  6 21:49:22 2020
@@ -129,10 +129,10 @@ choose_tmpdir (void)
 	base = try_dir (P_tmpdir, base);
 #endif
 
-  /* Try /tmp, /var/tmp, then /usr/tmp.  */
-  base = try_dir (tmp, base);
+  /* Try /var/tmp, /usr/tmp, then /tmp.  */
   base = try_dir (vartmp, base);
   base = try_dir (usrtmp, base);
+  base = try_dir (tmp, base);
   
   /* If all else fails, use the current directory!  */
   if (base == 0)



CVS commit: src/external/gpl3/gdb/dist/bfd

2020-10-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct  6 21:39:53 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/bfd: netbsd-core.c

Log Message:
Undo local NFC patch


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/bfd/netbsd-core.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/netbsd-core.c
diff -u src/external/gpl3/gdb/dist/bfd/netbsd-core.c:1.8 src/external/gpl3/gdb/dist/bfd/netbsd-core.c:1.9
--- src/external/gpl3/gdb/dist/bfd/netbsd-core.c:1.8	Tue Sep 15 02:05:16 2020
+++ src/external/gpl3/gdb/dist/bfd/netbsd-core.c	Tue Oct  6 21:39:53 2020
@@ -275,7 +275,7 @@ const bfd_target core_netbsd_vec =
 0,/* Symbol prefix.  */
 ' ',			/* ar_pad_char.  */
 16,/* ar_max_namelen.  */
-0,/* match priority.  */
+0,/* Match priority.  */
 NO_GET64, NO_GETS64, NO_PUT64,	/* 64 bit data.  */
 NO_GET, NO_GETS, NO_PUT,		/* 32 bit data.  */
 NO_GET, NO_GETS, NO_PUT,		/* 16 bit data.  */



CVS commit: src/external/gpl3/gdb/dist/gdbsupport

2020-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 20 21:18:45 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdbsupport: agent.cc

Log Message:
zero out the sockaddr, so that the length it guaranteed to be 0.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdbsupport/agent.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdbsupport/agent.cc
diff -u src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.1.1.1 src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.2
--- src/external/gpl3/gdb/dist/gdbsupport/agent.cc:1.1.1.1	Mon Sep 14 21:43:49 2020
+++ src/external/gpl3/gdb/dist/gdbsupport/agent.cc	Sun Sep 20 17:18:45 2020
@@ -153,6 +153,7 @@ gdb_connect_sync_socket (int pid)
   return -1;
 }
 
+  memset(, 0, sizeof(addr));
   addr.sun_family = AF_UNIX;
 
   res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path);



CVS commit: src/external/gpl3/gdb/dist

2020-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 20 16:41:26 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/bfd: configure
src/external/gpl3/gdb/dist/binutils: configure
src/external/gpl3/gdb/dist/gas: configure
src/external/gpl3/gdb/dist/gold: configure
src/external/gpl3/gdb/dist/gprof: configure
src/external/gpl3/gdb/dist/ld: configure
src/external/gpl3/gdb/dist/opcodes: configure

Log Message:
disable -Wstack-usage since some targets like vax don't support it


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/bfd/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/binutils/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gas/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gold/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gprof/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/ld/configure
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/opcodes/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/configure
diff -u src/external/gpl3/gdb/dist/bfd/configure:1.12 src/external/gpl3/gdb/dist/bfd/configure:1.13
--- src/external/gpl3/gdb/dist/bfd/configure:1.12	Mon Sep 14 22:05:16 2020
+++ src/external/gpl3/gdb/dist/bfd/configure	Sun Sep 20 12:41:25 2020
@@ -12663,7 +12663,8 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
 fi
 rm -f conftest*
 
@@ -12708,7 +12709,8 @@ if (eval "$ac_cpp_for_build conftest.$ac
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
 fi
 rm -f conftest*
 

Index: src/external/gpl3/gdb/dist/binutils/configure
diff -u src/external/gpl3/gdb/dist/binutils/configure:1.1.1.1 src/external/gpl3/gdb/dist/binutils/configure:1.2
--- src/external/gpl3/gdb/dist/binutils/configure:1.1.1.1	Mon Sep 14 21:42:08 2020
+++ src/external/gpl3/gdb/dist/binutils/configure	Sun Sep 20 12:41:25 2020
@@ -12621,7 +12621,8 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
 fi
 rm -f conftest*
 
@@ -12666,7 +12667,8 @@ if (eval "$ac_cpp_for_build conftest.$ac
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
 fi
 rm -f conftest*
 

Index: src/external/gpl3/gdb/dist/gas/configure
diff -u src/external/gpl3/gdb/dist/gas/configure:1.1.1.1 src/external/gpl3/gdb/dist/gas/configure:1.2
--- src/external/gpl3/gdb/dist/gas/configure:1.1.1.1	Mon Sep 14 21:42:19 2020
+++ src/external/gpl3/gdb/dist/gas/configure	Sun Sep 20 12:41:25 2020
@@ -12230,7 +12230,8 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
 fi
 rm -f conftest*
 
@@ -12275,7 +12276,8 @@ if (eval "$ac_cpp_for_build conftest.$ac
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
 fi
 rm -f conftest*
 

Index: src/external/gpl3/gdb/dist/gold/configure
diff -u src/external/gpl3/gdb/dist/gold/configure:1.1.1.1 src/external/gpl3/gdb/dist/gold/configure:1.2
--- src/external/gpl3/gdb/dist/gold/configure:1.1.1.1	Mon Sep 14 21:43:52 2020
+++ src/external/gpl3/gdb/dist/gold/configure	Sun Sep 20 12:41:25 2020
@@ -7812,7 +7812,8 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144"
 fi
 rm -f conftest*
 
@@ -7857,7 +7858,8 @@ if (eval "$ac_cpp_for_build conftest.$ac
   $EGREP "(^[0-4]$|^__GNUC__$)" >/dev/null 2>&1; then :
 
 else
-  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
+ :
+#  GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144"
 fi
 rm -f conftest*
 

Index: src/external/gpl3/gdb/dist/gprof/configure
diff -u src/external/gpl3/gdb/dist/gprof/configure:1.1.1.1 src/external/gpl3/gdb/dist/gprof/configure:1.2
--- 

CVS commit: src/external/gpl3/gdb/dist/gnulib/import/m4

2020-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 20 16:00:56 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gnulib/import/m4: mbrtowc.m4

Log Message:
undo previous, it was correct


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4
diff -u src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.2 src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.3
--- src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4:1.2	Fri Sep 18 13:46:47 2020
+++ src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4	Sun Sep 20 12:00:56 2020
@@ -172,8 +172,6 @@ changequote(,)dnl
   case "$host_os" in
  # Guess no on AIX and OSF/1.
 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
- # Guess no on bsd.
-*bsd*)	 gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
  # Guess yes otherwise.
 *)   gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
   esac
@@ -756,8 +754,6 @@ changequote(,)dnl
   case "$host_os" in
   # Guess no on AIX and glibc systems.
 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
-*bsd*)		  gl_cv_func_mbrtowc_empty_input="guessing no" ;;
-  # Guess yes on native Windows.
 mingw*)   gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
 *)gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
   esac



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 20 14:39:26 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: corelow.c

Log Message:
Don't read data from sections without contents on NetBSD. We end up reading
0's and svr4_exec_displacement read phdrs_target successfully, and we
end up in the rabbit-hole of 0 displacement for pie binaries and then we
can't load our shared libaries from the core file.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/corelow.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/corelow.c
diff -u src/external/gpl3/gdb/dist/gdb/corelow.c:1.1.1.9 src/external/gpl3/gdb/dist/gdb/corelow.c:1.2
--- src/external/gpl3/gdb/dist/gdb/corelow.c:1.1.1.9	Mon Sep 14 21:43:29 2020
+++ src/external/gpl3/gdb/dist/gdb/corelow.c	Sun Sep 20 10:39:26 2020
@@ -841,6 +841,7 @@ core_target::xfer_partial (enum target_o
 	if (xfer_status == TARGET_XFER_OK)
 	  return TARGET_XFER_OK;
 
+#ifndef __NetBSD__
 	/* Finally, attempt to access data in core file sections with
 	   no contents.  These will typically read as all zero.  */
 	auto no_contents_cb = [&] (const struct target_section *s)
@@ -853,7 +854,7 @@ core_target::xfer_partial (enum target_o
 			 m_core_section_table.sections,
 			 m_core_section_table.sections_end,
 			 no_contents_cb);
-
+#endif
 	return xfer_status;
   }
 case TARGET_OBJECT_AUXV:



CVS commit: src/external/gpl3/gdb/dist/bfd

2020-09-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 19 21:47:03 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf.c

Log Message:
remove mis-merged code and make the auxv core offset 0. Now loading auxv
from core files works.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/bfd/elf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/elf.c
diff -u src/external/gpl3/gdb/dist/bfd/elf.c:1.12 src/external/gpl3/gdb/dist/bfd/elf.c:1.13
--- src/external/gpl3/gdb/dist/bfd/elf.c:1.12	Mon Sep 14 22:05:16 2020
+++ src/external/gpl3/gdb/dist/bfd/elf.c	Sat Sep 19 17:47:03 2020
@@ -10893,7 +10893,7 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf
 #ifdef NT_NETBSDCORE_AUXV
 case NT_NETBSDCORE_AUXV:
   /* NetBSD-specific Elf Auxiliary Vector data. */
-  return elfcore_make_auxv_note_section (abfd, note, 4);
+  return elfcore_make_auxv_note_section (abfd, note, 0);
 #endif
 #ifdef NT_NETBSDCORE_LWPSTATUS
 case NT_NETBSDCORE_LWPSTATUS:
@@ -11023,20 +11023,6 @@ elfcore_grok_openbsd_note (bfd *abfd, El
   if (note->type == NT_OPENBSD_AUXV)
 return elfcore_make_auxv_note_section (abfd, note, 0);
 
-  if (note->type == NT_OPENBSD_WCOOKIE)
-{
-  asection *sect = bfd_make_section_anyway_with_flags (abfd, ".wcookie",
-			   SEC_HAS_CONTENTS);
-
-  if (sect == NULL)
-	return FALSE;
-  sect->size = note->descsz;
-  sect->filepos = note->descpos;
-  sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32;
-
-  return TRUE;
-}
-
   return TRUE;
 }
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-09-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 19 21:45:45 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
The lid of the main thread == pid now. Should we fix the kernel to return
this? Now debugging live programs work.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.16 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.17
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.16	Wed Sep 16 22:12:31 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Sat Sep 19 17:45:45 2020
@@ -587,6 +587,9 @@ nbsd_nat_target::wait (ptid_t ptid, stru
   siginfo_t *si = _siginfo;
 
   int lwp = psi.psi_lwpid;
+  // XXX: should the kernel return this?
+  if (lwp == 0)
+lwp = pid;
 
   int signo = si->si_signo;
   const int code = si->si_code;



CVS commit: src/external/gpl3/gdb/dist/gnulib

2020-09-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 18 17:46:47 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gnulib: Makefile.in aclocal.m4 configure
src/external/gpl3/gdb/dist/gnulib/import: Makefile.in
src/external/gpl3/gdb/dist/gnulib/import/m4: fdopendir.m4 frexp.m4
gettimeofday.m4 lstat.m4 mbrtowc.m4 memchr.m4 mkdir.m4 readlink.m4
rename.m4 rmdir.m4 setenv.m4 stat.m4

Log Message:
Provide better guesses for bsd systems, otherwise we end up calling
recursively opendir and gettimeofday until we run out of stack...


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gnulib/Makefile.in \
src/external/gpl3/gdb/dist/gnulib/aclocal.m4 \
src/external/gpl3/gdb/dist/gnulib/configure
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gnulib/import/Makefile.in
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gnulib/import/m4/fdopendir.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/frexp.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/gettimeofday.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/lstat.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/mbrtowc.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/memchr.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/mkdir.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/readlink.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/rename.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/rmdir.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/setenv.m4 \
src/external/gpl3/gdb/dist/gnulib/import/m4/stat.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gnulib/Makefile.in
diff -u src/external/gpl3/gdb/dist/gnulib/Makefile.in:1.1.1.1 src/external/gpl3/gdb/dist/gnulib/Makefile.in:1.2
--- src/external/gpl3/gdb/dist/gnulib/Makefile.in:1.1.1.1	Mon Sep 14 21:43:50 2020
+++ src/external/gpl3/gdb/dist/gnulib/Makefile.in	Fri Sep 18 13:46:47 2020
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1615,8 +1615,8 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
 	echo ' $(SHELL) ./config.status'; \
 	$(SHELL) ./config.status;; \
 	  *) \
-	echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
Index: src/external/gpl3/gdb/dist/gnulib/aclocal.m4
diff -u src/external/gpl3/gdb/dist/gnulib/aclocal.m4:1.1.1.1 src/external/gpl3/gdb/dist/gnulib/aclocal.m4:1.2
--- src/external/gpl3/gdb/dist/gnulib/aclocal.m4:1.1.1.1	Mon Sep 14 21:43:50 2020
+++ src/external/gpl3/gdb/dist/gnulib/aclocal.m4	Fri Sep 18 13:46:47 2020
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,461 @@ You have another version of autoconf.  I
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# po.m4 serial 24 (gettext-0.19)
+dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper , 1995-2000.
+dnl   Bruno Haible , 2000-2003.
+
+AC_PREREQ([2.60])
+
+dnl 

CVS commit: src/external/gpl3/gdb/dist/gdb/doc

2020-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 17 20:13:20 UTC 2020

Added Files:
src/external/gpl3/gdb/dist/gdb/doc: gcore.1 gdb-add-index.1 gdb.1
gdbinit.5 gdbserver.1

Log Message:
commit generated man pages


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gdb/dist/gdb/doc/gcore.1 \
src/external/gpl3/gdb/dist/gdb/doc/gdb-add-index.1 \
src/external/gpl3/gdb/dist/gdb/doc/gdb.1 \
src/external/gpl3/gdb/dist/gdb/doc/gdbinit.5 \
src/external/gpl3/gdb/dist/gdb/doc/gdbserver.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/gpl3/gdb/dist/gdb/doc/gcore.1
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/doc/gcore.1:1.3
--- /dev/null	Thu Sep 17 16:13:20 2020
+++ src/external/gpl3/gdb/dist/gdb/doc/gcore.1	Thu Sep 17 16:13:20 2020
@@ -0,0 +1,196 @@
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\"
+.\" Standard preamble:
+.\" 
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.ds -- \(*W-
+.ds PI pi
+.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.ds L" ""
+.ds R" ""
+.ds C` ""
+.ds C' ""
+'br\}
+.el\{\
+.ds -- \|\(em\|
+.ds PI \(*p
+.ds L" ``
+.ds R" ''
+.ds C`
+.ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el   .ds Aq '
+.\"
+.\" If the F register is >0, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+.if \nF \{\
+.de IX
+.tm Index:\\$1\t\\n%\t"\\$2"
+..
+.if !\nF==2 \{\
+.nr % 0
+.nr F 2
+.\}
+.\}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.\" fudge factors for nroff and troff
+.if n \{\
+.ds #H 0
+.ds #V .8m
+.ds #F .3m
+.ds #[ \f1
+.ds #] \fP
+.\}
+.if t \{\
+.ds #H ((1u-(n(.fu%2u))*.13m)
+.ds #V .6m
+.ds #F 0
+.ds #[ \&
+.ds #] \&
+.\}
+.\" simple accents for nroff and troff
+.if n \{\
+.ds ' \&
+.ds ` \&
+.ds ^ \&
+.ds , \&
+.ds ~ ~
+.ds /
+.\}
+.if t \{\
+.ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.\" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.\" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.\" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.ds : e
+.ds 8 ss
+.ds o a
+.ds d- d\h'-1'\(ga
+.ds D- D\h'-1'\(hy
+.ds th \o'bp'
+.ds Th \o'LP'
+.ds ae ae
+.ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" 
+.\"
+.IX Title "GCORE 1"
+.TH GCORE 1 "2020-09-17" "gdb-11.0.50.20200914-git" "GNU Development Tools"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes

CVS commit: src/external/gpl3/gdb/dist/libctf

2020-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 17 16:05:14 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/libctf: ctf-endian.h

Log Message:
Avoid re-definitions


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/libctf/ctf-endian.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/libctf/ctf-endian.h
diff -u src/external/gpl3/gdb/dist/libctf/ctf-endian.h:1.1.1.1 src/external/gpl3/gdb/dist/libctf/ctf-endian.h:1.2
--- src/external/gpl3/gdb/dist/libctf/ctf-endian.h:1.1.1.1	Mon Sep 14 21:44:12 2020
+++ src/external/gpl3/gdb/dist/libctf/ctf-endian.h	Thu Sep 17 12:05:14 2020
@@ -24,14 +24,22 @@
 #include 
 #include "swap.h"
 
-#if !defined (HAVE_ENDIAN_H) || !defined (htole64)
-#ifndef WORDS_BIGENDIAN
-# define htole64(x) (x)
-# define le64toh(x) (x)
-#else
-# define htole64(x) bswap_64 ((x))
-# define le64toh(x) bswap_64 ((x))
-#endif /* WORDS_BIGENDIAN */
+#if !defined (HAVE_ENDIAN_H)
+# ifndef WORDS_BIGENDIAN
+#  ifndef htole64
+#   define htole64(x) (x)
+#  endif
+#  ifndef le64toh
+#   define le64toh(x) (x)
+#  endif
+# else
+#  ifndef htole64
+#   define htole64(x) bswap_64 ((x))
+#  endif
+#  ifndef le64toh
+#   define le64toh(x) bswap_64 ((x))
+#  endif
+# endif /* WORDS_BIGENDIAN */
 #endif /* !defined(HAVE_ENDIAN_H) */
 
 #endif /* !defined(_CTF_ENDIAN_H) */



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 17 02:12:31 UTC 2020

Added Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Add back accidentally missed file


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.16 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.16
--- /dev/null	Wed Sep 16 22:12:31 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Wed Sep 16 22:12:31 2020
@@ -0,0 +1,791 @@
+/* Native-dependent code for NetBSD.
+
+   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see .  */
+
+#include "defs.h"
+
+#include "nbsd-nat.h"
+#include "nat/netbsd-nat.h"
+#include "gdbthread.h"
+#include "nbsd-tdep.h"
+#include "inferior.h"
+#include "gdbarch.h"
+
+#include 
+#include 
+#include 
+#include 
+
+/* Return the name of a file that can be opened to get the symbols for
+   the child process identified by PID.  */
+
+char *
+nbsd_nat_target::pid_to_exec_file (int pid)
+{
+  return const_cast (netbsd_nat::pid_to_exec_file (pid));
+}
+
+/* Return the current directory for the process identified by PID.  */
+
+static std::string
+nbsd_pid_to_cwd (int pid)
+{
+  char buf[PATH_MAX];
+  size_t buflen;
+  int mib[4] = {CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_CWD};
+  buflen = sizeof (buf);
+  if (sysctl (mib, ARRAY_SIZE (mib), buf, , NULL, 0))
+return "";
+  return buf;
+}
+
+/* Return the kinfo_proc2 structure for the process identified by PID.  */
+
+static bool
+nbsd_pid_to_kinfo_proc2 (pid_t pid, struct kinfo_proc2 *kp)
+{
+  gdb_assert (kp != nullptr);
+
+  size_t size = sizeof (*kp);
+  int mib[6] = {CTL_KERN, KERN_PROC2, KERN_PROC_PID, pid,
+		static_cast (size), 1};
+  return !sysctl (mib, ARRAY_SIZE (mib), kp, , NULL, 0);
+}
+
+/* Return the command line for the process identified by PID.  */
+
+static gdb::unique_xmalloc_ptr
+nbsd_pid_to_cmdline (int pid)
+{
+  int mib[4] = {CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_ARGV};
+
+  size_t size = 0;
+  if (::sysctl (mib, ARRAY_SIZE (mib), NULL, , NULL, 0) == -1 || size == 0)
+return nullptr;
+
+  gdb::unique_xmalloc_ptr args (XNEWVAR (char, size));
+
+  if (::sysctl (mib, ARRAY_SIZE (mib), args.get (), , NULL, 0) == -1
+  || size == 0)
+return nullptr;
+
+  /* Arguments are returned as a flattened string with NUL separators.
+ Join the arguments with spaces to form a single string.  */
+  for (size_t i = 0; i < size - 1; i++)
+if (args[i] == '\0')
+  args[i] = ' ';
+  args[size - 1] = '\0';
+
+  return args;
+}
+
+/* Return true if PTID is still active in the inferior.  */
+
+bool
+nbsd_nat_target::thread_alive (ptid_t ptid)
+{
+  return netbsd_nat::thread_alive (ptid);
+}
+
+/* Return the name assigned to a thread by an application.  Returns
+   the string in a static buffer.  */
+
+const char *
+nbsd_nat_target::thread_name (struct thread_info *thr)
+{
+  ptid_t ptid = thr->ptid;
+  return netbsd_nat::thread_name (ptid);
+}
+
+/* Implement the "post_attach" target_ops method.  */
+
+static void
+nbsd_add_threads (nbsd_nat_target *target, pid_t pid)
+{
+  auto fn
+= [] (ptid_t ptid)
+  {
+	if (!in_thread_list (target, ptid))
+	  {
+	if (inferior_ptid.lwp () == 0)
+	  thread_change_ptid (target, inferior_ptid, ptid);
+	else
+	  add_thread (target, ptid);
+	  }
+  };
+
+  netbsd_nat::for_each_thread (pid, fn);
+}
+
+/* Implement the "post_startup_inferior" target_ops method.  */
+
+void
+nbsd_nat_target::post_startup_inferior (ptid_t ptid)
+{
+  netbsd_nat::enable_proc_events (ptid.pid ());
+}
+
+/* Implement the "post_attach" target_ops method.  */
+
+void
+nbsd_nat_target::post_attach (int pid)
+{
+  netbsd_nat::enable_proc_events (pid);
+  nbsd_add_threads (this, pid);
+}
+
+/* Implement the "update_thread_list" target_ops method.  */
+
+void
+nbsd_nat_target::update_thread_list ()
+{
+  delete_exited_threads ();
+}
+
+/* Convert PTID to a string.  */
+
+std::string
+nbsd_nat_target::pid_to_str (ptid_t ptid)
+{
+  int lwp = ptid.lwp ();
+
+  if (lwp != 0)
+{
+  pid_t pid = ptid.pid ();
+
+  return string_printf ("LWP %d of process 

CVS commit: src/external/gpl3/gdb/dist/gdb

2020-05-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 23 00:30:40 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-tdep.c

Log Message:
Revive entrypoint heuristics, accidentally removed in the previous.

Now, e.g., "b main" works again for "gdb /bin/echo" as expected.

See more details:
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gdb/dist/gdb/alpha-tdep.c#rev1.2

XXX
Single-stepping into shared libraries still fails sometimes;
tracee does not stop at a function in shared library.
We need further analysis...


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/alpha-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.4 src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.5
--- src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.4	Sun May 26 21:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/alpha-tdep.c	Sat May 23 00:30:40 2020
@@ -1825,6 +1825,9 @@ alpha_gdbarch_init (struct gdbarch_info 
   /* Prologue heuristics.  */
   set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue);
 
+  /* Entrypoint heuristics.  */
+  set_gdbarch_skip_entrypoint (gdbarch, alpha_skip_entrypoint);
+
   /* Call info.  */
 
   set_gdbarch_return_value (gdbarch, alpha_return_value);



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-05-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May  2 12:56:55 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
Switch to the current thread, and reload the symbol file.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.16 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.17
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.16	Thu May 30 17:43:23 2019
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Sat May  2 08:56:55 2020
@@ -28,6 +28,7 @@
 #include "value.h"
 #include "gdbcore.h"
 #include "inferior.h"  /* for get_exec_file */
+#include "symfile.h"
 #include "gdbthread.h"
 #include "arch-utils.h"
 
@@ -144,9 +145,12 @@ bsd_kvm_target_open (const char *arg, in
 
   inf->gdbarch = get_current_arch ();
 
-  add_thread_silent (bsd_kvm_ptid);
+  thread_info *tp = add_thread_silent (bsd_kvm_ptid);
+  switch_to_thread(tp);
   inferior_ptid = bsd_kvm_ptid;
 
+  symbol_file_add_main(execfile, 0);
+
   target_fetch_registers (get_current_regcache (), -1);
 
   reinit_frame_cache ();



CVS commit: src/external/gpl3/gdb/dist

2020-03-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Mar 12 15:56:45 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/libiberty: strerror.c
src/external/gpl3/gdb/dist/sim/ppc: events.c hw_memory.c

Log Message:
Reduce diff with upstream

Remove local no longer needed modifications.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/libiberty/strerror.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/sim/ppc/events.c \
src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/libiberty/strerror.c
diff -u src/external/gpl3/gdb/dist/libiberty/strerror.c:1.3 src/external/gpl3/gdb/dist/libiberty/strerror.c:1.4
--- src/external/gpl3/gdb/dist/libiberty/strerror.c:1.3	Sun Aug 16 09:58:18 2015
+++ src/external/gpl3/gdb/dist/libiberty/strerror.c	Thu Mar 12 15:56:44 2020
@@ -347,7 +347,7 @@ static const struct error_info error_tab
   ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"),
 #endif
 #if defined (ENOPROTOOPT)
-  ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol option not available"),
+  ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"),
 #endif
 #if defined (EPROTONOSUPPORT)
   ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"),

Index: src/external/gpl3/gdb/dist/sim/ppc/events.c
diff -u src/external/gpl3/gdb/dist/sim/ppc/events.c:1.3 src/external/gpl3/gdb/dist/sim/ppc/events.c:1.4
--- src/external/gpl3/gdb/dist/sim/ppc/events.c:1.3	Thu Oct  3 18:30:46 2013
+++ src/external/gpl3/gdb/dist/sim/ppc/events.c	Thu Mar 12 15:56:45 2020
@@ -24,7 +24,6 @@
 #include "basics.h"
 #include "events.h"
 
-#include 
 #include 
 #include 
 
Index: src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c
diff -u src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c:1.3 src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c:1.4
--- src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c:1.3	Sun Aug 16 10:00:19 2015
+++ src/external/gpl3/gdb/dist/sim/ppc/hw_memory.c	Thu Mar 12 15:56:45 2020
@@ -29,8 +29,6 @@
 
 #include "device_table.h"
 
-#include 
-
 /* DEVICE
 
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-02-22 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Feb 23 02:06:01 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc64-tdep.c

Log Message:
Use C++ syntax for defining types, not C one.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c:1.1.1.8 src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c:1.1.1.8	Sun May 26 20:59:21 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc64-tdep.c	Sun Feb 23 02:06:01 2020
@@ -86,7 +86,7 @@
 static struct cmd_list_element *sparc64adilist = NULL;
 
 /* ADI stat settings.  */
-typedef struct
+struct adi_stat_t
 {
   /* The ADI block size.  */
   unsigned long blksize;
@@ -108,7 +108,7 @@ typedef struct
   /* ADI is available.  */
   bool is_avail = false;
 
-} adi_stat_t;
+};
 
 /* Per-process ADI stat info.  */
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2020-01-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan 30 20:38:12 UTC 2020

Modified Files:
src/external/gpl3/gdb/dist/gdb: solib.c

Log Message:
Don't implicitly cast away const char * when using correct C++ string.h
implementations. Those have overloaded string operations that preserve
constness.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/solib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/solib.c
diff -u src/external/gpl3/gdb/dist/gdb/solib.c:1.8 src/external/gpl3/gdb/dist/gdb/solib.c:1.9
--- src/external/gpl3/gdb/dist/gdb/solib.c:1.8	Fri Nov 22 01:48:50 2019
+++ src/external/gpl3/gdb/dist/gdb/solib.c	Thu Jan 30 20:38:12 2020
@@ -509,7 +509,7 @@ solib_bfd_open (const char *pathname)
   if (!b->compatible (b, bfd_get_arch_info (abfd.get (
 {
   char buf[SO_NAME_MAX_PATH_SIZE];
-  char *slash = strrchr(pathname, '/');
+  const char *slash = strrchr(pathname, '/');
   if (slash)
 {
   struct stat st;



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri May  3 19:06:50 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Improve comment in the GDB NetBSD code


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.8	Fri May  3 19:03:57 2019
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri May  3 19:06:50 2019
@@ -364,8 +364,7 @@ nbsd_wait (struct target_ops *ops,
* Always perform polling on exact PID, overwrite the default polling on
* WAIT_ANY.
*
-   * This avoids events reported in random order reported for FORK / VFORK
-   * when child and parent events are otherwise reported in random order.
+   * This avoids events reported in random order reported for FORK / VFORK.
*
* Polling on traced parent always simplifies the code.
*/



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri May  3 19:03:57 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: infrun.c nbsd-nat.c

Log Message:
Overwrite waiton_ptid in nbsd-nat, rather than generic core

This avoids compatibility issues with remote access to !NetBSD platform.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/infrun.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/infrun.c
diff -u src/external/gpl3/gdb/dist/gdb/infrun.c:1.2 src/external/gpl3/gdb/dist/gdb/infrun.c:1.3
--- src/external/gpl3/gdb/dist/gdb/infrun.c:1.2	Fri May  3 07:05:28 2019
+++ src/external/gpl3/gdb/dist/gdb/infrun.c	Fri May  3 19:03:57 2019
@@ -3874,11 +3874,7 @@ fetch_inferior_event (void *client_data)
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   struct cleanup *ts_old_chain;
   int cmd_done = 0;
-#if defined(__NetBSD__)
-  ptid_t waiton_ptid = inferior_ptid;
-#else
   ptid_t waiton_ptid = minus_one_ptid;
-#endif
 
   memset (ecs, 0, sizeof (*ecs));
 

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.7 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.8
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.7	Fri May  3 07:05:28 2019
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri May  3 19:03:57 2019
@@ -360,6 +360,17 @@ nbsd_wait (struct target_ops *ops,
 {
   ptid_t wptid;
 
+  /*
+   * Always perform polling on exact PID, overwrite the default polling on
+   * WAIT_ANY.
+   *
+   * This avoids events reported in random order reported for FORK / VFORK
+   * when child and parent events are otherwise reported in random order.
+   *
+   * Polling on traced parent always simplifies the code.
+   */
+  ptid = inferior_ptid;
+
   if (debug_nbsd_lwp)
 fprintf_unfiltered (gdb_stdlog, "NLWP: calling super_wait (%d, %ld, %ld) target_options=%#x\n",
 ptid_get_pid (ptid), ptid_get_lwp (ptid),



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri May  3 07:05:28 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: infrun.c nbsd-nat.c

Log Message:
Quick clean up the NetBSD support in GDB

Changes:

 - always perform polling on inferior_ptid, never -1
   -1 can cause catching fork/vfork events in random order
   polling on pid will guarantee to report events in expected order

 - assume availability of KERN_PROC_PATHNAME

 - drop dead code for KERN_PROC_AUXV (FreeBSD-specific sysctl)
   AUXV on NetBSD is handled with PIOD_READ_AUXV

 - drop unused nbsd_fetch_kinfo_proc

 - drop unneeded hacks for fork/vfork code

 - drop support for FreeBSD specific flags returned for PT_LWPINFO
   NetBSD uses PT_GET_SIGINFO / PT_GET_PROCESS_STATE for most pieces of
   information

 - port nbsd_thread_name to NetBSD

 - enable LWP and FORK events in nbsd_enable_proc_events

 - use NetBSD new batteries for distinguishing event type in to_wait
   map most events into GDB types
   breakpoint, single step, hw breakpoint/watchpoint ones are still not
   used with the full power here

 - add support for EXEC events

 - clean up

This change makes GDB functional with threaded code and it is good enough
to pass t_regress / threads test.

It's possible to execute and step processes with multiple threads, use
scheduler-lock, follow-fork etc features.

What does not work:

 - the LWP EXIT event and wait() are not synchronized and can deadlock
   this has been observed with exiting go applications

 - GDB VFORK code is still disabled and awaits kernel fixing

Short term goal is to correct LWP EXIT and follow up with VFORK fixes.

Long term goal is to rewrite NetBSD GDB support and write new support in
the remote process plugin (gdb-server) framework.

PR kern/53120
PR port-arm/51677
PR bin/54060
PR bin/49662
PR kern/52548


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/infrun.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/infrun.c
diff -u src/external/gpl3/gdb/dist/gdb/infrun.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/infrun.c:1.2
--- src/external/gpl3/gdb/dist/gdb/infrun.c:1.1.1.7	Tue Nov 28 18:18:23 2017
+++ src/external/gpl3/gdb/dist/gdb/infrun.c	Fri May  3 07:05:28 2019
@@ -3874,7 +3874,11 @@ fetch_inferior_event (void *client_data)
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   struct cleanup *ts_old_chain;
   int cmd_done = 0;
+#if defined(__NetBSD__)
+  ptid_t waiton_ptid = inferior_ptid;
+#else
   ptid_t waiton_ptid = minus_one_ptid;
+#endif
 
   memset (ecs, 0, sizeof (*ecs));
 

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.6 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.7
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.6	Sat Jun 23 03:15:55 2018
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri May  3 07:05:28 2019
@@ -45,7 +45,6 @@ nbsd_pid_to_exec_file (struct target_ops
   static char buf[PATH_MAX];
   char name[PATH_MAX];
 
-#ifdef KERN_PROC_PATHNAME
   size_t buflen;
   int mib[4];
 
@@ -56,7 +55,6 @@ nbsd_pid_to_exec_file (struct target_ops
   buflen = sizeof buf;
   if (sysctl (mib, 4, buf, , NULL, 0) == 0)
 return buf;
-#endif
 
   xsnprintf (name, PATH_MAX, "/proc/%d/exe", pid);
   len = readlink (name, buf, PATH_MAX - 1);
@@ -131,79 +129,6 @@ nbsd_find_memory_regions (struct target_
   return 0;
 }
 
-#ifdef KERN_PROC_AUXV
-static enum target_xfer_status (*super_xfer_partial) (struct target_ops *ops,
-		  enum target_object object,
-		  const char *annex,
-		  gdb_byte *readbuf,
-		  const gdb_byte *writebuf,
-		  ULONGEST offset,
-		  ULONGEST len,
-		  ULONGEST *xfered_len);
-
-/* Implement the "to_xfer_partial target_ops" method.  */
-
-static enum target_xfer_status
-nbsd_xfer_partial (struct target_ops *ops, enum target_object object,
-		   const char *annex, gdb_byte *readbuf,
-		   const gdb_byte *writebuf,
-		   ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
-{
-  pid_t pid = ptid_get_pid (inferior_ptid);
-
-  switch (object)
-{
-case TARGET_OBJECT_AUXV:
-  {
-	struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
-	unsigned char *buf;
-	size_t buflen;
-	int mib[4];
-
-	if (writebuf != NULL)
-	  return TARGET_XFER_E_IO;
-	mib[0] = CTL_KERN;
-	mib[1] = KERN_PROC;
-	mib[2] = KERN_PROC_AUXV;
-	mib[3] = pid;
-	if (offset == 0)
-	  {
-	buf = readbuf;
-	buflen = len;
-	  }
-	else
-	  {
-	buflen = offset + len;
-	buf = XCNEWVEC (unsigned char, buflen);
-	cleanup = make_cleanup (xfree, buf);
-	  }
-	if (sysctl (mib, 4, buf, , NULL, 0) == 0)
-	  {
-	if (offset != 0)
-	  {
-		if (buflen > offset)
-		  {
-		buflen -= offset;
-		memcpy (readbuf, buf + offset, 

CVS commit: src/external/gpl3/gdb/dist/gdb/config/arm

2019-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 18:04:23 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/arm: nbsdelf.mh

Log Message:
add missing files


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.7 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.8
--- src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.7	Thu Nov 30 10:26:55 2017
+++ src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh	Sat Apr 13 14:04:23 2019
@@ -1,4 +1,5 @@
 # Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o arm-nbsd-nat.o bsd-kvm.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o arm-nbsd-nat.o bsd-kvm.o \
+arm-bsd-tdep.o arm-nbsd-tdep.o
 
 LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 18:02:37 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
fix typo, unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.5	Wed Jan 24 04:04:42 2018
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Sat Apr 13 14:02:37 2019
@@ -303,7 +303,6 @@ fetch_fp_regs (struct regcache *regcache
 {
   struct fpreg inferior_fp_registers;
   int ret;
-  int regno;
 
   ret = ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid),
 		(PTRACE_TYPE_ARG3) _fp_registers, ptid_get_lwp(inferior_ptid));
@@ -599,7 +598,7 @@ fetch_elfcore_registers (struct regcache
 
 static struct core_fns arm_netbsd_core_fns =
 {
-  bfd_target_unknown_flavour,		/* core_flovour.  */
+  bfd_target_unknown_flavour,		/* core_flavour.  */
   default_check_format,			/* check_format.  */
   default_core_sniffer,			/* core_sniffer.  */
   fetch_core_registers,			/* core_read_registers.  */
@@ -608,7 +607,7 @@ static struct core_fns arm_netbsd_core_f
 
 static struct core_fns arm_netbsd_elfcore_fns =
 {
-  bfd_target_elf_flavour,		/* core_flovour.  */
+  bfd_target_elf_flavour,		/* core_flavour.  */
   default_check_format,			/* check_format.  */
   default_core_sniffer,			/* core_sniffer.  */
   fetch_elfcore_registers,		/* core_read_registers.  */



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 18:02:06 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-bsd-tdep.c

Log Message:
fix core stack traces (missing register 25)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c:1.1.1.1	Tue Nov 28 13:18:09 2017
+++ src/external/gpl3/gdb/dist/gdb/arm-bsd-tdep.c	Sat Apr 13 14:02:05 2019
@@ -83,7 +83,7 @@ armbsd_supply_gregset (const struct regs
 }
 
   if (regnum == ARM_PS_REGNUM || regnum == -1)
-regcache_raw_supply (regcache, i, regs + 16 * 4);
+regcache_raw_supply (regcache, ARM_PS_REGNUM, regs + 16 * 4);
 
   if (len >= ARMBSD_SIZEOF_GREGS + ARMBSD_SIZEOF_FPREGS)
 {



CVS commit: src/external/gpl3/gdb/dist/gdb/config/vax

2019-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 14:17:36 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/vax: nbsdelf.mh

Log Message:
add a missing file


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh:1.5 src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh:1.6
--- src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh:1.5	Thu Nov 30 10:26:55 2017
+++ src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh	Tue Apr  2 10:17:36 2019
@@ -1,4 +1,5 @@
 # Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o vax-bsd-nat.o bsd-kvm.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o vax-bsd-nat.o bsd-kvm.o \
+	vax-nbsd-tdep.o
 
 LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-12-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec 21 11:11:40 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c aarch64-nbsd-tdep.h
src/external/gpl3/gdb/dist/gdb/config/aarch64: nbsd.mh

Log Message:
s/Free/Net/; s/amd64/aarch64/.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.3	Wed Jul 11 13:52:35 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-/* Target-dependent code for FreeBSD/aarch64.
+/* Target-dependent code for NetBSD/aarch64.
 
Copyright (C) 2017-2018 Free Software Foundation, Inc.
 

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2	Fri Jun 22 19:41:40 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-/* FreeBSD/aarch64 target support, prototypes.
+/* NetBSD/aarch64 target support, prototypes.
 
Copyright (C) 2017-2018 Free Software Foundation, Inc.
 

Index: src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.1 src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.2
--- src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh:1.1	Mon May 21 02:10:47 2018
+++ src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh	Fri Dec 21 11:11:40 2018
@@ -1,4 +1,4 @@
-# Host: NetBSD/amd64
+# Host: NetBSD/arm64
 NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o aarch64-nbsd-nat.o \
 	bsd-kvm.o
 



CVS commit: src/external/gpl3/gdb/dist/bfd

2018-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 12 23:18:28 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf.c

Log Message:
aarch64 does not have PT_STEP so we start from 0.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/bfd/elf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/elf.c
diff -u src/external/gpl3/gdb/dist/bfd/elf.c:1.9 src/external/gpl3/gdb/dist/bfd/elf.c:1.10
--- src/external/gpl3/gdb/dist/bfd/elf.c:1.9	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/bfd/elf.c	Thu Jul 12 19:18:28 2018
@@ -10041,6 +10041,7 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf
   /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and
 	 PT_GETFPREGS == mach+2.  */
 
+case bfd_arch_aarch64:
 case bfd_arch_alpha:
 case bfd_arch_sparc:
   switch (note->type)



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-07-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 11 13:52:35 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c aarch64-tdep.c

Log Message:
fix signness issues.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.2	Fri Jun 22 15:41:16 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Wed Jul 11 09:52:35 2018
@@ -118,11 +118,11 @@ static const struct tramp_frame aarch64_
   SIGTRAMP_FRAME,
   4,
   {
-{0x910003e0, -1},		/* mov  x0, sp  */
-{0x91014000, -1},		/* add  x0, x0, #SF_UC  */
-{0xd2803428, -1},		/* mov  x8, #SYS_sigreturn  */
-{0xd401, -1},		/* svc  0x0  */
-{TRAMP_SENTINEL_INSN, -1}
+{0x910003e0, (ULONGEST)-1},		/* mov  x0, sp  */
+{0x91014000, (ULONGEST)-1},		/* add  x0, x0, #SF_UC  */
+{0xd2803428, (ULONGEST)-1},		/* mov  x8, #SYS_sigreturn  */
+{0xd401, (ULONGEST)-1},		/* svc  0x0  */
+{(ULONGEST)TRAMP_SENTINEL_INSN, (ULONGEST)-1}
   },
   aarch64_nbsd_sigframe_init
 };

Index: src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c:1.1.1.6 src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c:1.1.1.6	Tue Nov 28 13:18:03 2017
+++ src/external/gpl3/gdb/dist/gdb/aarch64-tdep.c	Wed Jul 11 09:52:35 2018
@@ -2425,7 +2425,7 @@ aarch64_software_single_step (struct reg
   const int insn_size = 4;
   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
   CORE_ADDR pc = regcache_read_pc (regcache);
-  CORE_ADDR breaks[2] = { -1, -1 };
+  CORE_ADDR breaks[2] = { (ULONGEST)-1, (ULONGEST)-1 };
   CORE_ADDR loc = pc;
   CORE_ADDR closing_insn = 0;
   uint32_t insn = read_memory_unsigned_integer (loc, insn_size,



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 23 03:15:55 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c nbsd-nat.c

Log Message:
Fix thread debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.18
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17	Fri Dec  1 17:19:59 2017
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Fri Jun 22 23:15:55 2018
@@ -353,7 +353,7 @@ inf_ptrace_resume (struct target_ops *op
  all possible successor instructions), so we don't have to
  worry about that here.  */
   request = PT_STEP;
-#if 0
+#if __NetBSD__
   /*
* On NetBSD the data field of PT_STEP contains the thread
* to be stepped; all other threads are continued if this value is > 0

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.5	Sun Dec 10 00:36:25 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Jun 22 23:15:55 2018
@@ -371,7 +371,7 @@ nbsd_add_threads (pid_t pid)
   int val;
   struct ptrace_lwpinfo pl;
 
-  gdb_assert (!in_thread_list (pid_to_ptid (pid)));
+//  gdb_assert (!in_thread_list (pid_to_ptid (pid)));
   pl.pl_lwpid = 0;
   while ((val = ptrace (PT_LWPINFO, pid, (void *), sizeof(pl))) != -1
 && pl.pl_lwpid != 0)
@@ -537,68 +537,13 @@ static void
 nbsd_resume (struct target_ops *ops,
 	 ptid_t ptid, int step, enum gdb_signal signo)
 {
-#if defined(TDP_RFPPWAIT) && !defined(PTRACE_VFORK)
-  pid_t pid;
-
-  /* Don't PT_CONTINUE a process which has a pending vfork done event.  */
-  if (ptid_equal (minus_one_ptid, ptid))
-pid = ptid_get_pid (inferior_ptid);
-  else
-pid = ptid_get_pid (ptid);
-  if (nbsd_is_vfork_done_pending (pid))
-return;
-#endif
-
   if (debug_nbsd_lwp)
 fprintf_unfiltered (gdb_stdlog,
 			"NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
 			ptid_get_pid (ptid), ptid_get_lwp (ptid),
 			ptid_get_tid (ptid));
-  if (ptid_lwp_p (ptid))
-{
-  /* FreeBSD: If ptid is a specific LWP, suspend all other LWPs in the
-   * process.
-   */
-  /* NetBSD, this function is about resuming so we only deal with
-   * the thread we've been asked to work with
-   */
-  struct thread_info *tp;
-  int request;
-
-  ALL_NON_EXITED_THREADS (tp)
-{
-	  if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid))
-	continue;
-
-	  if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid))
-	request = PT_RESUME;
-#ifndef __NetBSD__
-	  else
-	request = PT_SUSPEND;
-#endif
-
-	  if (ptrace (request, ptid_get_pid (tp->ptid), NULL,
-	  ptid_get_lwp (tp->ptid)) == -1)
-	perror_with_name (("ptrace"));
-	}
-}
-  else
-{
-  /* If ptid is a wildcard, resume all matching threads (they won't run
-	 until the process is continued however).  */
-  struct thread_info *tp;
-
-  ALL_NON_EXITED_THREADS (tp)
-{
-	  if (!ptid_match (tp->ptid, ptid))
-	continue;
-
-	  if (ptrace (PT_RESUME, ptid_get_pid (tp->ptid), NULL,
-	  ptid_get_lwp (tp->ptid)) == -1)
-	perror_with_name (("ptrace"));
-	}
-  ptid = inferior_ptid;
-}
+  if (ptid_get_pid(ptid) == -1)
+ptid = inferior_ptid;
   super_resume (ops, ptid, step, signo);
 }
 
@@ -613,203 +558,35 @@ nbsd_wait (struct target_ops *ops,
 {
   ptid_t wptid;
 
-  while (1)
+  wptid = super_wait (ops, ptid, ourstatus, target_options);
+  if (ourstatus->kind == TARGET_WAITKIND_STOPPED)
 {
-#ifndef PTRACE_VFORK
-  wptid = nbsd_next_vfork_done ();
-  if (!ptid_equal (wptid, null_ptid))
-	{
-	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
-	  return wptid;
-	}
-#endif
-  wptid = super_wait (ops, ptid, ourstatus, target_options);
-  if (ourstatus->kind == TARGET_WAITKIND_STOPPED)
-	{
-	  struct ptrace_lwpinfo pl;
-	  pid_t pid;
-	  int status;
-
-	  pid = ptid_get_pid (wptid);
-	  pl.pl_lwpid = 0;
-	  if (ptrace (PT_LWPINFO, pid, (caddr_t) , sizeof pl) == -1)
-	perror_with_name (("ptrace"));
-
-	  wptid = ptid_build (pid, pl.pl_lwpid, 0);
-
-#ifdef PT_LWP_EVENTS
-	  if (pl.pl_flags & PL_FLAG_EXITED)
-	{
-	  /* If GDB attaches to a multi-threaded process, exiting
-		 threads might be skipped during nbsd_post_attach that
-		 have not yet reported their PL_FLAG_EXITED event.
-		 Ignore EXITED events for an unknown LWP.  */
-	  if (in_thread_list (wptid))
-		{
-		  if (debug_nbsd_lwp)
-		fprintf_unfiltered (gdb_stdlog,
-	"NLWP: deleting thread for LWP %u\n",
-	pl.pl_lwpid);
-		

CVS commit: src/external/gpl3/gdb/dist/gdb

2018-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 22 19:41:40 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.h

Log Message:
match our number of registers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.1	Sun May 20 22:10:47 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h	Fri Jun 22 15:41:40 2018
@@ -19,10 +19,10 @@
 
 #include "regset.h"
 
-/* The general-purpose regset consists of 30 X registers, plus LR, SP,
-   ELR, and SPSR registers.  SPSR is 32 bits but the structure is
+/* The general-purpose regset consists of 31 registers (30 X , plus LR), SP,
+   ELR (PC), SPSR register, and TPIDR.  SPSR is 32 bits but the structure is
passed to 64 bit alignment.  */
-#define AARCH64_NBSD_SIZEOF_GREGSET  (34 * X_REGISTER_SIZE)
+#define AARCH64_NBSD_SIZEOF_GREGSET  (35 * X_REGISTER_SIZE)
 
 /* The fp regset consists of 32 V registers, plus FPSR and FPCR which
are 4 bytes wide each, and the whole structure is padded to 128 bit



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 22 19:41:16 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c

Log Message:
use the right emulation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.1	Sun May 20 22:10:47 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Fri Jun 22 15:41:16 2018
@@ -197,6 +197,6 @@ aarch64_nbsd_init_abi (struct gdbarch_in
 void
 _initialize_aarch64_nbsd_tdep (void)
 {
-  gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_FREEBSD,
+  gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_NETBSD,
 			  aarch64_nbsd_init_abi);
 }



CVS commit: src/external/gpl3/gdb/dist

2018-05-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 21 02:10:47 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/bfd: config.bfd
src/external/gpl3/gdb/dist/gdb: Makefile.in configure.host
configure.tgt
Added Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c aarch64-nbsd-tdep.c
aarch64-nbsd-tdep.h
src/external/gpl3/gdb/dist/gdb/config/aarch64: nbsd.mh

Log Message:
add minimal glue to make gdb compile on aarch-64; now configure in gdb/dist
and gmake creates a gdb binary.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/bfd/config.bfd
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/Makefile.in
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/configure.host
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/config/aarch64/nbsd.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/config.bfd
diff -u src/external/gpl3/gdb/dist/bfd/config.bfd:1.17 src/external/gpl3/gdb/dist/bfd/config.bfd:1.18
--- src/external/gpl3/gdb/dist/bfd/config.bfd:1.17	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/bfd/config.bfd	Sun May 20 22:10:46 2018
@@ -260,6 +260,11 @@ case "${targ}" in
 targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
 want64=true
 ;;
+  aarch64-*-netbsd*)
+targ_defvec=aarch64_elf64_le_vec
+targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
+want64=true
+;;
   aarch64-*-fuchsia*)
 targ_defvec=aarch64_elf64_le_vec
 targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"

Index: src/external/gpl3/gdb/dist/gdb/Makefile.in
diff -u src/external/gpl3/gdb/dist/gdb/Makefile.in:1.1.1.7 src/external/gpl3/gdb/dist/gdb/Makefile.in:1.2
--- src/external/gpl3/gdb/dist/gdb/Makefile.in:1.1.1.7	Tue Nov 28 13:18:04 2017
+++ src/external/gpl3/gdb/dist/gdb/Makefile.in	Sun May 20 22:10:47 2018
@@ -2460,6 +2460,8 @@ MAKEOVERRIDES =
 ALLDEPFILES = \
 	aarch64-linux-nat.c \
 	aarch64-linux-tdep.c \
+	aarch64-nbsd-nat.c \
+	aarch64-nbsd-tdep.c \
 	aarch64-newlib-tdep.c \
 	aarch64-tdep.c \
 	aix-thread.c \

Index: src/external/gpl3/gdb/dist/gdb/configure.host
diff -u src/external/gpl3/gdb/dist/gdb/configure.host:1.9 src/external/gpl3/gdb/dist/gdb/configure.host:1.10
--- src/external/gpl3/gdb/dist/gdb/configure.host:1.9	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/gdb/configure.host	Sun May 20 22:10:47 2018
@@ -84,6 +84,7 @@ case "${host}" in
 *-*-darwin*)		gdb_host=darwin ;;
 
 aarch64*-*-linux*)	gdb_host=linux ;;
+aarch64*-*-netbsd*)	gdb_host=nbsd ;;
 
 alpha*-*-linux*)	gdb_host=alpha-linux ;;
 alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu)

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.18 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.19
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.18	Mon Jan  8 13:56:20 2018
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Sun May 20 22:10:47 2018
@@ -56,8 +56,8 @@ aarch64*-*-linux*)
 
 aarch64*-*-netbsd*)
 	# Target: AArch64 NetBSD
-	#gdb_target_obs="aarch64-tdep.o aarch64-netbsd-tdep.o"
-	gdb_target_obs="aarch64-tdep.o aarch64-insn.o solib-svr4.o"
+	gdb_target_obs="aarch64-tdep.o aarch64-nbsd-tdep.o \
+			aarch64-insn.o solib-svr4.o"
 	;;
 
 alpha*-*-osf*)

Added files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.1
--- /dev/null	Sun May 20 22:10:47 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Sun May 20 22:10:47 2018
@@ -0,0 +1,136 @@
+/* Native-dependent code for NetBSD/aarch64.
+
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see .  */
+
+#include "defs.h"
+#include "target.h"
+
+#include 
+#include 
+#include 
+
+#include "nbsd-nat.h"
+#include "aarch64-tdep.h"
+#include "aarch64-nbsd-tdep.h"
+#include "regcache.h"
+#include "gdbcore.h"

CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:54:48 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: dwarf2read.c

Log Message:
Annotate mixing of enums from different types with an explicit cast.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/dwarf2read.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/dwarf2read.c
diff -u src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.2
--- src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.1.1.7	Tue Nov 28 18:18:12 2017
+++ src/external/gpl3/gdb/dist/gdb/dwarf2read.c	Wed May 16 13:54:48 2018
@@ -22159,7 +22159,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
 	  }
 	  break;
 
-case DW_MACINFO_vendor_ext:
+case (int)DW_MACINFO_vendor_ext:
 	  if (!section_is_gnu)
 	{
 	  unsigned int bytes_read;
@@ -22336,7 +22336,7 @@ dwarf_decode_macros (struct dwarf2_cu *c
 	  mac_ptr += offset_size;
 	  break;
 
-	case DW_MACINFO_vendor_ext:
+	case (int)DW_MACINFO_vendor_ext:
 	  /* Only skip the data by MAC_PTR.  */
 	  if (!section_is_gnu)
 	{



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  9 13:52:55 UTC 2018

Removed Files:
src/external/gpl3/gdb/dist/gdb: rust-exp.c

Log Message:
remove generated file


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gdb/dist/gdb/rust-exp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 23 14:53:07 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-tdep.c i386-nbsd-tdep.c

Log Message:
Add "Xhandle*" interrupt handling.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c:1.3	Wed Nov 29 13:15:29 2017
+++ src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c	Mon Apr 23 10:53:07 2018
@@ -148,10 +148,21 @@ amd64nbsd_trapframe_cache(struct frame_i
 
   /* There is an extra 'call' in the interrupt sequence - ignore the extra
* return address */
-  if (name && strncmp (name, "Xintr", 5) == 0)
-addr = sp + 8;		/* It's an interrupt frame.  */
-  else
-addr = sp;
+
+  addr = sp;
+  if (name) {
+	if (strncmp (name, "Xintr", 5) == 0
+	 || strncmp (name, "Xhandle", 7) == 0) {
+		addr += 8;		/* It's an interrupt frame.  */
+	}
+  }
+
+#ifdef DEBUG_TRAPFRAME
+  for (i = 0; i < 50; i++) {
+cs = read_memory_unsigned_integer (addr + i * 8, 8, byte_order);
+printf("%s i=%d r=%#jx\n", name, i, (intmax_t)cs);
+  }
+#endif
 
   for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++)
 if (amd64nbsd_tf_reg_offset[i] != -1)
@@ -163,6 +174,10 @@ amd64nbsd_trapframe_cache(struct frame_i
   rip = read_memory_unsigned_integer (addr
 + amd64nbsd_tf_reg_offset[AMD64_RIP_REGNUM], 8, byte_order);
 
+#ifdef DEBUG_TRAPFRAME
+  printf("%s cs=%#jx rip=%#jx\n", name, (intmax_t)cs, (intmax_t)rip);
+#endif
+
   /* The trap frame layout was changed lf the %rip value is less than 2^16 it
* is almost certainly the %ss of the old format. */
   if (rip < (1 << 16))
@@ -243,16 +258,20 @@ amd64nbsd_trapframe_sniffer (const struc
 
   find_pc_partial_function (get_frame_pc (this_frame), , NULL, NULL);
   return (name && ((strcmp (name, "alltraps") == 0)
-		   || (strcmp (name, "calltrap") == 0)
-		   || (strncmp (name, "Xtrap", 5) == 0)
-		   || (strcmp (name, "osyscall1") == 0)
-		   || (strcmp (name, "Xsyscall") == 0)
-		   || (strncmp (name, "Xintr", 5) == 0)
-		   || (strncmp (name, "Xresume", 7) == 0)
-		   || (strncmp (name, "Xstray", 6) == 0)
-		   || (strncmp (name, "Xrecurse", 8) == 0)
-		   || (strncmp (name, "Xsoft", 5) == 0)
-		   || (strcmp (name, "Xdoreti") == 0)));
+	|| (strcmp (name, "calltrap") == 0)
+	|| (strcmp (name, "handle_syscall") == 0)
+		|| (strcmp (name, "Xdoreti") == 0)
+		|| (strcmp (name, "Xspllower") == 0)
+		|| (strncmp (name, "Xhandle", 7) == 0)
+		|| (strncmp (name, "Xintr", 5) == 0)
+		|| (strncmp (name, "Xpreempt", 8) == 0)
+		|| (strncmp (name, "Xrecurse", 8) == 0)
+		|| (strncmp (name, "Xresume", 7) == 0)
+		|| (strncmp (name, "Xsoft", 5) == 0)
+		|| (strncmp (name, "Xstray", 6) == 0)
+		|| (strncmp (name, "Xsyscall", 8) == 0)
+		|| (strncmp (name, "Xtrap", 5) == 0)
+	));
 }
 
 static const struct frame_unwind amd64nbsd_trapframe_unwind = {
Index: src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c:1.3	Wed Nov 29 13:15:29 2017
+++ src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c	Mon Apr 23 10:53:07 2018
@@ -312,7 +312,8 @@ i386nbsd_trapframe_cache(struct frame_in
   sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
 
   find_pc_partial_function (func, , NULL, NULL);
-  if (name && strncmp (name, "Xintr", 5) == 0)
+  if (name && (strncmp (name, "Xintr", 5) == 0 ||
+   strncmp (name, "Xhandle", 7) == 0))
 {
   /* It's an interrupt frame. */
   tmp = read_memory_unsigned_integer (sp + 4, 4, byte_order);
@@ -391,16 +392,19 @@ i386nbsd_trapframe_sniffer (const struct
 
   find_pc_partial_function (get_frame_pc (this_frame), , NULL, NULL);
   return (name && ((strcmp (name, "alltraps") == 0)
-		   || (strcmp (name, "calltrap") == 0)
-		   || (strncmp (name, "Xtrap", 5) == 0)
-		   || (strcmp (name, "syscall1") == 0)
-		   || (strcmp (name, "Xsyscall") == 0)
-		   || (strncmp (name, "Xintr", 5) == 0)
-		   || (strncmp (name, "Xresume", 7) == 0)
-		   || (strncmp (name, "Xstray", 6) == 0)
-		   || (strncmp (name, "Xrecurse", 8) == 0)
-		   || (strncmp (name, "Xsoft", 5) == 0)
-		   || (strncmp (name, "Xdoreti", 5) == 0)));
+	|| (strcmp (name, "calltrap") == 0)
+		|| (strcmp (name, "syscall1") == 0)
+		|| (strcmp (name, "Xdoreti") == 0)
+		|| (strncmp (name, "Xintr", 5) == 0)
+		|| (strncmp (name, "Xhandle", 7) == 0)
+		|| (strncmp (name, "Xpreempt", 8) == 0)
+		|| (strncmp (name, "Xrecurse", 8) == 0)
+		

CVS commit: src/external/gpl3/gdb/dist/gdb

2018-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  8 04:00:00 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-bsd-nat.c

Log Message:
don't do anything for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.3	Sun Jan  7 22:07:16 2018
+++ src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c	Sun Jan  7 23:00:00 2018
@@ -209,8 +209,10 @@ void _initialize_alphabsd_nat (void);
 void
 _initialize_alphabsd_nat (void)
 {
+#ifndef __NetBSD__
   struct target_ops *t;
 
   t = alphabsd_target ();
   add_target (t);
+#endif
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  8 03:07:16 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-bsd-nat.c alpha-bsd-tdep.h
configure.tgt
src/external/gpl3/gdb/dist/gdb/config/alpha: nbsd.mh
Added Files:
src/external/gpl3/gdb/dist/gdb: alpha-nbsd-nat.c

Log Message:
add a netbsd-specific alpha target to handle thread initialization.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-nat.c
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.2	Mon Jan  1 11:28:14 2018
+++ src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c	Sun Jan  7 22:07:16 2018
@@ -186,6 +186,22 @@ alphabsd_supply_pcb (struct regcache *re
   return 1;
 }
 
+struct target_ops *
+alphabsd_target (void)
+{
+  struct target_ops *t;
+
+  t = inf_ptrace_target ();
+  t->to_fetch_registers = alphabsd_fetch_inferior_registers;
+  t->to_store_registers = alphabsd_store_inferior_registers;
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (alphabsd_supply_pcb);
+
+  return t;
+}
+
+
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_alphabsd_nat (void);
@@ -195,11 +211,6 @@ _initialize_alphabsd_nat (void)
 {
   struct target_ops *t;
 
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = alphabsd_fetch_inferior_registers;
-  t->to_store_registers = alphabsd_store_inferior_registers;
+  t = alphabsd_target ();
   add_target (t);
-
-  /* Support debugging kernel virtual memory images.  */
-  bsd_kvm_add_target (alphabsd_supply_pcb);
 }

Index: src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h:1.1.1.1 src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h:1.2
--- src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h:1.1.1.1	Tue Nov 28 13:18:05 2017
+++ src/external/gpl3/gdb/dist/gdb/alpha-bsd-tdep.h	Sun Jan  7 22:07:16 2018
@@ -37,4 +37,6 @@ void alphanbsd_iterate_over_regset_secti
 	 void *cb_data,
 	 const struct regcache *regcache);
 
+struct target_ops *alphabsd_target (void);
+
 #endif /* alpha-bsd-tdep.h */

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.16 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.17
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.16	Wed Nov 29 17:40:18 2017
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Sun Jan  7 22:07:16 2018
@@ -72,7 +72,8 @@ alpha*-*-linux*)
 alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu)
 	# Target: NetBSD/alpha
 	gdb_target_obs="alpha-tdep.o alpha-mdebug-tdep.o alpha-bsd-tdep.o \
-			alpha-nbsd-tdep.o nbsd-tdep.o solib-svr4.o"
+			alpha-nbsd-tdep.o alpha-nbsd-nat.o nbsd-tdep.o \
+			solib-svr4.o"
 	;;
 alpha*-*-openbsd*)
 	# Target: OpenBSD/alpha

Index: src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh:1.5 src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh:1.6
--- src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh:1.5	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh	Sun Jan  7 22:07:16 2018
@@ -1,4 +1,5 @@
 # Host: NetBSD/alpha
-NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o nbsd-nat.o
+NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o nbsd-nat.o \
+alpha-nbsd-tdep.o alpha-nbsd-nat.o
 
 LOADLIBES= -lkvm

Added files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-nbsd-nat.c
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/alpha-nbsd-nat.c:1.1
--- /dev/null	Sun Jan  7 22:07:16 2018
+++ src/external/gpl3/gdb/dist/gdb/alpha-nbsd-nat.c	Sun Jan  7 22:07:16 2018
@@ -0,0 +1,44 @@
+/* Native-dependent code for NetBSD/alpha.
+
+   Copyright (C) 2018 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   

CVS commit: src/external/gpl3/gdb/dist/gdb

2018-01-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  1 16:28:14 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-bsd-nat.c

Log Message:
pass the lwp for the register calls.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.1.1.1	Tue Nov 28 13:18:23 2017
+++ src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c	Mon Jan  1 11:28:14 2018
@@ -92,7 +92,7 @@ alphabsd_fetch_inferior_registers (struc
   struct reg gregs;
 
   if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-		  (PTRACE_TYPE_ARG3) , 0) == -1)
+		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   alphabsd_supply_reg (regcache, (char *) , regno);
@@ -106,7 +106,7 @@ alphabsd_fetch_inferior_registers (struc
   struct fpreg fpregs;
 
   if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-		  (PTRACE_TYPE_ARG3) , 0) == -1)
+		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   alphabsd_supply_fpreg (regcache, (char *) , regno);
@@ -124,13 +124,13 @@ alphabsd_store_inferior_registers (struc
 {
   struct reg gregs;
   if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-  (PTRACE_TYPE_ARG3) , 0) == -1)
+  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't get registers"));
 
   alphabsd_fill_reg (regcache, (char *) , regno);
 
   if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-  (PTRACE_TYPE_ARG3) , 0) == -1)
+  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't write registers"));
 
   if (regno != -1)
@@ -143,13 +143,13 @@ alphabsd_store_inferior_registers (struc
   struct fpreg fpregs;
 
   if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-		  (PTRACE_TYPE_ARG3) , 0) == -1)
+		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   alphabsd_fill_fpreg (regcache, (char *) , regno);
 
   if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
-		  (PTRACE_TYPE_ARG3) , 0) == -1)
+		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 27 19:20:41 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c

Log Message:
remove unused code
XXX: we should remove this from all archs


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.4	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c	Wed Dec 27 14:20:41 2017
@@ -122,45 +122,6 @@ amd64nbsd_supply_pcb (struct regcache *r
   return 1;
 }
 
-void
-supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
-{
-  amd64_supply_native_gregset (regcache, gregsetp, -1);
-}
-
-/* Fill register REGNUM (if it is a general-purpose register) in
-   *GREGSETP with the value in GDB's register cache.  If REGNUM is -1,
-   do this for all registers.  */
-
-void
-fill_gregset (const struct regcache *regcache,
-	  gregset_t *gregsetp, int regnum)
-{
-  amd64_collect_native_gregset (regcache, gregsetp, regnum);
-}
-
-/* Transfering floating-point registers between GDB, inferiors and cores.  */
-
-/* Fill GDB's register cache with the floating-point and SSE register
-   values in *FPREGSETP.  */
-
-void
-supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
-{
-  amd64_supply_fxsave (regcache, -1, fpregsetp);
-}
-
-/* Fill register REGNUM (if it is a floating-point or SSE register) in
-   *FPREGSETP with the value in GDB's register cache.  If REGNUM is
-   -1, do this for all registers.  */
-
-void
-fill_fpregset (const struct regcache *regcache,
-	   fpregset_t *fpregsetp, int regnum)
-{
-  amd64_collect_fxsave (regcache, regnum, fpregsetp);
-}
-
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64nbsd_nat (void);
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 27 19:20:04 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: x86-bsd-nat.c

Log Message:
one more place to pass the thread id


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.3	Fri Dec  1 17:15:17 2017
+++ src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c	Wed Dec 27 14:20:04 2017
@@ -69,7 +69,7 @@ x86bsd_dr_get (ptid_t ptid, int regnum)
   struct dbreg dbregs;
 
   if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
-	  (PTRACE_TYPE_ARG3) , 0) == -1)
+	  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't read debug registers"));
 
   return DBREG_DRX ((), regnum);



CVS commit: src/external/gpl3/gdb/dist/gdb/tui

2017-12-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 17 17:49:04 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb/tui: tui-data.c tui-wingeneral.c
tui-winsource.c

Log Message:
Don't core dump when the window is too small
XXX: feed upstream


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/tui/tui-data.c \
src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c \
src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/tui/tui-data.c
diff -u src/external/gpl3/gdb/dist/gdb/tui/tui-data.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/tui/tui-data.c:1.2
--- src/external/gpl3/gdb/dist/gdb/tui/tui-data.c:1.1.1.7	Tue Nov 28 13:18:30 2017
+++ src/external/gpl3/gdb/dist/gdb/tui/tui-data.c	Sun Dec 17 12:49:04 2017
@@ -576,6 +576,9 @@ tui_alloc_content (int num_elements, enu
   struct tui_win_element *element_block_ptr;
   int i;
 
+  if (num_elements <= 0)
+return NULL;
+
   content = XNEWVEC (struct tui_win_element *, num_elements);
 
   /*
Index: src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c
diff -u src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c:1.2
--- src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c:1.1.1.7	Tue Nov 28 13:18:30 2017
+++ src/external/gpl3/gdb/dist/gdb/tui/tui-wingeneral.c	Sun Dec 17 12:49:04 2017
@@ -247,32 +247,35 @@ tui_make_all_invisible (void)
   make_all_visible (0);
 }
 
+static void
+tui_refresh_wi(struct tui_gen_win_info *wi)
+{
+  if (wi == NULL || wi->handle == NULL || !wi->is_visible)
+return;
+
+  touchwin (wi->handle);
+  tui_refresh_win (wi);
+}
+
 /* Function to refresh all the windows currently displayed.  */
 
 void
 tui_refresh_all (struct tui_win_info **list)
 {
   int type;
-  struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
 
   for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
 {
-  if (list[type] && list[type]->generic.is_visible)
+  if (!list[type] || !list[type]->generic.is_visible)
+	continue;
+  if (type == SRC_WIN || type == DISASSEM_WIN)
 	{
-	  if (type == SRC_WIN || type == DISASSEM_WIN)
-	{
-	  touchwin (list[type]->detail.source_info.execution_info->handle);
-	  tui_refresh_win (list[type]->detail.source_info.execution_info);
-	}
-	  touchwin (list[type]->generic.handle);
-	  tui_refresh_win ([type]->generic);
+	  tui_refresh_wi (list[type]->detail.source_info.execution_info);
 	}
+  tui_refresh_wi ([type]->generic);
 }
-  if (locator->is_visible)
-{
-  touchwin (locator->handle);
-  tui_refresh_win (locator);
-}
+
+  tui_refresh_wi (tui_locator_win_info_ptr ());
 }
 
 
Index: src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c
diff -u src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.2
--- src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.1.1.7	Tue Nov 28 13:18:30 2017
+++ src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c	Sun Dec 17 12:49:04 2017
@@ -559,6 +559,9 @@ tui_show_exec_info_content (struct tui_w
 = win_info->detail.source_info.execution_info;
   int cur_line;
 
+  if (exec_info->handle == NULL)
+return;
+
   werase (exec_info->handle);
   tui_refresh_win (exec_info);
   for (cur_line = 1; (cur_line <= exec_info->content_size); cur_line++)
@@ -578,6 +581,9 @@ tui_erase_exec_info_content (struct tui_
   struct tui_gen_win_info *exec_info
 = win_info->detail.source_info.execution_info;
 
+  if (exec_info->handle == NULL)
+return;
+
   werase (exec_info->handle);
   tui_refresh_win (exec_info);
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 10 05:36:25 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
PR/52799: Martin Husemann: Correct sysctl args to find executable.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.4	Fri Dec  1 17:22:40 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Sun Dec 10 00:36:25 2017
@@ -50,9 +50,9 @@ nbsd_pid_to_exec_file (struct target_ops
   int mib[4];
 
   mib[0] = CTL_KERN;
-  mib[1] = KERN_PROC;
-  mib[2] = KERN_PROC_PATHNAME;
-  mib[3] = pid;
+  mib[1] = KERN_PROC_ARGS;
+  mib[2] = pid;
+  mib[3] = KERN_PROC_PATHNAME;
   buflen = sizeof buf;
   if (sysctl (mib, 4, buf, , NULL, 0) == 0)
 return buf;



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 18:39:52 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: mips-nbsd-nat.c

Log Message:
include nbsd-nat.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.4	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c	Sat Dec  2 13:39:52 2017
@@ -39,6 +39,7 @@ typedef struct fpreg fpregset_t;
 #include "gregset.h"
 
 #include "mips-tdep.h"
+#include "nbsd-nat.h"
 #include "mips-nbsd-tdep.h"
 #include "inf-ptrace.h"
 #include "bsd-kvm.h"



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:22:40 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
don't suspend other threads if we are resuming.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3	Fri Dec  1 17:20:44 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Dec  1 17:22:40 2017
@@ -556,7 +556,12 @@ nbsd_resume (struct target_ops *ops,
 			ptid_get_tid (ptid));
   if (ptid_lwp_p (ptid))
 {
-  /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
+  /* FreeBSD: If ptid is a specific LWP, suspend all other LWPs in the
+   * process.
+   */
+  /* NetBSD, this function is about resuming so we only deal with
+   * the thread we've been asked to work with
+   */
   struct thread_info *tp;
   int request;
 
@@ -567,8 +572,10 @@ nbsd_resume (struct target_ops *ops,
 
 	  if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid))
 	request = PT_RESUME;
+#ifndef __NetBSD__
 	  else
 	request = PT_SUSPEND;
+#endif
 
 	  if (ptrace (request, ptid_get_pid (tp->ptid), NULL,
 	  ptid_get_lwp (tp->ptid)) == -1)



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:20:44 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Remove more FreeBSD code that we don't need and change some FreeBSD -> NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.2	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Dec  1 17:20:44 2017
@@ -368,48 +368,6 @@ nbsd_enable_proc_events (pid_t pid)
 static void
 nbsd_add_threads (pid_t pid)
 {
-#ifdef PT_GETNUMLWPS
-  struct cleanup *cleanup;
-  lwpid_t *lwps;
-  int i, nlwps;
-
-  gdb_assert (!in_thread_list (pid_to_ptid (pid)));
-  nlwps = ptrace (PT_GETNUMLWPS, pid, NULL, 0);
-  if (nlwps == -1)
-perror_with_name (("ptrace"));
-
-  lwps = XCNEWVEC (lwpid_t, nlwps);
-  cleanup = make_cleanup (xfree, lwps);
-
-  nlwps = ptrace (PT_GETLWPLIST, pid, (caddr_t) lwps, nlwps);
-  if (nlwps == -1)
-perror_with_name (("ptrace"));
-
-  for (i = 0; i < nlwps; i++)
-{
-  ptid_t ptid = ptid_build (pid, lwps[i], 0);
-
-  if (!in_thread_list (ptid))
-	{
-#ifdef PT_LWP_EVENTS
-	  struct ptrace_lwpinfo pl;
-
-	  /* Don't add exited threads.  Note that this is only called
-	 when attaching to a multi-threaded process.  */
-	  if (ptrace (PT_LWPINFO, lwps[i], (caddr_t) , sizeof pl) == -1)
-	perror_with_name (("ptrace"));
-	  if (pl.pl_flags & PL_FLAG_EXITED)
-	continue;
-#endif
-	  if (debug_nbsd_lwp)
-	fprintf_unfiltered (gdb_stdlog,
-"FLWP: adding thread for LWP %u\n",
-lwps[i]);
-	  add_thread (ptid);
-	}
-}
-  do_cleanups (cleanup);
-#else
   int val;
   struct ptrace_lwpinfo pl;
 
@@ -422,7 +380,6 @@ nbsd_add_threads (pid_t pid)
   if (!in_thread_list (ptid))
 	add_thread (ptid);
 }
-#endif
 }
 
 /* Implement the "to_update_thread_list" target_ops method.  */
@@ -594,7 +551,7 @@ nbsd_resume (struct target_ops *ops,
 
   if (debug_nbsd_lwp)
 fprintf_unfiltered (gdb_stdlog,
-			"FLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
+			"NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
 			ptid_get_pid (ptid), ptid_get_lwp (ptid),
 			ptid_get_tid (ptid));
   if (ptid_lwp_p (ptid))
@@ -684,7 +641,7 @@ nbsd_wait (struct target_ops *ops,
 		{
 		  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-	"FLWP: deleting thread for LWP %u\n",
+	"NLWP: deleting thread for LWP %u\n",
 	pl.pl_lwpid);
 		  if (print_thread_events)
 		printf_unfiltered (_("[%s exited]\n"), target_pid_to_str
@@ -707,7 +664,7 @@ nbsd_wait (struct target_ops *ops,
 	{
 	  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-"FLWP: using LWP %u for first thread\n",
+"NLWP: using LWP %u for first thread\n",
 pl.pl_lwpid);
 	  thread_change_ptid (pid_to_ptid (pid), wptid);
 	}
@@ -723,7 +680,7 @@ nbsd_wait (struct target_ops *ops,
 		{
 		  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-	"FLWP: adding thread for LWP %u\n",
+	"NLWP: adding thread for LWP %u\n",
 	pl.pl_lwpid);
 		  add_thread (wptid);
 		}
@@ -1023,8 +980,8 @@ _initialize_nbsd_nat (void)
 #ifdef PT_LWPINFO
   add_setshow_boolean_cmd ("nbsd-lwp", class_maintenance,
 			   _nbsd_lwp, _("\
-Set debugging of FreeBSD lwp module."), _("\
-Show debugging of FreeBSD lwp module."), _("\
+Set debugging of NetBSD lwp module."), _("\
+Show debugging of NetBSD lwp module."), _("\
 Enables printf debugging output."),
 			   NULL,
 			   _nbsd_lwp_debug,



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:19:59 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c

Log Message:
Back to stepping everyone.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.16 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.16	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Fri Dec  1 17:19:59 2017
@@ -353,7 +353,7 @@ inf_ptrace_resume (struct target_ops *op
  all possible successor instructions), so we don't have to
  worry about that here.  */
   request = PT_STEP;
-#ifdef __NetBSD__
+#if 0
   /*
* On NetBSD the data field of PT_STEP contains the thread
* to be stepped; all other threads are continued if this value is > 0



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:15:17 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: x86-bsd-nat.c

Log Message:
get the debugging registers for the specific thread.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.2	Tue Nov 28 17:04:53 2017
+++ src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c	Fri Dec  1 17:15:17 2017
@@ -82,7 +82,7 @@ x86bsd_dr_set (int regnum, unsigned long
   struct dbreg dbregs;
 
   if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
-  (PTRACE_TYPE_ARG3) , 0) == -1)
+  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't get debug registers"));
 
   /* For some mysterious reason, some of the reserved bits in the
@@ -96,7 +96,7 @@ x86bsd_dr_set (int regnum, unsigned long
 if (thread->inf == current_inferior ())
   {
 	if (ptrace (PT_SETDBREGS, get_ptrace_pid (thread->ptid),
-		(PTRACE_TYPE_ARG3) , 0) == -1)
+		(PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	  perror_with_name (_("Couldn't write debug registers"));
   }
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 30 00:13:29 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-bsd-nat.c i386-bsd-nat.c
m68k-bsd-nat.c m88k-bsd-nat.c vax-bsd-nat.c

Log Message:
Fix 'last argument of ptrace is the thread id' on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.1.1.1	Tue Nov 28 13:18:06 2017
+++ src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c	Wed Nov 29 19:13:29 2017
@@ -49,7 +49,7 @@ amd64bsd_fetch_inferior_registers (struc
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   amd64_supply_native_gregset (regcache, , -1);
@@ -66,7 +66,7 @@ amd64bsd_fetch_inferior_registers (struc
   if (x86bsd_xsave_len != 0)
 	{
 	  xstateregs = alloca (x86bsd_xsave_len);
-	  if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0)
+	  if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs,  ptid_get_lwp (inferior_ptid))
 	  == -1)
 	perror_with_name (_("Couldn't get extended state status"));
 
@@ -75,7 +75,7 @@ amd64bsd_fetch_inferior_registers (struc
 	}
 #endif
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   amd64_supply_fxsave (regcache, -1, );
@@ -96,12 +96,12 @@ amd64bsd_store_inferior_registers (struc
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't get registers"));
 
   amd64_collect_native_gregset (regcache, , regnum);
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't write registers"));
 
   if (regnum != -1)
@@ -117,11 +117,11 @@ amd64bsd_store_inferior_registers (struc
   if (x86bsd_xsave_len != 0)
 	{
 	  xstateregs = alloca (x86bsd_xsave_len);
-	  if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0)
+	  if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs,  ptid_get_lwp (inferior_ptid))
 	  == -1)
 	perror_with_name (_("Couldn't get extended state status"));
 
-	  amd64_collect_xsave (regcache, regnum, xstateregs, 0);
+	  amd64_collect_xsave (regcache, regnum, xstateregs,  ptid_get_lwp (inferior_ptid));
 
 	  if (ptrace (PT_SETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs,
 		  x86bsd_xsave_len) == -1)
@@ -130,12 +130,12 @@ amd64bsd_store_inferior_registers (struc
 	}
 #endif
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   amd64_collect_fxsave (regcache, regnum, );
 
-  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }
Index: src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.1.1.1	Tue Nov 28 13:18:07 2017
+++ src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c	Wed Nov 29 19:13:29 2017
@@ -137,7 +137,7 @@ i386bsd_fetch_inferior_registers (struct
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ,  ptid_get_lwp (inferior_ptid)) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   i386bsd_supply_gregset (regcache, );
@@ -159,7 +159,7 @@ i386bsd_fetch_inferior_registers (struct
 
 	  xstateregs = alloca (x86bsd_xsave_len);
 	  if (ptrace (PT_GETXSTATE, pid,
-		  (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
+		  (PTRACE_TYPE_ARG3) xstateregs,  

CVS commit: src/external/gpl3/gdb/dist/gdb

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 22:40:18 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
missed one rename


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.15 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.16
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.15	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Wed Nov 29 17:40:18 2017
@@ -116,7 +116,7 @@ arm*-*-linux*)
 	;;
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
 	# Target: NetBSD/arm
-	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armbsd-tdep.o \
+	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o arm-bsd-tdep.o \
 			arm-nbsd-tdep.o nbsd-tdep.o solib-svr4.o"
 	;;
 arm*-*-openbsd*)



CVS commit: src/external/gpl3/gdb/dist/bfd

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 22:39:26 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf32-arm.c

Log Message:
we need popcount again


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/bfd/elf32-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/elf32-arm.c
diff -u src/external/gpl3/gdb/dist/bfd/elf32-arm.c:1.3 src/external/gpl3/gdb/dist/bfd/elf32-arm.c:1.4
--- src/external/gpl3/gdb/dist/bfd/elf32-arm.c:1.3	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/bfd/elf32-arm.c	Wed Nov 29 17:39:26 2017
@@ -3240,7 +3240,6 @@ ctz (unsigned int mask)
 #endif
 }
 
-#ifndef __NetBSD__
 static inline int
 elf32_arm_popcount (unsigned int mask)
 {
@@ -3259,7 +3258,6 @@ elf32_arm_popcount (unsigned int mask)
   return sum;
 #endif
 }
-#endif
 
 /* Create an entry in an ARM ELF linker hash table.  */
 



CVS commit: src/external/gpl3/gdb/dist/gdb/config/i386

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 21:42:46 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh

Log Message:
more files


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.6 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.7
--- src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.6	Wed Nov 29 16:35:16 2017
+++ src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh	Wed Nov 29 16:42:45 2017
@@ -1,6 +1,6 @@
 # Host: NetBSD/amd64
 NATDEPFILES= fork-child.o inf-ptrace.o \
 	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o \
-	bsd-kvm.o nbsd-thread.o x86-nat.o
+	bsd-kvm.o nbsd-thread.o x86-nat.o x86-dregs.o
 
 LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 21:35:26 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: vax-bsd-nat.c

Log Message:
avoid re-definition


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.2	Wed Nov 29 13:15:29 2017
+++ src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c	Wed Nov 29 16:35:26 2017
@@ -17,7 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
+#ifndef _KERNTYPES
 #define _KERNTYPES
+#endif
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"



CVS commit: src/external/gpl3/gdb/dist/gdb/config/i386

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 21:35:16 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh

Log Message:
need more files


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.5 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.6
--- src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.5	Tue Nov 28 22:35:16 2017
+++ src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh	Wed Nov 29 16:35:16 2017
@@ -1,6 +1,6 @@
 # Host: NetBSD/amd64
 NATDEPFILES= fork-child.o inf-ptrace.o \
 	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o \
-	bsd-kvm.o nbsd-thread.o
+	bsd-kvm.o nbsd-thread.o x86-nat.o
 
 LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 03:35:16 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-nbsd-tdep.c amd64-nbsd-nat.c
amd64-nbsd-tdep.c arm-nbsd-nat.c arm-nbsd-tdep.c hppa-nbsd-nat.c
hppa-nbsd-tdep.c i386-nbsd-nat.c i386-nbsd-tdep.c mips-nbsd-nat.c
mips-nbsd-tdep.c mips-nbsd-tdep.h ppc-nbsd-nat.c ppc-nbsd-tdep.c
ppc-nbsd-tdep.h sh-nbsd-nat.c sh-nbsd-tdep.c sparc-nbsd-nat.c
sparc-nbsd-tdep.c sparc64-nbsd-nat.c sparc64-nbsd-tdep.c
vax-nbsd-tdep.c
src/external/gpl3/gdb/dist/gdb/config/alpha: nbsd.mh
src/external/gpl3/gdb/dist/gdb/config/arm: nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/m68k: nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/mips: nbsd.mh
src/external/gpl3/gdb/dist/gdb/config/pa: nbsd.mh
src/external/gpl3/gdb/dist/gdb/config/powerpc: nbsd.mh ppc64-nbsd.mh
src/external/gpl3/gdb/dist/gdb/config/sh: nbsd.mh
src/external/gpl3/gdb/dist/gdb/config/sparc: nbsd64.mh nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/vax: nbsdelf.mh

Log Message:
bring back all our foonbsd-{nat,tdep} files as foo-nbsd-{nat,tdep}. Account
for that in the config glue.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/hppa-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/i386-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-tdep.h \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.h \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/vax-nbsd-tdep.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/dist/gdb/config/m68k/nbsdelf.mh
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/config/mips/nbsd.mh
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mh
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/dist/gdb/config/powerpc/nbsd.mh
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/dist/gdb/config/powerpc/ppc64-nbsd.mh
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/config/sh/nbsd.mh
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/dist/gdb/config/sparc/nbsd64.mh \
src/external/gpl3/gdb/dist/gdb/config/sparc/nbsdelf.mh
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.1.1.1	Tue Nov 28 13:18:04 2017
+++ src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c	Tue Nov 28 22:35:15 2017
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/alpha.
 
-   Copyright (C) 2002-2017 Free Software Foundation, Inc.
+   Copyright (C) 2002-2016 Free Software Foundation, Inc.
 
Contributed by Wasabi Systems, Inc.
 
@@ -28,13 +28,19 @@
 #include "value.h"
 
 #include "alpha-tdep.h"
-#include "alpha-bsd-tdep.h"
+#include "alphabsd-tdep.h"
 #include "nbsd-tdep.h"
 #include "solib-svr4.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
+#include "tramp-frame.h"
 #include "target.h"
 
 /* Core file support.  */
 
+/* Even though NetBSD/alpha used ELF since day one, it used the
+   traditional a.out-style core dump format before NetBSD 1.6.  */
+
 /* Sizeof `struct reg' in .  */
 #define ALPHANBSD_SIZEOF_GREGS	(32 * 8)
 
@@ -168,31 +174,95 @@ alphanbsd_iterate_over_regset_sections (
 
 /* Signal trampolines.  */
 
+static void
+alphanbsd_sigtramp_cache_init (const struct tramp_frame *,
+			  

CVS commit: src/external/gpl3/gdb/dist/intl

2017-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 03:34:22 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/intl: Makefile.in

Log Message:
Avoid building plural.c from plural.y. Since we now build with gnumake,
emptying the pattern rules is not enough.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/intl/Makefile.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/intl/Makefile.in
diff -u src/external/gpl3/gdb/dist/intl/Makefile.in:1.2 src/external/gpl3/gdb/dist/intl/Makefile.in:1.3
--- src/external/gpl3/gdb/dist/intl/Makefile.in:1.2	Sun Sep 25 16:23:51 2011
+++ src/external/gpl3/gdb/dist/intl/Makefile.in	Tue Nov 28 22:34:22 2017
@@ -133,6 +133,8 @@ libintl.h: $(srcdir)/libgnuintl.h
 	$(COMPILE) $<
 
 .y.c:
+	@echo "Not rebuilding yacc output"
+	cp -p $(srcdir)/$@ $@
 #	$(YACC) $(YFLAGS) --output $@ $<
 #	rm -f $*.h
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-06-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 15 23:46:30 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
Don't include  on NetBSD in GDB

This header in this context is freebsdism.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.9 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.10
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.9	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Thu Jun 15 23:46:30 2017
@@ -37,7 +37,9 @@
 #include "readline/readline.h"
 #include 
 #include 
+#if defined(__FreeBSD__)
 #include 
+#endif
 
 #include "bsd-kvm.h"
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-12-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Dec 15 10:01:16 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-tdep.c

Log Message:
Skip the initial GP load in function prologue when inserting a breakpoint.

GNU ld for alpha is so clever that the redundant GP load in function
entrypoint is skipped. we must therefore skip initial GP loads; otherwise
breakpoints in function entrypoints can also be skipped.

Reported to upstream (Bug 20969):
  https://sourceware.org/bugzilla/show_bug.cgi?id=20969

ok martin


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/gpl3/gdb/dist/gdb/alpha-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.1.1.5 src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/alpha-tdep.c:1.1.1.5	Wed Oct 12 16:47:13 2016
+++ src/external/gpl3/gdb/dist/gdb/alpha-tdep.c	Thu Dec 15 10:01:16 2016
@@ -757,6 +757,31 @@ alpha_skip_prologue (struct gdbarch *gdb
   return pc + offset;
 }
 
+/* GNU ld for alpha is so clever that the redundant GP load in function
+   entrypoint is skipped.  We must therefore skip initial GP loads; otherwise
+   breakpoints in function entrypoints can also be skipped.  */
+
+static CORE_ADDR
+alpha_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  unsigned long inst;
+  gdb_byte buf[ALPHA_INSN_SIZE];
+
+  /* Refer to the comment in alpha_skip_prologue above.  */
+  if (target_read_memory (pc, buf, sizeof (buf)))
+return pc;
+
+  /* Skip a GP load in the first two words in the function entrypoint.  */
+  inst = alpha_read_insn (gdbarch, pc);
+  if ((inst & 0x) != 0x27bb)	/* ldah $gp,n($t12) */
+return pc;
+  inst = alpha_read_insn (gdbarch, pc + ALPHA_INSN_SIZE);
+  if ((inst & 0x) != 0x23bd)	/* lda $gp,n($gp) */
+return pc;
+
+  return pc + 2 * ALPHA_INSN_SIZE;
+}
+
 
 static const int ldl_l_opcode = 0x2a;
 static const int ldq_l_opcode = 0x2b;
@@ -1802,6 +1827,9 @@ alpha_gdbarch_init (struct gdbarch_info 
   /* Prologue heuristics.  */
   set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue);
 
+  /* Entrypoint heuristics.  */
+  set_gdbarch_skip_entrypoint (gdbarch, alpha_skip_entrypoint);
+
   /* Disassembler.  */
   set_gdbarch_print_insn (gdbarch, print_insn_alpha);
 



CVS commit: src/external/gpl3/gdb/dist/bfd

2016-11-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 19 07:54:19 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: configure

Log Message:
Mark the alpha options use_secureplt as false... we don't do secure plt
on alpha (yet)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/bfd/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/configure
diff -u src/external/gpl3/gdb/dist/bfd/configure:1.8 src/external/gpl3/gdb/dist/bfd/configure:1.9
--- src/external/gpl3/gdb/dist/bfd/configure:1.8	Sat Nov 19 07:52:49 2016
+++ src/external/gpl3/gdb/dist/bfd/configure	Sat Nov 19 07:54:19 2016
@@ -12163,7 +12163,7 @@ if test "${enable_secureplt+set}" = set;
   *)as_fn_error "bad value ${enableval} for secureplt option" "$LINENO" 5 ;;
 esac
 else
-  use_secureplt=true
+  use_secureplt=false
 fi
 if test $use_secureplt = true; then
 



CVS commit: src/external/gpl3/gdb/dist/bfd

2016-11-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 19 07:52:49 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: configure

Log Message:
Add in netbsd-core.lo for all arm/mips


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/bfd/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/configure
diff -u src/external/gpl3/gdb/dist/bfd/configure:1.7 src/external/gpl3/gdb/dist/bfd/configure:1.8
--- src/external/gpl3/gdb/dist/bfd/configure:1.7	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/bfd/configure	Sat Nov 19 07:52:49 2016
@@ -14706,7 +14706,7 @@ if test "${target}" = "${host}"; then
 	;;
   arm-*-freebsd* | arm-*-kfreebsd*-gnu)
 	COREFILE='' ;;
-  arm-*-netbsd* | arm-*-openbsd*)
+  arm*-*-netbsd* | arm-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
   arm-*-riscix)		COREFILE=trad-core.lo ;;
@@ -14776,7 +14776,7 @@ if test "${target}" = "${host}"; then
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i860mach3.h"'
 	;;
-  mips-*-netbsd* | mips*-*-openbsd*)
+  mips*-*-netbsd* | mips*-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
   mips-dec-*)



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-11-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 18 09:52:33 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: alphanbsd-tdep.c armnbsd-tdep.c
configure.tgt nbsd-tdep.c nbsd-tdep.h

Log Message:
Provide a generic nbsd_skip_solib_resolver and use it in alpha and arm.
Others should follow suit.

I even tested it.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.12 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.13
--- src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.12	Sat Oct 29 17:02:06 2016
+++ src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -22,7 +22,6 @@
 #include "defs.h"
 #include "frame.h"
 #include "gdbcore.h"
-#include "objfiles.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
@@ -37,19 +36,6 @@
 #include "tramp-frame.h"
 #include "target.h"
 
-/* from obsd-tdep.c with symbol name adjusted to ours */
-static CORE_ADDR
-alphanbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  struct bound_minimal_symbol msym;
-
-  msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
-return frame_unwind_caller_pc (get_current_frame ());
-  else
-return find_solib_trampoline_target (get_current_frame (), pc);
-}
-
 /* Core file support.  */
 
 /* Even though NetBSD/alpha used ELF since day one, it used the
@@ -347,7 +333,7 @@ alphanbsd_init_abi (struct gdbarch_info 
   /* NetBSD/alpha has SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
 (gdbarch, svr4_lp64_fetch_link_map_offsets);
-  set_gdbarch_skip_solib_resolver (gdbarch, alphanbsd_skip_solib_resolver);
+  set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
 
 #ifdef notyet
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;

Index: src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.7 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.7	Sun Oct 23 07:40:08 2016
+++ src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -19,10 +19,10 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "objfiles.h"
 
 #include "arch/arm.h"
 #include "arm-tdep.h"
+#include "nbsd-tdep.h"
 #include "solib-svr4.h"
 
 /* Description of the longjmp buffer.  */
@@ -36,19 +36,6 @@ static const gdb_byte arm_nbsd_arm_be_br
 static const gdb_byte arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde};
 static const gdb_byte arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe};
 
-/* from obsd-tdep.c with symbol name adjusted to ours */
-static CORE_ADDR
-armnbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  struct bound_minimal_symbol msym;
-
-  msym = lookup_minimal_symbol("_rtld_bind", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
-return frame_unwind_caller_pc (get_current_frame ());
-  else
-return find_solib_trampoline_target (get_current_frame (), pc);
-}
-
 static void
 arm_netbsd_init_abi_common (struct gdbarch_info info,
 			struct gdbarch *gdbarch)
@@ -114,7 +101,7 @@ arm_netbsd_elf_init_abi (struct gdbarch_
 (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
   /* for single stepping; see PR/50773 */
-  set_gdbarch_skip_solib_resolver (gdbarch, armnbsd_skip_solib_resolver);
+  set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
 }
 
 static enum gdb_osabi

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.13 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.14
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.13	Sun Oct 23 07:33:15 2016
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Fri Nov 18 09:52:33 2016
@@ -109,7 +109,7 @@ arm*-*-linux*)
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
 	# Target: NetBSD/arm
 	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armbsd-tdep.o \
-			armnbsd-tdep.o solib-svr4.o"
+			armnbsd-tdep.o nbsd-tdep.o solib-svr4.o"
 	;;
 arm*-*-openbsd*)
 	# Target: OpenBSD/arm

Index: src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.1.1.6 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.1.1.6	Wed Oct 12 16:47:14 2016
+++ src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -3,9 +3,9 @@

CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 29 17:02:07 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: alphanbsd-tdep.c

Log Message:
Add a skip_solib_resolver, from Rin Okuyama, fixes single stepping for
shared binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.11 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.12
--- src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.11	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c	Sat Oct 29 17:02:06 2016
@@ -22,6 +22,7 @@
 #include "defs.h"
 #include "frame.h"
 #include "gdbcore.h"
+#include "objfiles.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
@@ -36,6 +37,19 @@
 #include "tramp-frame.h"
 #include "target.h"
 
+/* from obsd-tdep.c with symbol name adjusted to ours */
+static CORE_ADDR
+alphanbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  struct bound_minimal_symbol msym;
+
+  msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
+  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+return frame_unwind_caller_pc (get_current_frame ());
+  else
+return find_solib_trampoline_target (get_current_frame (), pc);
+}
+
 /* Core file support.  */
 
 /* Even though NetBSD/alpha used ELF since day one, it used the
@@ -333,6 +347,7 @@ alphanbsd_init_abi (struct gdbarch_info 
   /* NetBSD/alpha has SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
 (gdbarch, svr4_lp64_fetch_link_map_offsets);
+  set_gdbarch_skip_solib_resolver (gdbarch, alphanbsd_skip_solib_resolver);
 
 #ifdef notyet
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 27 14:30:55 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c

Log Message:
it might not be a breakpoint, so make the message what it actually is.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.14 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.15
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.14	Mon Oct 24 17:22:33 2016
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Thu Oct 27 10:30:55 2016
@@ -500,9 +500,10 @@ inf_ptrace_xfer_partial (struct target_o
 	   to indicate failure.  */
 	if (errno == EACCES)
 	  {
-	fprintf_unfiltered (gdb_stderr, "Cannot set breakpoint at %p (%s). "
+	fprintf_unfiltered (gdb_stderr, "Cannot %s process at %p (%s). "
 "Is PaX MPROTECT active? See security(7), "
-"sysctl(7), paxctl(8)\n", piod.piod_offs,
+"sysctl(7), paxctl(8)\n", writebuf ? "write to" :
+"read from", piod.piod_offs,
 strerror(errno));
 	return TARGET_XFER_E_IO;	/* Some other error perhaps? */
 	  }



CVS commit: src/external/gpl3/gdb/dist/gdb/config/pa

2016-10-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 27 11:48:24 UTC 2016

Removed Files:
src/external/gpl3/gdb/dist/gdb/config/pa: nbsd.mt

Log Message:
.mt files are dead


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 24 21:22:33 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c

Log Message:
Don't fail silently if we can't set a breakpoint


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.13 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.14
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.13	Wed Oct 12 16:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Mon Oct 24 17:22:33 2016
@@ -498,6 +498,14 @@ inf_ptrace_xfer_partial (struct target_o
 	/* If the PT_IO request is somehow not supported, fallback on
 	   using PT_WRITE_D/PT_READ_D.  Otherwise we will return zero
 	   to indicate failure.  */
+	if (errno == EACCES)
+	  {
+	fprintf_unfiltered (gdb_stderr, "Cannot set breakpoint at %p (%s). "
+"Is PaX MPROTECT active? See security(7), "
+"sysctl(7), paxctl(8)\n", piod.piod_offs,
+strerror(errno));
+	return TARGET_XFER_E_IO;	/* Some other error perhaps? */
+	  }
 	if (errno != EINVAL)
 	  return TARGET_XFER_EOF;
   }



CVS commit: src/external/gpl3/gdb/dist/bfd

2016-10-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 12:46:57 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: config.bfd

Log Message:
Sync with external/gpl3/binutils/dist/bfd/config.bfd for mips so we build
in the right vector set


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/config.bfd
diff -u src/external/gpl3/gdb/dist/bfd/config.bfd:1.15 src/external/gpl3/gdb/dist/bfd/config.bfd:1.16
--- src/external/gpl3/gdb/dist/bfd/config.bfd:1.15	Sun Oct 23 12:43:01 2016
+++ src/external/gpl3/gdb/dist/bfd/config.bfd	Sun Oct 23 12:46:57 2016
@@ -1105,11 +1105,11 @@ case "${targ}" in
 ;;
   mips*el-*-netbsd*)
 targ_defvec=mips_elf32_trad_le_vec
-targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
 ;;
   mips*-*-netbsd*)
 targ_defvec=mips_elf32_trad_be_vec
-targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_be_vec mips_ecoff_le_vec"
 ;;
   mips64*-*-openbsd*)
 targ_defvec=mips_elf64_trad_be_vec



CVS commit: src/external/gpl3/gdb/dist/bfd

2016-10-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 12:43:02 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: config.bfd

Log Message:
Sync with external/gpl3/binutils/dist/bfd/config.bfd for arm so we build
in the right vector set


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/config.bfd
diff -u src/external/gpl3/gdb/dist/bfd/config.bfd:1.14 src/external/gpl3/gdb/dist/bfd/config.bfd:1.15
--- src/external/gpl3/gdb/dist/bfd/config.bfd:1.14	Fri Oct 14 14:41:32 2016
+++ src/external/gpl3/gdb/dist/bfd/config.bfd	Sun Oct 23 12:43:01 2016
@@ -314,11 +314,11 @@ case "${targ}" in
 targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
 targ_archs="$targ_archs bfd_i386_arch"
 ;;
-  armeb-*-netbsdelf*)
+  arm*eb-*-netbsdelf*)
 targ_defvec=arm_elf32_be_vec
 targ_selvecs="arm_elf32_le_vec arm_aout_nbsd_vec"
 ;;
-  arm-*-netbsdelf*)
+  arm*-*-netbsdelf*)
 targ_defvec=arm_elf32_le_vec
 targ_selvecs="arm_elf32_be_vec arm_aout_nbsd_vec"
 ;;



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 07:40:09 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: armnbsd-tdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.6	Sun Oct 23 07:33:15 2016
+++ src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	Sun Oct 23 07:40:08 2016
@@ -87,9 +87,9 @@ arm_netbsd_init_abi_common (struct gdbar
 (gdbarch, armbsd_iterate_over_regset_sections);
 
 }
-  
+
 static void
-arm_netbsd_aout_init_abi (struct gdbarch_info info, 
+arm_netbsd_aout_init_abi (struct gdbarch_info info,
 			  struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 07:33:15 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: armnbsd-tdep.c configure.tgt

Log Message:
PR toolchain/51557: gdb can't read core files

Register an iterate_over_regset_sections methods for armnbsd


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.5	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	Sun Oct 23 07:33:15 2016
@@ -82,6 +82,10 @@ arm_netbsd_init_abi_common (struct gdbar
 
   /* Single stepping.  */
   set_gdbarch_software_single_step (gdbarch, arm_software_single_step);
+  /* Core support */
+  set_gdbarch_iterate_over_regset_sections
+(gdbarch, armbsd_iterate_over_regset_sections);
+
 }
   
 static void

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.12 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.13
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.12	Fri Oct 14 14:41:32 2016
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Sun Oct 23 07:33:15 2016
@@ -108,8 +108,8 @@ arm*-*-linux*)
 	;;
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
 	# Target: NetBSD/arm
-	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armnbsd-tdep.o \
-			solib-svr4.o"
+	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armbsd-tdep.o \
+			armnbsd-tdep.o solib-svr4.o"
 	;;
 arm*-*-openbsd*)
 	# Target: OpenBSD/arm



CVS commit: src/external/gpl3/gdb/dist/gdb/config/arm

2016-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 22 14:57:50 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/arm: nbsdelf.mh

Log Message:
Add -lkvm for bsd-kvm.o


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.4 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.5
--- src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.4	Sat Oct 22 14:38:07 2016
+++ src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh	Sat Oct 22 14:57:50 2016
@@ -1,3 +1,5 @@
 # Host: NetBSD/arm
 NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o armnbsd-nat.o \
 	bsd-kvm.o nbsd-thread.o
+
+LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb/config

2016-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 22 14:38:07 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb/config/arm: nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/pa: nbsd.mt

Log Message:
No need for corelow.o here now as it is in COMMON_OBS


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
diff -u src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.3 src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.4
--- src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh:1.3	Mon Feb  6 10:46:35 2012
+++ src/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh	Sat Oct 22 14:38:07 2016
@@ -1,3 +1,3 @@
 # Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o corelow.o nbsd-nat.o armnbsd-nat.o \
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o armnbsd-nat.o \
 	bsd-kvm.o nbsd-thread.o

Index: src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt
diff -u src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt:1.1 src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt:1.2
--- src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt:1.1	Sun Sep 25 16:30:26 2011
+++ src/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mt	Sat Oct 22 14:38:07 2016
@@ -1,2 +1,2 @@
 # Target: NetBSD/hppa
-TDEPFILES= hppa-tdep.o hppabsd-tdep.o hppanbsd-tdep.o corelow.o solib.o solib-svr4.o
+TDEPFILES= hppa-tdep.o hppabsd-tdep.o hppanbsd-tdep.o solib.o solib-svr4.o



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 22 11:04:16 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: hppanbsd-tdep.c

Log Message:
Fix HPPANBSD_SIZEOF_GREGS to match sizeof(struct reg)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c:1.6	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/hppanbsd-tdep.c	Sat Oct 22 11:04:16 2016
@@ -141,7 +141,7 @@ hppanbsd_sigtramp_cache_init (const stru
 /* Core file support.  */
 
 /* Sizeof `struct reg' in .  */
-#define HPPANBSD_SIZEOF_GREGS	(46 * 4)
+#define HPPANBSD_SIZEOF_GREGS	(47 * 4)
 
 static int hppanbsd_reg_offset[] =
 {



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Oct 17 17:37:44 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: m68kbsd-nat.c vaxbsd-nat.c

Log Message:
add some missing casts and make these build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c:1.10 src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c:1.11
--- src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c:1.10	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/m68kbsd-nat.c	Mon Oct 17 17:37:44 2016
@@ -57,7 +57,7 @@ m68kbsd_fpregset_supplies_p (int regnum)
 static void
 m68kbsd_supply_gregset (struct regcache *regcache, const void *gregs)
 {
-  const char *regs = gregs;
+  const char *regs = (const char *)gregs;
   int regnum;
 
   for (regnum = M68K_D0_REGNUM; regnum <= M68K_PC_REGNUM; regnum++)
@@ -70,7 +70,7 @@ static void
 m68kbsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  const char *regs = fpregs;
+  const char *regs = (const char *)fpregs;
   int regnum;
 
   for (regnum = M68K_FP0_REGNUM; regnum <= M68K_FPI_REGNUM; regnum++)
@@ -85,7 +85,7 @@ static void
 m68kbsd_collect_gregset (const struct regcache *regcache,
 			 void *gregs, int regnum)
 {
-  char *regs = gregs;
+  char *regs = (char *)gregs;
   int i;
 
   for (i = M68K_D0_REGNUM; i <= M68K_PC_REGNUM; i++)
@@ -103,7 +103,7 @@ m68kbsd_collect_fpregset (const struct r
 			  void *fpregs, int regnum)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  char *regs = fpregs;
+  char *regs = (char *)fpregs;
   int i;
 
   for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++)
@@ -253,7 +253,7 @@ m68kbsd_supply_pcb (struct regcache *reg
   tmp = pcb->pcb_ps & 0x;
   regcache_raw_supply (regcache, M68K_PS_REGNUM, );
 
-  read_memory (pcb->pcb_regs[PCB_REGS_FP] + 4, (char *) , sizeof tmp);
+  read_memory (pcb->pcb_regs[PCB_REGS_FP] + 4, (unsigned char *) , sizeof tmp);
   regcache_raw_supply (regcache, M68K_PC_REGNUM, );
 
   return 1;

Index: src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.11 src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.12
--- src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.11	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c	Mon Oct 17 17:37:44 2016
@@ -47,7 +47,7 @@ typedef struct fpreg fpregset_t;
 static void
 vaxbsd_supply_gregset (struct regcache *regcache, const void *gregs)
 {
-  const gdb_byte *regs = gregs;
+  const gdb_byte *regs = (const gdb_byte *)gregs;
   int regnum;
 
   for (regnum = 0; regnum < VAX_NUM_REGS; regnum++)
@@ -61,7 +61,7 @@ static void
 vaxbsd_collect_gregset (const struct regcache *regcache,
 			void *gregs, int regnum)
 {
-  gdb_byte *regs = gregs;
+  gdb_byte *regs = (gdb_byte *)gregs;
   int i;
 
   for (i = 0; i <= VAX_NUM_REGS; i++)



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Oct 17 06:26:20 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: i386bsd-nat.h

Log Message:
add missing i386bsd_supply_gregset() and i386bsd_collect_gregset() protos


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h
diff -u src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h:1.8 src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h:1.9
--- src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h:1.8	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/i386bsd-nat.h	Mon Oct 17 06:26:20 2016
@@ -25,4 +25,8 @@
 
 extern struct target_ops *i386bsd_target (void);
 
+extern void i386bsd_supply_gregset (struct regcache *, const void *);
+
+extern void i386bsd_collect_gregset (const struct regcache *, void *, int);
+
 #endif /* i386bsd-nat.h */



CVS commit: src/external/gpl3/gdb/dist/gdb

2016-10-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 14 23:49:23 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/gdb: event-loop.h

Log Message:
multiple include protection


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/gpl3/gdb/dist/gdb/event-loop.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/event-loop.h
diff -u src/external/gpl3/gdb/dist/gdb/event-loop.h:1.1.1.6 src/external/gpl3/gdb/dist/gdb/event-loop.h:1.2
--- src/external/gpl3/gdb/dist/gdb/event-loop.h:1.1.1.6	Wed Oct 12 12:47:12 2016
+++ src/external/gpl3/gdb/dist/gdb/event-loop.h	Fri Oct 14 19:49:23 2016
@@ -66,7 +66,8 @@
infinite loop.
 
Corollary tasks are the creation and deletion of event sources.  */
-
+#ifndef _EVENT_LOOP_H_
+#define _EVENT_LOOP_H_
 typedef void *gdb_client_data;
 struct async_signal_handler;
 struct async_event_handler;
@@ -127,3 +128,4 @@ extern void mark_async_event_handler (st
 extern void clear_async_event_handler (struct async_event_handler *handler);
 
 extern void initialize_async_signal_handlers (void);
+#endif



CVS commit: src/external/gpl3/gdb/dist

2016-10-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 14 14:41:32 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: config.bfd
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
fix some aarch64 nits


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/bfd/config.bfd
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/config.bfd
diff -u src/external/gpl3/gdb/dist/bfd/config.bfd:1.13 src/external/gpl3/gdb/dist/bfd/config.bfd:1.14
--- src/external/gpl3/gdb/dist/bfd/config.bfd:1.13	Wed Oct 12 16:20:33 2016
+++ src/external/gpl3/gdb/dist/bfd/config.bfd	Fri Oct 14 10:41:32 2016
@@ -209,13 +209,13 @@ case "${targ}" in
 want64=true
 ;;
   aarch64-*-netbsd*)
-targ_defvec=bfd_elf64_littleaarch64_vec
-targ_selvecs="bfd_elf64_bigaarch64_vec bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
+targ_defvec=aarch64_elf64_le_vec
+targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
 want64=true
 ;;
   aarch64_be-*-netbsd*)
-targ_defvec=bfd_elf64_bigaarch64_vec
-targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec"
+targ_defvec=aarch64_elf64_be_vec
+targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
 want64=true
 ;;
   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.11 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.12
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.11	Wed Oct 12 16:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Fri Oct 14 10:41:32 2016
@@ -54,7 +54,7 @@ aarch64*-*-linux*)
 aarch64*-*-netbsd*)
 	# Target: AArch64 NetBSD
 	#gdb_target_obs="aarch64-tdep.o aarch64-netbsd-tdep.o"
-	gdb_target_obs="aarch64-tdep.o"
+	gdb_target_obs="aarch64-tdep.o aarch64-insn.o solib-svr4.o"
 	;;
 
 alpha*-*-osf*)



  1   2   3   >