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

2024-03-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Mar  9 06:51:24 UTC 2024

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

Log Message:
avoid rebuilding texi files in the read-only source tree


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 src/external/gpl3/gdb/dist/gdb/doc/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/gdb/doc/Makefile.in
diff -u src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.1.1.10 src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.2
--- src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.1.1.10	Sun Jul 30 22:45:12 2023
+++ src/external/gpl3/gdb/dist/gdb/doc/Makefile.in	Sat Mar  9 06:51:24 2024
@@ -417,6 +417,8 @@ refcard.pdf : refcard.tex $(REFEDITS)
 
 # File to record current GDB version number.
 GDBvn.texi : version.subst
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_GDBvn.texi:
 	echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
 	if [ -n "$(PKGVERSION)" ]; then \
 	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \



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

2024-03-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Mar  9 06:51:24 UTC 2024

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

Log Message:
avoid rebuilding texi files in the read-only source tree


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

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

2023-10-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 29 13:11:59 UTC 2023

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

Log Message:
Fix cross compiling by using snprintf instead of strlcpy


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.



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

2023-10-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 29 13:11:59 UTC 2023

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

Log Message:
Fix cross compiling by using snprintf instead of strlcpy


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/external/gpl3/gdb/dist/gdb/solib.c:1.13
--- src/external/gpl3/gdb/dist/gdb/solib.c:1.12	Tue Aug 29 20:39:17 2023
+++ src/external/gpl3/gdb/dist/gdb/solib.c	Sun Oct 29 13:11:59 2023
@@ -482,7 +482,7 @@ solib_bfd_open (const char *pathname)
 	  char buf[SO_NAME_MAX_PATH_SIZE], arch[128], *colon;
   struct stat st;
 
-	  strlcpy(arch, b->printable_name, sizeof(arch));
+	  snprintf(arch, sizeof(arch), "%s", b->printable_name);
 	  if ((colon = strchr(arch, ':')) != NULL)
 		*colon = '\0';
 	  snprintf(buf, sizeof(buf), "%.*s/%s/%s",



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

2023-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  8 19:55:51 UTC 2023

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

Log Message:
fix threads debugging (again)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.24
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.23	Mon Jul 31 13:00:49 2023
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Fri Sep  8 15:55:51 2023
@@ -41,6 +41,12 @@ gdb_ptrace (PTRACE_TYPE_ARG1 request, pt
 	PTRACE_TYPE_ARG4 data)
 {
 #ifdef __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
+   */
+  if (request == PT_STEP)
+ data = ptid.lwp ();
   return ptrace (request, ptid.pid (), addr, data);
 #else
   pid_t pid = get_ptrace_pid (ptid);



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

2023-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  8 19:55:51 UTC 2023

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

Log Message:
fix threads debugging (again)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.



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

2023-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 29 20:39:17 UTC 2023

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

Log Message:
When we try to find the compat32 dynamic linker, strip out the arch-specific
string (sparc:v8plus -> sparc).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.11 src/external/gpl3/gdb/dist/gdb/solib.c:1.12
--- src/external/gpl3/gdb/dist/gdb/solib.c:1.11	Mon Jul 31 13:00:50 2023
+++ src/external/gpl3/gdb/dist/gdb/solib.c	Tue Aug 29 16:39:17 2023
@@ -476,18 +476,20 @@ solib_bfd_open (const char *pathname)
   b = gdbarch_bfd_arch_info (target_gdbarch ());
   if (!b->compatible (b, bfd_get_arch_info (abfd.get (
 {
-  char buf[SO_NAME_MAX_PATH_SIZE];
   const char *slash = strrchr(pathname, '/');
   if (slash)
 {
+	  char buf[SO_NAME_MAX_PATH_SIZE], arch[128], *colon;
   struct stat st;
 
-	  snprintf(buf, sizeof(buf), "%.*s/%s/%s", 
-	(int)(slash - pathname), pathname, b->printable_name, slash + 1);
+	  strlcpy(arch, b->printable_name, sizeof(arch));
+	  if ((colon = strchr(arch, ':')) != NULL)
+		*colon = '\0';
+	  snprintf(buf, sizeof(buf), "%.*s/%s/%s",
+	(int)(slash - pathname), pathname, arch, slash + 1);
 	  if (stat(buf, ) == 0)
 	return solib_bfd_open(buf);
-	  snprintf(buf, sizeof(buf), "%s-%s", 
-	pathname, b->printable_name);
+	  snprintf(buf, sizeof(buf), "%s-%s", pathname, arch);
 	  if (stat(buf, ) == 0)
 	return solib_bfd_open(buf);
 	}



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

2023-08-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 29 20:39:17 UTC 2023

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

Log Message:
When we try to find the compat32 dynamic linker, strip out the arch-specific
string (sparc:v8plus -> sparc).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.



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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:16:48 UTC 2023

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

Log Message:
gdb/configure.tgt: Misc clean up. NFC.
- Drop upstream diff for irrelevant part.
- Use netbsd* instead of netbsdelf* for coldfire.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.



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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:16:48 UTC 2023

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

Log Message:
gdb/configure.tgt: Misc clean up. NFC.
- Drop upstream diff for irrelevant part.
- Use netbsd* instead of netbsdelf* for coldfire.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.34
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.33	Fri Aug 18 00:04:00 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Mon Aug 28 03:16:47 2023
@@ -269,7 +269,7 @@ hppa*-*-netbsd*)
 	;;
 hppa*-*-openbsd*)
 	# Target: OpenBSD/hppa
-	gdb_target_obs="hppa-bsd-tdep.o hppa-obsd-tdep.o"
+	gdb_target_obs="hppa-bsd-tdep.o hppa-obsd-tdep.o solib-svr4.o"
 	;;
 
 i[34567]86-*-darwin*)
@@ -395,7 +395,7 @@ m68*-*-linux*)
 	gdb_target_obs="m68k-tdep.o m68k-linux-tdep.o solib-svr4.o \
 			linux-tdep.o glibc-tdep.o symfile-mem.o"
 	;;
-m68*-*-netbsd* | m68*-*-knetbsd*-gnu | m5407-*-netbsdelf*)
+m68*-*-netbsd* | m68*-*-knetbsd*-gnu | m5407-*-netbsd*)
 	# Target: NetBSD/m68k
 	gdb_target_obs="m68k-tdep.o m68k-bsd-tdep.o"
 	;;



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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:15:41 UTC 2023

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

Log Message:
gdb/configure.nat: Slightly reduce diff from upstream. NFC


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

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.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.10 src/external/gpl3/gdb/dist/gdb/configure.nat:1.11
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.10	Thu Aug 17 07:47:07 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Mon Aug 28 03:15:40 2023
@@ -68,8 +68,8 @@ case ${gdb_host} in
 	LOADLIBES='-lkvm'
 	;;
 nbsd*)
-	NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o \
-	nat/netbsd-nat.o bsd-kvm.o'
+	NATDEPFILES='fork-child.o nat/fork-inferior.o nat/netbsd-nat.o \
+	inf-ptrace.o bsd-kvm.o'
 	LOADLIBES='-lkvm'
 	HAVE_NATIVE_GCORE_HOST=1
 	;;
@@ -406,8 +406,7 @@ case ${gdb_host} in
 	i386)
 		# Host: NetBSD/amd64
 		NATDEPFILES="${NATDEPFILES} amd64-nat.o x86-nat.o \
-		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o \
-		amd64-netbsd-nat.o"
+		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-netbsd-nat.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc64



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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:15:41 UTC 2023

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

Log Message:
gdb/configure.nat: Slightly reduce diff from upstream. NFC


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

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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:10:48 UTC 2023

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

Log Message:
gdb/configure.host: Revive m5407 support to NetBSD, lost during merge


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

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.host
diff -u src/external/gpl3/gdb/dist/gdb/configure.host:1.15 src/external/gpl3/gdb/dist/gdb/configure.host:1.16
--- src/external/gpl3/gdb/dist/gdb/configure.host:1.15	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.host	Mon Aug 28 03:10:48 2023
@@ -122,7 +122,7 @@ ia64-*-linux*)		gdb_host=linux ;;
 loongarch*-linux*)	gdb_host=linux ;;
 
 m68*-*-linux*)		gdb_host=linux ;;
-m68*-*-netbsd* | m68*-*-knetbsd*-gnu)
+m68*-*-netbsd* | m68*-*-knetbsd*-gnu | m5407-*-netbsd*)
 			gdb_host=nbsd ;;
 m68*-*-openbsd*)	gdb_host=obsd ;;
 



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

2023-08-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 28 03:10:48 UTC 2023

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

Log Message:
gdb/configure.host: Revive m5407 support to NetBSD, lost during merge


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

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

2023-08-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 23 10:37:46 UTC 2023

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

Log Message:
gdb/mips: Supply zero register as done for other OSes

With this change, gdb/mips 13 becomes working to some extent,
at least for mips{,n}64eb.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/mips-netbsd-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/mips-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c:1.1.1.1	Sun Jul 30 22:44:54 2023
+++ src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.c	Wed Aug 23 10:37:46 2023
@@ -95,6 +95,8 @@ mipsnbsd_supply_gregset (const struct re
   len -= MIPSNBSD_NUM_GREGS * regsize;
   mipsnbsd_supply_fpregset (regset, regcache, regnum, regs, len);
 }
+  if (regnum == -1 || regnum == MIPS_ZERO_REGNUM)
+regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 /* NetBSD/mips register sets.  */
@@ -150,6 +152,8 @@ mipsnbsd_supply_reg (struct regcache *re
 	  (i, regs + (i * mips_isa_regsize (gdbarch)));
 	}
 }
+  if (regno == -1 || regno == MIPS_ZERO_REGNUM)
+regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 void
@@ -277,8 +281,7 @@ mipsnbsd_get_longjmp_target (frame_info_
 static int
 mipsnbsd_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
 {
-  return (regno == MIPS_ZERO_REGNUM
-	  || regno == mips_regnum (gdbarch)->fp_implementation_revision);
+  return regno == mips_regnum (gdbarch)->fp_implementation_revision;
 }
 
 static int



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

2023-08-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 23 10:37:46 UTC 2023

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

Log Message:
gdb/mips: Supply zero register as done for other OSes

With this change, gdb/mips 13 becomes working to some extent,
at least for mips{,n}64eb.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/mips-netbsd-tdep.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

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:22:36 UTC 2023

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

Log Message:
gdb/aarch64: Fix misplaced comment. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.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

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:22:36 UTC 2023

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

Log Message:
gdb/aarch64: Fix misplaced comment. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-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/aarch64-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.2	Thu Aug 17 07:25:52 2023
+++ src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c	Tue Aug 22 06:22:36 2023
@@ -34,8 +34,6 @@
 #include "bsd-kvm.h"
 #include "inf-ptrace.h"
 
-/* Determine if PT_GETREGS fetches REGNUM.  */
-
 struct aarch64_nbsd_nat_target final : public nbsd_nat_target
 {
   void fetch_registers (struct regcache *, int) override;
@@ -44,6 +42,8 @@ struct aarch64_nbsd_nat_target final : p
 
 static aarch64_nbsd_nat_target the_aarch64_nbsd_nat_target;
 
+/* Determine if PT_GETREGS fetches REGNUM.  */
+
 static bool
 getregs_supplies (struct gdbarch *gdbarch, int regnum)
 {



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

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:20:32 UTC 2023

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

Log Message:
gdb/riscv: Specify lwpid for PT_[GS]ETREGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.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

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:20:32 UTC 2023

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

Log Message:
gdb/riscv: Specify lwpid for PT_[GS]ETREGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-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/riscv-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.1 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c	Tue Aug 22 06:20:32 2023
@@ -71,7 +71,7 @@ riscv_nbsd_nat_target::fetch_registers (
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache->supply_regset (_nbsd_gregset, regnum, ,
@@ -104,13 +104,13 @@ riscv_nbsd_nat_target::store_registers (
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache->collect_regset (_nbsd_gregset, regnum, ,
 			   sizeof (regs));
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write registers"));
 }
 
@@ -118,13 +118,13 @@ riscv_nbsd_nat_target::store_registers (
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   regcache->collect_regset (_nbsd_fpregset, regnum, ,
 sizeof (fpregs));
 
-  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }
@@ -139,5 +139,3 @@ _initialize_riscv_nbsd_nat ()
 
 //  bsd_kvm_add_target (riscv_nbsd_supply_pcb);
 }
-
-



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

2023-08-17 Thread Rin Okuyama
> For vax, something still wrong.

This was due to my test environment built by GCC 12. For system built by GCC 10,
GDB 13 works just fine (except for C++ exception handling), as far as I can see.

Thanks,
rin

On Thu, Aug 17, 2023 at 4:45 PM Rin Okuyama  wrote:
>
> Module Name:src
> Committed By:   rin
> Date:   Thu Aug 17 07:45:11 UTC 2023
>
> Modified Files:
> src/external/gpl3/gdb/dist/gdb: configure.tgt
>
> Log Message:
> gdb/vax and ia64: Add missing tdep files for NetBSD
>
> They are also missing for gdb 11.
>
> XXX
> For vax, something still wrong. For ia64, compile test only.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.30 -r1.31 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.
>


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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug 18 01:00:02 UTC 2023

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

Log Message:
gdb/ppc: Resolve static v.s. extern confusion found in upstream. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-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/ppc-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.3	Thu Aug 17 05:53:45 2023
+++ src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c	Fri Aug 18 01:00:02 2023
@@ -34,7 +34,7 @@
 #include "solib-svr4.h"
 
 /* Register offsets from .  */
-ppc_reg_offsets ppcnbsd_reg_offsets;
+static ppc_reg_offsets ppcnbsd_reg_offsets;
 
 
 /* Core file support.  */

Index: src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h:1.1.1.1 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h:1.2
--- src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h:1.1.1.1	Sun Jul 30 22:44:44 2023
+++ src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h	Fri Aug 18 01:00:02 2023
@@ -22,9 +22,6 @@
 
 struct regset;
 
-/* Register offsets for NetBSD/powerpc.  */
-extern struct ppc_reg_offsets ppcnbsd_reg_offsets;
-
 /* Register sets for NetBSD/powerpc.  */
 extern const struct regset ppcnbsd_gregset;
 extern const struct regset ppcnbsd_fpregset;



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug 18 01:00:02 UTC 2023

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

Log Message:
gdb/ppc: Resolve static v.s. extern confusion found in upstream. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.h

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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug 18 00:04:00 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt corelow.c hppa-tdep.h

Log Message:
gdb: Slightly reduce diff from upstream. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/corelow.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/hppa-tdep.h

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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug 18 00:04:00 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt corelow.c hppa-tdep.h

Log Message:
gdb: Slightly reduce diff from upstream. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/corelow.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/hppa-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/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.32 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.33
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.32	Thu Aug 17 07:47:07 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Fri Aug 18 00:04:00 2023
@@ -151,10 +151,6 @@ aarch64*-*-netbsd*)
 			arch/aarch64-insn.o"
 	;;
 
-alpha*-*-osf*)
-	# Target: Little-endian Alpha running OSF/1
-	gdb_target_obs="alpha-tdep.o alpha-osf1-tdep.o alpha-mdebug-tdep.o"
-	;;
 alpha*-*-linux*)
 	# Target: Little-endian Alpha running Linux
 	gdb_target_obs="alpha-mdebug-tdep.o alpha-linux-tdep.o \
@@ -552,7 +548,7 @@ riscv*-*-linux*)
 	;;
 
 riscv*-*-netbsd*) 
-# Target: FreeBSD/riscv
+# Target: NetBSD/riscv
 	gdb_target_obs="riscv-netbsd-tdep.o"
 	;;   
 

Index: src/external/gpl3/gdb/dist/gdb/corelow.c
diff -u src/external/gpl3/gdb/dist/gdb/corelow.c:1.3 src/external/gpl3/gdb/dist/gdb/corelow.c:1.4
--- src/external/gpl3/gdb/dist/gdb/corelow.c:1.3	Mon Jul 31 17:00:49 2023
+++ src/external/gpl3/gdb/dist/gdb/corelow.c	Fri Aug 18 00:04:00 2023
@@ -916,6 +916,7 @@ core_target::xfer_partial (enum target_o
 			 m_core_section_table,
 			 no_contents_cb);
 #endif
+
 	return xfer_status;
   }
 case TARGET_OBJECT_AUXV:

Index: src/external/gpl3/gdb/dist/gdb/hppa-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/hppa-tdep.h:1.11 src/external/gpl3/gdb/dist/gdb/hppa-tdep.h:1.12
--- src/external/gpl3/gdb/dist/gdb/hppa-tdep.h:1.11	Mon Jul 31 17:00:49 2023
+++ src/external/gpl3/gdb/dist/gdb/hppa-tdep.h	Fri Aug 18 00:04:00 2023
@@ -214,6 +214,4 @@ extern int hppa_in_solib_call_trampoline
 	  CORE_ADDR pc);
 extern CORE_ADDR hppa_skip_trampoline_code (frame_info_ptr, CORE_ADDR pc);
 
-void _initialize_hppabsd_tdep (void);
-
 #endif  /* hppa-tdep.h */



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 14:53:39 UTC 2023

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

Log Message:
gdb/m68k: Add missing nbsd_init_abi() call


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gdb/dist/gdb/m68k-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/m68k-bsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/m68k-bsd-tdep.c:1.1.1.4 src/external/gpl3/gdb/dist/gdb/m68k-bsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/m68k-bsd-tdep.c:1.1.1.4	Sun Jul 30 22:44:45 2023
+++ src/external/gpl3/gdb/dist/gdb/m68k-bsd-tdep.c	Thu Aug 17 14:53:38 2023
@@ -28,6 +28,7 @@
 #include "gdbtypes.h"
 
 #include "m68k-tdep.h"
+#include "netbsd-tdep.h"
 #include "solib-svr4.h"
 
 /* Core file support.  */
@@ -135,6 +136,8 @@ m68kbsd_init_abi (struct gdbarch_info in
 {
   m68k_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
+  nbsd_init_abi (info, gdbarch);
+
   tdep->jb_pc = 5;
   tdep->jb_elt_size = 4;
 



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 14:53:39 UTC 2023

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

Log Message:
gdb/m68k: Add missing nbsd_init_abi() call


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gdb/dist/gdb/m68k-bsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 14:52:53 UTC 2023

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

Log Message:
gdb/m68k: Do not fall back to EABI for NetBSD

gdb 13 falls back to newly-introduced m68k EABI, if ELFOSABI_NONE ==
ELFOSABI_SYSV == 0 is indicated in ELF header. This breaks everything
for NetBSD binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/m68k-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/m68k-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/m68k-tdep.c:1.1.1.9 src/external/gpl3/gdb/dist/gdb/m68k-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/m68k-tdep.c:1.1.1.9	Sun Jul 30 22:44:51 2023
+++ src/external/gpl3/gdb/dist/gdb/m68k-tdep.c	Thu Aug 17 14:52:53 2023
@@ -1344,10 +1344,14 @@ m68k_dump_tdep (struct gdbarch *gdbarch,
 static enum gdb_osabi
 m68k_osabi_sniffer (bfd *abfd)
 {
+  /* XXX NetBSD uses ELFOSABI_NONE == ELFOSABI_SYSV. Therefore, do not
+ fall back to EABI here.  */
+#ifndef __NetBSD__
   unsigned int elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
 
   if (elfosabi == ELFOSABI_NONE)
 return GDB_OSABI_SVR4;
+#endif
 
   return GDB_OSABI_UNKNOWN;
 }



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 14:52:53 UTC 2023

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

Log Message:
gdb/m68k: Do not fall back to EABI for NetBSD

gdb 13 falls back to newly-introduced m68k EABI, if ELFOSABI_NONE ==
ELFOSABI_SYSV == 0 is indicated in ELF header. This breaks everything
for NetBSD binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/m68k-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:51:29 UTC 2023

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

Log Message:
gdb/netbsd: Drop unused functions. NFCI.

Note that these two funcs, nbsd_ilp32_solib_svr4_fetch_link_map_offsets,
and nbsd_lp64_solib_svr4_fetch_link_map_offsets, merely fall back to
default ELF functions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/netbsd-tdep.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/netbsd-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/netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/netbsd-tdep.c:1.2 src/external/gpl3/gdb/dist/gdb/netbsd-tdep.c:1.3
--- src/external/gpl3/gdb/dist/gdb/netbsd-tdep.c:1.2	Thu Aug 17 06:54:31 2023
+++ src/external/gpl3/gdb/dist/gdb/netbsd-tdep.c	Thu Aug 17 07:51:29 2023
@@ -46,21 +46,6 @@
 #define	KINFO_VME_FLAG_GROWS_UP		0x0010
 #define	KINFO_VME_FLAG_GROWS_DOWN	0x0020
 
-/* FIXME: kettenis/20060115: We should really eliminate the next two
-   functions completely.  */
-
-struct link_map_offsets *
-nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
-{
-  return svr4_ilp32_fetch_link_map_offsets ();
-}
-
-struct link_map_offsets *
-nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
-{
-  return svr4_lp64_fetch_link_map_offsets ();
-}
-
 int
 nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
 {

Index: src/external/gpl3/gdb/dist/gdb/netbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/netbsd-tdep.h:1.1.1.1 src/external/gpl3/gdb/dist/gdb/netbsd-tdep.h:1.2
--- src/external/gpl3/gdb/dist/gdb/netbsd-tdep.h:1.1.1.1	Sun Jul 30 22:44:47 2023
+++ src/external/gpl3/gdb/dist/gdb/netbsd-tdep.h	Thu Aug 17 07:51:29 2023
@@ -20,9 +20,6 @@
 #ifndef NBSD_TDEP_H
 #define NBSD_TDEP_H
 
-struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
-struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
-
 int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
 
 /* NetBSD specific set of ABI-related routines.  */



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:51:29 UTC 2023

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

Log Message:
gdb/netbsd: Drop unused functions. NFCI.

Note that these two funcs, nbsd_ilp32_solib_svr4_fetch_link_map_offsets,
and nbsd_lp64_solib_svr4_fetch_link_map_offsets, merely fall back to
default ELF functions.


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

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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:47:07 UTC 2023

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

Log Message:
gdb/bfd: Drop duplicate entries for source files, lost during merge

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.31 -r1.32 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.



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:47:07 UTC 2023

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

Log Message:
gdb/bfd: Drop duplicate entries for source files, lost during merge

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.31 -r1.32 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.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.9 src/external/gpl3/gdb/dist/gdb/configure.nat:1.10
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.9	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Thu Aug 17 07:47:07 2023
@@ -362,7 +362,7 @@ case ${gdb_host} in
 		;;
 	i386)
 		# Host: NetBSD/i386 ELF
-		NATDEPFILES="${NATDEPFILES} netbsd-nat.o x86-nat.o \
+		NATDEPFILES="${NATDEPFILES} x86-nat.o \
 		nat/x86-dregs.o \
 		x86-bsd-nat.o i386-bsd-nat.o i386-netbsd-nat.o"
 		;;
@@ -376,7 +376,7 @@ case ${gdb_host} in
 		;;
 	pa)
 		# Host: NetBSD/hppa
-		NATDEPFILES="${NATDEPFILES} netbsd-nat.o hppa-netbsd-nat.o"
+		NATDEPFILES="${NATDEPFILES} hppa-netbsd-nat.o"
 		;;
 	powerpc)
 		# Host: NetBSD/powerpc
@@ -405,8 +405,8 @@ case ${gdb_host} in
 	case ${gdb_host_cpu} in
 	i386)
 		# Host: NetBSD/amd64
-		NATDEPFILES="${NATDEPFILES} netbsd-nat.o amd64-nat.o \
-		x86-nat.o nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o \
+		NATDEPFILES="${NATDEPFILES} amd64-nat.o x86-nat.o \
+		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o \
 		amd64-netbsd-nat.o"
 		;;
 	sparc)

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.31 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.32
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.31	Thu Aug 17 07:45:11 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Thu Aug 17 07:47:07 2023
@@ -269,7 +269,7 @@ hppa*-*-linux*)
 	;;
 hppa*-*-netbsd*)
 	# Target: NetBSD/hppa
-	gdb_target_obs="hppa-bsd-tdep.o hppa-netbsd-tdep.o solib-svr4.o"
+	gdb_target_obs="hppa-bsd-tdep.o hppa-netbsd-tdep.o"
 	;;
 hppa*-*-openbsd*)
 	# Target: OpenBSD/hppa



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:45:11 UTC 2023

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

Log Message:
gdb/vax and ia64: Add missing tdep files for NetBSD

They are also missing for gdb 11.

XXX
For vax, something still wrong. For ia64, compile test only.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.31
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.30	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Thu Aug 17 07:45:11 2023
@@ -349,6 +349,11 @@ ia64-*-*vms*)
 	gdb_target_obs="ia64-vms-tdep.o"
 	;;
 
+ia64-*-netbsd*)
+	# Target: Intel IA-64 running netbsd
+	gdb_target_obs="ia64-netbsd-tdep.o"
+	;;
+
 iq2000-*-*)
 	gdb_target_obs="iq2000-tdep.o"
 	;;
@@ -689,7 +694,7 @@ v850*-*-elf | v850*-*-rtems*)
 
 vax-*-netbsd* | vax-*-knetbsd*-gnu)
 	# Target: NetBSD/vax
-	gdb_target_obs="vax-tdep.o"
+	gdb_target_obs="vax-tdep.o vax-netbsd-tdep.o"
 	;;
 vax-*-openbsd*)
 	# Target: OpenBSD/vax



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:45:11 UTC 2023

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

Log Message:
gdb/vax and ia64: Add missing tdep files for NetBSD

They are also missing for gdb 11.

XXX
For vax, something still wrong. For ia64, compile test only.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:25:52 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-netbsd-nat.c
aarch64-netbsd-tdep.c ia64-netbsd-tdep.c

Log Message:
gdb/aarch64, ia64: Make constructors called correctly.

For gdb 13, _init_foo_bar functions are registered into init.c by
newly-introduced ``make-init-c'' script. It does not recognize
functions declaration with void argument. As a result, these
constructors are not called for aarch64 and ia64.

XXX
mknative later


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/ia64-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c	Thu Aug 17 07:25:52 2023
@@ -174,7 +174,7 @@ aarch64_nbsd_supply_pcb (struct regcache
 }
 
 void
-_initialize_aarch64_nbsd_nat (void)
+_initialize_aarch64_nbsd_nat ()
 {
   add_inf_child_target (_aarch64_nbsd_nat_target);
 
Index: src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c	Thu Aug 17 07:25:52 2023
@@ -196,9 +196,8 @@ 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)
+_initialize_aarch64_nbsd_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_NETBSD,
 			  aarch64_nbsd_init_abi);
Index: src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c:1.1 src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c	Thu Aug 17 07:25:52 2023
@@ -35,11 +35,8 @@ ia64nbsd_elf_init_abi (struct gdbarch_in
 }
 
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_ia64nbsd_tdep (void);
-
 void
-_initialize_ia64nbsd_tdep (void)
+_initialize_ia64nbsd_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_ia64, 0, GDB_OSABI_NETBSD,
 			  ia64nbsd_elf_init_abi);



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:25:52 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-netbsd-nat.c
aarch64-netbsd-tdep.c ia64-netbsd-tdep.c

Log Message:
gdb/aarch64, ia64: Make constructors called correctly.

For gdb 13, _init_foo_bar functions are registered into init.c by
newly-introduced ``make-init-c'' script. It does not recognize
functions declaration with void argument. As a result, these
constructors are not called for aarch64 and ia64.

XXX
mknative later


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:16:42 UTC 2023

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

Log Message:
gdb/sh: Fix register definitions, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/sh-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c:1.1.1.1	Sun Jul 30 22:44:54 2023
+++ src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c	Thu Aug 17 07:16:42 2023
@@ -44,10 +44,10 @@ static sh_nbsd_nat_target the_sh_nbsd_na
   (((regno) >= R0_REGNUM && (regno) <= (R0_REGNUM + 15)) \
 || (regno) == gdbarch_pc_regnum (gdbarch) || (regno) == PR_REGNUM \
 || (regno) == MACH_REGNUM || (regno) == MACL_REGNUM \
-|| (regno) == SR_REGNUM)
+|| (regno) == SR_REGNUM || (regno) == GBR_REGNUM)
 
 /* Sizeof `struct reg' in .  */
-#define SHNBSD_SIZEOF_GREGS	(21 * 4)
+#define SHNBSD_SIZEOF_GREGS	(22 * 4)
 
 void
 sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)

Index: src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.3 src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.4
--- src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.3	Thu Aug 17 07:09:09 2023
+++ src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c	Thu Aug 17 07:16:42 2023
@@ -58,9 +58,42 @@ static const struct sh_corefile_regmap r
   {PR_REGNUM,	2 * 4},
   {MACH_REGNUM,	3 * 4},
   {MACL_REGNUM,	4 * 4},
+  {GBR_REGNUM,	   21 * 4},
   {-1 /* Terminator.  */, 0}
 };
 
+
+
+#define REGSx16(base) \
+  {(base),  0}, \
+  {(base) +  1, 4}, \
+  {(base) +  2, 8}, \
+  {(base) +  3, 12}, \
+  {(base) +  4, 16}, \
+  {(base) +  5, 20}, \
+  {(base) +  6, 24}, \
+  {(base) +  7, 28}, \
+  {(base) +  8, 32}, \
+  {(base) +  9, 36}, \
+  {(base) + 10, 40}, \
+  {(base) + 11, 44}, \
+  {(base) + 12, 48}, \
+  {(base) + 13, 52}, \
+  {(base) + 14, 56}, \
+  {(base) + 15, 60}
+
+/* Convert an FPU register number into an offset into a ptrace
+   register structure.  */
+static const struct sh_corefile_regmap fpregmap[] =
+{
+  REGSx16 (FR0_REGNUM),
+  /* XXX: REGSx16(XF0_REGNUM) omitted.  */
+  {FPSCR_REGNUM, 128},
+  {FPUL_REGNUM,  132},
+  {-1 /* Terminator.  */, 0}
+};
+
+
 /* From .  */
 static const int shnbsd_mc_reg_offset[] =
 {
@@ -91,7 +124,7 @@ static const int shnbsd_mc_reg_offset[] 
 
 /* SH register sets.  */
 
- 
+
 static void
 shnbsd_sigtramp_cache_init (const struct tramp_frame *,
 			 frame_info_ptr,
@@ -165,7 +198,10 @@ shnbsd_init_abi (struct gdbarch_info inf
   nbsd_init_abi (info, gdbarch);
 
   tdep->core_gregmap = (struct sh_corefile_regmap *)regmap;
-  tdep->sizeof_gregset = 84;
+  tdep->sizeof_gregset = 88;
+
+  tdep->core_fpregmap = (struct sh_corefile_regmap *)fpregmap;
+  tdep->sizeof_fpregset = 0;	/* XXX */
 
   set_solib_svr4_fetch_link_map_offsets
 (gdbarch, svr4_ilp32_fetch_link_map_offsets);



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:16:42 UTC 2023

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

Log Message:
gdb/sh: Fix register definitions, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/sh-netbsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:09:09 UTC 2023

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

Log Message:
gdb/sh: Stop installing OpenBSD OSABI, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/sh-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.2 src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.3
--- src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c:1.2	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c	Thu Aug 17 07:09:09 2023
@@ -178,6 +178,4 @@ _initialize_shnbsd_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD,
 			  shnbsd_init_abi);
-  gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_OPENBSD,
-			  shnbsd_init_abi);
 }



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 07:09:09 UTC 2023

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

Log Message:
gdb/sh: Stop installing OpenBSD OSABI, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:36:43 UTC 2023

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

Log Message:
gdb/sparc: Sprinkle static to local function, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/sparc-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/sparc-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/sparc-netbsd-tdep.c:1.1.1.1	Sun Jul 30 22:44:50 2023
+++ src/external/gpl3/gdb/dist/gdb/sparc-netbsd-tdep.c	Thu Aug 17 06:36:43 2023
@@ -292,7 +292,7 @@ static const struct regset sparc32nbsd_f
 NULL, sparc32nbsd_supply_fpregset, NULL
   };
 
-void
+static void
 sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   sparc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:36:43 UTC 2023

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

Log Message:
gdb/sparc: Sprinkle static to local function, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/sparc-netbsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:06:09 UTC 2023

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

Log Message:
gdb/hppa: Fix register defs, lost during merge

XXX compile test only


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/hppa-netbsd-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/hppa-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/hppa-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/hppa-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/hppa-netbsd-tdep.c:1.1.1.1	Sun Jul 30 22:44:43 2023
+++ src/external/gpl3/gdb/dist/gdb/hppa-netbsd-tdep.c	Thu Aug 17 06:06:09 2023
@@ -59,6 +59,19 @@ static int hppanbsd_mc_reg_offset[] =
   38 * 4,	/* sr1 */
   39 * 4,	/* sr2 */
   40 * 4,	/* sr3 */
+  -1,		/* 48 */
+  -1,		/* 49 */
+  -1,		/* 50 */
+  -1,		/* 51 */
+  -1,		/* 52 */
+  -1,		/* 53 */
+  -1,		/* 54 */
+  -1,		/* 55 */
+  -1,		/* 56 */
+  -1,		/* 57 CR24 */
+  -1,		/* 58 CR25 */
+  -1,		/* 59 CR26 */
+  43 * 4,	/* HPPA_CR27_REGNUM */
 
   /* more tbd */
 };
@@ -130,7 +143,7 @@ hppanbsd_sigtramp_cache_init (const stru
 /* Core file support.  */
 
 /* Sizeof `struct reg' in .  */
-#define HPPANBSD_SIZEOF_GREGS	(44 * 4)
+#define HPPANBSD_SIZEOF_GREGS	(47 * 4)
 
 static int hppanbsd_reg_offset[] =
 {
@@ -154,6 +167,25 @@ static int hppanbsd_reg_offset[] =
   -1,		/* HPPA_ISR_REGNUM */
   -1,		/* HPPA_IOR_REGNUM */
   0 * 4,	/* HPPA_IPSW_REGNUM */
+  -1,		/* spare? */
+  41 * 4,	/* HPPA_SR4_REGNUM */
+  37 * 4,	/* sr0 */
+  38 * 4,	/* sr1 */
+  39 * 4,	/* sr2 */
+  40 * 4,	/* sr3 */
+  -1,		/* 48 */
+  -1,		/* 49 */
+  -1,		/* 50 */
+  -1,		/* 51 */
+  -1,		/* 52 */
+  -1,		/* 53 */
+  -1,		/* 54 */
+  -1,		/* 55 */
+  -1,		/* 56 */
+  -1,		/* 57 */
+  -1,		/* 58 */
+  -1,		/* 59 */
+  46 * 4,	/* HPPA_CR27_REGNUM */
 };
 
 /* Supply register REGNUM from the buffer specified by GREGS and LEN



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:06:09 UTC 2023

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

Log Message:
gdb/hppa: Fix register defs, lost during merge

XXX compile test only


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/hppa-netbsd-tdep.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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:04:09 UTC 2023

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

Log Message:
gdb/hppa: Reimport non-critical local changes lost during merge
- remove unused variables
- splinkle const


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/hppa-netbsd-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/hppa-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/hppa-netbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/hppa-netbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/hppa-netbsd-nat.c:1.2	Fri Aug 11 16:12:58 2023
+++ src/external/gpl3/gdb/dist/gdb/hppa-netbsd-nat.c	Thu Aug 17 06:04:09 2023
@@ -59,7 +59,6 @@ static void
 hppanbsd_supply_gregset (struct regcache *regcache, const void *gregs)
 {
   const char *regs = (const char *)gregs;
-  const int *r = (const int *)gregs;
   int regnum;
 
   for (regnum = HPPA_R1_REGNUM; regnum <= HPPA_R31_REGNUM; regnum++)
@@ -102,7 +101,6 @@ hppanbsd_collect_gregset (const struct r
 			  void *gregs, int regnum)
 {
   char *regs = (char *)gregs;
-  int *r = (int *)gregs;
   int i;
 
   for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++)
@@ -146,7 +144,7 @@ hppanbsd_collect_gregset (const struct r
in FPREGS.  */
 
 static void
-hppanbsd_collect_fpregset (struct regcache *regcache,
+hppanbsd_collect_fpregset (const struct regcache *regcache,
 			  void *fpregs, int regnum)
 {
   char *regs = (char *)fpregs;



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

2023-08-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 06:04:09 UTC 2023

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

Log Message:
gdb/hppa: Reimport non-critical local changes lost during merge
- remove unused variables
- splinkle const


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/hppa-netbsd-nat.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:55:48 UTC 2023

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

Log Message:
gdb/riscv: Our OSABI is NetBSD, not FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-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/riscv-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.c:1.1 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.c	Thu Aug 17 05:55:48 2023
@@ -226,6 +226,6 @@ void _initialize_riscv_nbsd_tdep ();
 void
 _initialize_riscv_nbsd_tdep ()
 {
-  gdbarch_register_osabi (bfd_arch_riscv, 0, GDB_OSABI_FREEBSD,
+  gdbarch_register_osabi (bfd_arch_riscv, 0, GDB_OSABI_NETBSD,
 			  riscv_nbsd_init_abi);
 }



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:55:48 UTC 2023

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

Log Message:
gdb/riscv: Our OSABI is NetBSD, not FreeBSD


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

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



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

2023-08-16 Thread Rin Okuyama
> gcc/ppc: Register NetBSD OSABI for rs6000, lost during merge

oops, apparently "gdb/ppc", not "gcc".

Thanks,
rin

On Thu, Aug 17, 2023 at 2:53 PM Rin Okuyama  wrote:
>
> Module Name:src
> Committed By:   rin
> Date:   Thu Aug 17 05:53:45 UTC 2023
>
> Modified Files:
> src/external/gpl3/gdb/dist/gdb: ppc-netbsd-tdep.c
>
> Log Message:
> gcc/ppc: Register NetBSD OSABI for rs6000, lost during merge
>
> Otherwise, OSABI is undetermined until executable is loaded.
>
> Add comments also.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:53:45 UTC 2023

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

Log Message:
gcc/ppc: Register NetBSD OSABI for rs6000, lost during merge

Otherwise, OSABI is undetermined until executable is loaded.

Add comments also.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.2 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.3
--- src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c:1.2	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c	Thu Aug 17 05:53:45 2023
@@ -203,6 +203,11 @@ _initialize_ppcnbsd_tdep ()
   gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD,
 			  ppcnbsd_init_abi);
 
+  /* Register NetBSD OSABI also for rs6000, which is default target
+ used before any executable image is loaded.  */
+  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_NETBSD,
+			  ppcnbsd_init_abi);
+
   /* Avoid initializing the register offsets again if they were
  already initialized by ppc-netbsd-nat.c.  */
   if (ppcnbsd_reg_offsets.pc_offset == 0)



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:53:45 UTC 2023

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

Log Message:
gcc/ppc: Register NetBSD OSABI for rs6000, lost during merge

Otherwise, OSABI is undetermined until executable is loaded.

Add comments also.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:50:00 UTC 2023

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

Log Message:
gdb: Adjust location of comment for clarity, no binary changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/netbsd-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/netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/netbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/netbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/netbsd-nat.c:1.2	Fri Aug 11 19:44:40 2023
+++ src/external/gpl3/gdb/dist/gdb/netbsd-nat.c	Thu Aug 17 05:50:00 2023
@@ -458,12 +458,12 @@ nbsd_nat_target::info_proc (const char *
   return true;
 }
 
+#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,
give it that signal.  */
 
-#ifdef PT_STEP
 static void
 nbsd_resume(nbsd_nat_target *target, ptid_t ptid, int step,
 	enum gdb_signal signal)



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:50:00 UTC 2023

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

Log Message:
gdb: Adjust location of comment for clarity, no binary changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/netbsd-nat.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:48:09 UTC 2023

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

Log Message:
gdb/mips: Specify LWP ID for PT_[GS]ET{,FP}REGS, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/mips-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.c:1.2	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.c	Thu Aug 17 05:48:09 2023
@@ -54,13 +54,14 @@ void
 mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
 {
   pid_t pid = regcache->ptid ().pid ();
+  int lwp = regcache->ptid ().lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regno == -1 || getregs_supplies (gdbarch, regno))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
   
   mipsnbsd_supply_reg (regcache, (char *) , regno);
@@ -73,7 +74,7 @@ mips_nbsd_nat_target::fetch_registers (s
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   mipsnbsd_supply_fpreg (regcache, (char *) , regno);
@@ -84,18 +85,19 @@ void
 mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
 {
   pid_t pid = regcache->ptid ().pid ();
+  int lwp = regcache->ptid ().lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regno == -1 || getregs_supplies (gdbarch, regno))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   mipsnbsd_fill_reg (regcache, (char *) , regno);
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write registers"));
 
   if (regno != -1)
@@ -107,12 +109,12 @@ mips_nbsd_nat_target::store_registers (s
 {
   struct fpreg fpregs; 
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   mipsnbsd_fill_fpreg (regcache, (char *) , regno);
 
-  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:48:09 UTC 2023

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

Log Message:
gdb/mips: Specify LWP ID for PT_[GS]ET{,FP}REGS, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:02:56 UTC 2023

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

Log Message:
gdb/arm: Fix byte-order for trap insns on armv[67]eb, lost during merge

Add comment also.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/arm-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.2 src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.3
--- src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.2	Thu Aug 17 04:58:58 2023
+++ src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c	Thu Aug 17 05:02:56 2023
@@ -117,7 +117,9 @@ arm_netbsd_init_abi_common (struct gdbar
   arm_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   tdep->lowest_pc = 0x8000;
-  switch (info.byte_order)
+  /* For armv[67]eb (BE8), insns are encoded in little-endian.
+ Therefore, we cannot use info.byte_order here.  */
+  switch (info.byte_order_for_code)
 {
 case BFD_ENDIAN_LITTLE:
   tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 05:02:56 UTC 2023

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

Log Message:
gdb/arm: Fix byte-order for trap insns on armv[67]eb, lost during merge

Add comment also.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:58:59 UTC 2023

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

Log Message:
gdb/arm: Fix PC value for armeb, lost during merge

Extend comments for future references.

XXX
Why uint64_t is unconditionally used as CORE_ADDR even for
LP32 targets? (see gdbsupport/common-types.h)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:58:59 UTC 2023

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

Log Message:
gdb/arm: Fix PC value for armeb, lost during merge

Extend comments for future references.

XXX
Why uint64_t is unconditionally used as CORE_ADDR even for
LP32 targets? (see gdbsupport/common-types.h)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/arm-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c:1.1.1.1	Sun Jul 30 22:44:46 2023
+++ src/external/gpl3/gdb/dist/gdb/arm-netbsd-tdep.c	Thu Aug 17 04:58:58 2023
@@ -70,7 +70,10 @@ 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);
+  /* XXX Use uint32_t instead of CORE_ADDR (aka uint64_t; see
+	 gdbsupport/common-types.h).  Otherwise, zero-filled word
+	 will be stored for big-endian targets.  */
+  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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:54:59 UTC 2023

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

Log Message:
gdb/arm: Handle discontinous range of GPR number, lost during merge

Add comment for future references.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/arm-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.4	Thu Aug 17 04:52:38 2023
+++ src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c	Thu Aug 17 04:54:58 2023
@@ -38,6 +38,24 @@
 #include "netbsd-nat.h"
 #include "bsd-kvm.h"
 
+/* Determine if PT_GETREGS fetches REGNUM.  */
+
+static bool
+getregs_supplies (int regnum)
+{
+  return ((regnum >= ARM_A1_REGNUM && regnum <= ARM_PC_REGNUM)
+	  || regnum == ARM_PS_REGNUM);
+}
+
+/* Determine if PT_GETFPREGS fetches REGNUM.  */
+
+static bool
+getfpregs_supplies (int regnum)
+{
+  return ((regnum >= ARM_D0_REGNUM && regnum <= ARM_D31_REGNUM)
+	  || regnum == ARM_FPSCR_REGNUM);
+}
+
 class arm_netbsd_nat_target final : public nbsd_nat_target
 {
 public:
@@ -183,10 +201,15 @@ arm_netbsd_nat_target::fetch_registers (
 {
   if (regno >= 0)
 {
-  if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
+  /* Handle discontinuous range for general purpose registers.
+	 For floating-point registers, it happens to be continuous,
+	 but use specific static function for clarity.  */
+  if (getregs_supplies (regno))
 	fetch_register (regcache, regno);
-  else
+  else if (getfpregs_supplies (regno))
 	fetch_fp_register (regcache, regno);
+  else
+	warning (_("unable to fetch register %d"), regno);
 }
   else
 {



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:54:59 UTC 2023

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

Log Message:
gdb/arm: Handle discontinous range of GPR number, lost during merge

Add comment for future references.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:52:38 UTC 2023

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

Log Message:
gdb/arm: Restore upstream comment, accidentally lost during merge

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/arm-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c:1.3	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c	Thu Aug 17 04:52:38 2023
@@ -17,6 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
+/* We define this to get types like register_t.  */
 #include "defs.h"
 #include "gdbcore.h"
 #include "inferior.h"



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

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 04:52:38 UTC 2023

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

Log Message:
gdb/arm: Restore upstream comment, accidentally lost during merge

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.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

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 15:20:37 UTC 2023

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

Log Message:
put back the frame unwinder code lost in the merge (J. Hannken-Illjes)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-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-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.1.1.1	Sun Jul 30 18:44:48 2023
+++ src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c	Mon Aug 14 11:20:37 2023
@@ -28,6 +28,8 @@
 #include "gdbsupport/x86-xstate.h"
 #include "netbsd-tdep.h"
 #include "solib-svr4.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
 
 /* Support for signal handlers.  */
 
@@ -94,6 +96,196 @@ int amd64nbsd_r_reg_offset[] =
   15 * 8			/* %gs */
 };
 
+/* Kernel debugging support */
+static const int amd64nbsd_tf_reg_offset[] =
+{
+  18 * 8,			/* %rax */
+  17 * 8,			/* %rbx */
+  10 * 8,			/* %rcx */
+  2 * 8,			/* %rdx */
+  1 * 8,			/* %rsi */
+  0 * 8,			/* %rdi */
+  16 * 8,			/* %rbp */
+  28 * 8,			/* %rsp */
+  4 * 8,			/* %r8 .. */
+  5 * 8,			
+  3 * 8,			
+  11 * 8,			
+  12 * 8,			
+  13 * 8,			
+  14 * 8,			
+  15 * 8,			/* ... %r15 */
+  25 * 8,			/* %rip */
+  27 * 8,			/* %eflags */
+  26 * 8,			/* %cs */
+  29 * 8,			/* %ss */
+  22 * 8,			/* %ds */
+  21 * 8,			/* %es */
+  20 * 8,			/* %fs */
+  19 * 8,			/* %gs */
+};
+
+static struct trad_frame_cache *
+amd64nbsd_trapframe_cache(frame_info_ptr this_frame, void **this_cache)
+{
+  struct trad_frame_cache *cache;
+  CORE_ADDR func, sp, addr;
+  ULONGEST cs = 0, rip = 0;
+  const char *name;
+  int i;
+  struct gdbarch *gdbarch = get_frame_arch (this_frame);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+  if (*this_cache)
+return (struct trad_frame_cache *)*this_cache;
+
+  cache = trad_frame_cache_zalloc (this_frame);
+  *this_cache = cache;
+
+  func = get_frame_func (this_frame);
+  sp = get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM);
+
+  find_pc_partial_function (func, , NULL, NULL);
+
+  /* There is an extra 'call' in the interrupt sequence - ignore the extra
+   * return address */
+
+  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)
+  trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_tf_reg_offset[i]);
+
+  /* Read %cs and %rip when we have the addresses to hand */
+  cs = read_memory_unsigned_integer (addr
++ amd64nbsd_tf_reg_offset[AMD64_CS_REGNUM], 8, byte_order);
+  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))
+{
+
+  for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++)
+{
+
+  if (amd64nbsd_tf_reg_offset[i] == -1)
+continue;
+
+  trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_r_reg_offset[i]);
+
+  /* Read %cs when we have the address to hand */
+  if (i == AMD64_CS_REGNUM)
+	cs = read_memory_unsigned_integer (addr + amd64nbsd_r_reg_offset[i],
+	8, byte_order);
+}
+}
+
+  if ((cs & I386_SEL_RPL) == I386_SEL_UPL ||
+	(name && strncmp(name, "Xsoft", 5) == 0))
+{
+  /* Trap from user space or soft interrupt; terminate backtrace.  */
+  trad_frame_set_id (cache, outer_frame_id);
+}
+  else
+{
+  /* Construct the frame ID using the function start.  */
+  trad_frame_set_id (cache, frame_id_build (sp + 16, func));
+}
+
+  return cache;
+}
+
+static void
+amd64nbsd_trapframe_this_id (frame_info_ptr this_frame,
+			 void **this_cache,
+			 struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+amd64nbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+amd64nbsd_trapframe_prev_register (frame_info_ptr this_frame,
+   void **this_cache, int regnum) 
+{
+  struct trad_frame_cache *cache =
+amd64nbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cache, 

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

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 15:20:37 UTC 2023

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

Log Message:
put back the frame unwinder code lost in the merge (J. Hannken-Illjes)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.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

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 21:28:22 UTC 2023

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

Log Message:
put back the kvm code that was lost between 11.0 and 13.2


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-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-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-netbsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/amd64-netbsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/amd64-netbsd-nat.c:1.1.1.1	Sun Jul 30 18:44:45 2023
+++ src/external/gpl3/gdb/dist/gdb/amd64-netbsd-nat.c	Sun Aug 13 17:28:22 2023
@@ -24,6 +24,13 @@
 #include "amd64-tdep.h"
 #include "amd64-bsd-nat.h"
 #include "amd64-nat.h"
+#include "regcache.h"
+#include "gdbcore.h"
+#include "bsd-kvm.h"
+
+#include 
+#include 
+#include 
 
 /* Mapping between the general-purpose registers in NetBSD/amd64
`struct reg' format and GDB's register cache layout for
@@ -54,6 +61,55 @@ static int amd64nbsd32_r_reg_offset[] =
   15 * 8			/* %gs */
 };
 
+static int
+amd64nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct switchframe sf;
+
+  /* The following is true for NetBSD/amd64:
+
+ The pcb contains the stack pointer at the point of the context
+ switch in cpu_switchto().  At that point we have a stack frame as
+ described by `struct switchframe', which for NetBSD/amd64 has the
+ following layout:
+
+ interrupt level
+ %r15
+ %r14
+ %r13
+ %r12
+ %rbx
+ return address
+
+ Together with %rsp in the pcb, this accounts for all callee-saved
+ registers specified by the psABI.  From this information we
+ reconstruct the register state as it would look when we just
+ returned from cpu_switchto().
+
+ For kernel core dumps, dumpsys() builds a fake switchframe for us. */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_rsp == 0)
+return 0;
+
+  /* Read the stack frame, and check its validity.  */
+  read_memory (pcb->pcb_rsp, (gdb_byte *) , sizeof sf);
+  pcb->pcb_rsp += sizeof (struct switchframe);
+  regcache->raw_supply (12, _r12);
+  regcache->raw_supply (13, _r13);
+  regcache->raw_supply (14, _r14);
+  regcache->raw_supply (15, _r15);
+  regcache->raw_supply (AMD64_RBX_REGNUM, _rbx);
+  regcache->raw_supply (AMD64_RIP_REGNUM, _rip);
+
+  regcache->raw_supply (AMD64_RSP_REGNUM, >pcb_rsp);
+  regcache->raw_supply (AMD64_RBP_REGNUM, >pcb_rbp);
+  regcache->raw_supply (AMD64_FS_REGNUM, >pcb_fs);
+  regcache->raw_supply (AMD64_GS_REGNUM, >pcb_gs);
+
+  return 1;
+}
+
 static amd64_bsd_nat_target the_amd64_nbsd_nat_target;
 
 void _initialize_amd64nbsd_nat ();
@@ -65,4 +121,6 @@ _initialize_amd64nbsd_nat ()
   amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;
 
   add_inf_child_target (_amd64_nbsd_nat_target);
+
+  bsd_kvm_add_target (amd64nbsd_supply_pcb);
 }



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

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 21:28:22 UTC 2023

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

Log Message:
put back the kvm code that was lost between 11.0 and 13.2


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-nat.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

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 21:28:04 UTC 2023

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

Log Message:
centralize handling of kvm on NetBSD


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

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

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 21:28:04 UTC 2023

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

Log Message:
centralize handling of kvm on NetBSD


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

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.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.7 src/external/gpl3/gdb/dist/gdb/configure.nat:1.8
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.7	Sun Aug  6 16:25:30 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Sun Aug 13 17:28:04 2023
@@ -68,7 +68,9 @@ case ${gdb_host} in
 	LOADLIBES='-lkvm'
 	;;
 nbsd*)
-	NATDEPFILES='fork-child.o nat/fork-inferior.o nat/netbsd-nat.o inf-ptrace.o'
+	NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o \
+	nat/netbsd-nat.o bsd-kvm.o'
+	LOADLIBES='-lkvm'
 	HAVE_NATIVE_GCORE_HOST=1
 	;;
 obsd*)
@@ -345,8 +347,6 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd)
-	NATDEPFILES="${NATDEPFILES} bsd-kvm.o"
-	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	aarch64)
 		# Host: NetBSD/aarch64
@@ -366,8 +366,7 @@ case ${gdb_host} in
 		;;
 	powerpc)
 		# Host: NetBSD/powerpc
-		NATDEPFILES="${NATDEPFILES} ppc-netbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} ppc-netbsd-nat.o"
 		;;
 	sh)
 		# Host: NetBSD/sh
@@ -377,21 +376,16 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd64)
-	NATDEPFILES="${NATDEPFILES} bsd-kvm.o"
-	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	i386)
 		# Host: NetBSD/amd64
 		NATDEPFILES="${NATDEPFILES} netbsd-nat.o amd64-nat.o x86-nat.o \
 		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o \
-		amd64-netbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		amd64-netbsd-nat.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc64
-		NATDEPFILES="${NATDEPFILES} sparc64-netbsd-nat.o sparc-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc64-netbsd-nat.o sparc-nat.o"
 		;;
 
 	esac
@@ -408,8 +402,7 @@ case ${gdb_host} in
 		# Host: NetBSD/i386 ELF
 		NATDEPFILES="${NATDEPFILES} netbsd-nat.o x86-nat.o \
 		nat/x86-dregs.o \
-		x86-bsd-nat.o i386-bsd-nat.o i386-netbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		x86-bsd-nat.o i386-bsd-nat.o i386-netbsd-nat.o"
 		;;
 	m68k)
 		# Host: NetBSD/m68k ELF
@@ -417,9 +410,7 @@ case ${gdb_host} in
 		;;
 	sparc)
 		# Host: NetBSD/sparc ELF
-		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-netbsd-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-netbsd-nat.o"
 		;;
 	vax)
 		# Host: NetBSD/vax ELF



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

2023-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 13 21:25:56 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: GDBvn.texi

Log Message:
gdb/doc/GDBvn.texi: Omit spurious trailing blank line.

Reduces diff from upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi

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/doc/GDBvn.texi
diff -u src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.3 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.4
--- src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.3	Sun Aug 13 12:17:17 2023
+++ src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi	Sun Aug 13 21:25:55 2023
@@ -1,4 +1,3 @@
 @set GDBVN 13.2
 @set VERSION_PACKAGE (GDB) 
 @set BUGURL @uref{https://www.gnu.org/software/gdb/bugs/}
-



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

2023-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 13 21:25:56 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: GDBvn.texi

Log Message:
gdb/doc/GDBvn.texi: Omit spurious trailing blank line.

Reduces diff from upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi

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/doc

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 12:17:17 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: GDBvn.texi

Log Message:
restore original contents that got overwriten by the build.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi

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/doc/GDBvn.texi
diff -u src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.2 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.3
--- src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi:1.2	Mon Jul 31 13:00:50 2023
+++ src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi	Sun Aug 13 08:17:17 2023
@@ -1 +1,4 @@
 @set GDBVN 13.2
+@set VERSION_PACKAGE (GDB) 
+@set BUGURL @uref{https://www.gnu.org/software/gdb/bugs/}
+



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

2023-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 13 12:17:17 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: GDBvn.texi

Log Message:
restore original contents that got overwriten by the build.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/doc/GDBvn.texi

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

2023-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug  7 16:51:24 UTC 2023

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

Log Message:
Add missing i386 tdeps


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.29
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.28	Mon Jul 31 13:00:49 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Mon Aug  7 12:51:24 2023
@@ -729,7 +729,8 @@ x86_64-*-mingw* | x86_64-*-cygwin*)
 ;;
 x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
 	# Target: NetBSD/amd64
-	gdb_target_obs="amd64-netbsd-tdep.o ${i386_tobjs}"
+	gdb_target_obs="amd64-netbsd-tdep.o ${i386_tobjs}
+			i386-bsd-tdep.o i386-netbsd-tdep.o"
 	;;
 x86_64-*-openbsd*)
 	# Target: OpenBSD/amd64



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

2023-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug  7 16:51:24 UTC 2023

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

Log Message:
Add missing i386 tdeps


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.



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

2023-08-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  6 20:26:26 UTC 2023

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

Log Message:
Don't try to switch to thread on signals generated by the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c:1.4
--- src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c:1.3	Mon Jul 31 13:00:50 2023
+++ src/external/gpl3/gdb/dist/gdb/nat/fork-inferior.c	Sun Aug  6 16:26:26 2023
@@ -527,7 +527,9 @@ startup_inferior (process_stratum_target
 
 	  case TARGET_WAITKIND_STOPPED:
 	resume_signal = ws.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/gdb/nat

2023-08-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  6 20:26:26 UTC 2023

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

Log Message:
Don't try to switch to thread on signals generated by the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.



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

2023-08-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  6 20:25:30 UTC 2023

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

Log Message:
put back libkvm for amd64.


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

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.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.6 src/external/gpl3/gdb/dist/gdb/configure.nat:1.7
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.6	Mon Jul 31 13:00:49 2023
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Sun Aug  6 16:25:30 2023
@@ -383,7 +383,9 @@ case ${gdb_host} in
 	i386)
 		# Host: NetBSD/amd64
 		NATDEPFILES="${NATDEPFILES} netbsd-nat.o amd64-nat.o x86-nat.o \
-		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-netbsd-nat.o"
+		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o \
+		amd64-netbsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
 		;;
 	sparc)
 		# Host: NetBSD/sparc64



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

2023-08-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  6 20:25:30 UTC 2023

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

Log Message:
put back libkvm for amd64.


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

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

2023-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  8 07:38:48 UTC 2023

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

Log Message:
Missed a file in the RISC-V support commit


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

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.host
diff -u src/external/gpl3/gdb/dist/gdb/configure.host:1.12 src/external/gpl3/gdb/dist/gdb/configure.host:1.13
--- src/external/gpl3/gdb/dist/gdb/configure.host:1.12	Tue Sep 15 02:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/configure.host	Mon May  8 07:38:48 2023
@@ -147,6 +147,7 @@ powerpc64*-*-linux*)	gdb_host=ppc64-linu
 powerpc*-*-linux*)	gdb_host=linux ;;
 
 riscv*-*-freebsd*)	gdb_host=fbsd ;;
+riscv*-*-netbsd*)	gdb_host=nbsd ;;
 riscv*-*-linux*)	gdb_host=linux ;;
 
 s390*-*-linux*)		gdb_host=linux ;;



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

2023-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  8 07:38:48 UTC 2023

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

Log Message:
Missed a file in the RISC-V support commit


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

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

2022-06-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 08:28:07 UTC 2022

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

Log Message:
PR toolchain/56268

For NetBSD/m68k, program header is erroneously readable from core dump,
although a page containing it is missing. This spoils relocation for
the main executable, and debugging with core dumps becomes impossible,
as described in the PR.

In order to avoid this failure, add consistency check for program header;
for NetBSD, 1st entry of program header refers program header itself. If
this is not the case, we should be reading random garbage from core dump.

Yes, this is a kind of the hackest hack. But, unable to debug with core
dump is critical. Therefore, I commit this workaround temporarily until
the real cause is found and fixed.

Note that this is not a recent regression for GDB nor kernel, as
mentioned in the PR. These from netbsd-8 and -9 fail in the same way
without this hack.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/solib-svr4.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-svr4.c
diff -u src/external/gpl3/gdb/dist/gdb/solib-svr4.c:1.1.1.9 src/external/gpl3/gdb/dist/gdb/solib-svr4.c:1.2
--- src/external/gpl3/gdb/dist/gdb/solib-svr4.c:1.1.1.9	Tue Sep 15 01:43:33 2020
+++ src/external/gpl3/gdb/dist/gdb/solib-svr4.c	Sun Jun 26 08:28:07 2022
@@ -541,6 +541,40 @@ read_program_header (int type, int *p_ar
   if (target_read_memory (sect_addr, buf.data (), sect_size))
 return {};
 
+#if defined(__NetBSD__) && defined(__m68k__)
+  /*
+   * XXX PR toolchain/56268
+   *
+   * For NetBSD/m68k, program header is erroneously readable from core dump,
+   * although a page containing it is missing. This spoils relocation for
+   * the main executable, and debugging with core dumps becomes impossible,
+   * as described in toolchain/56268.
+   *
+   * In order to avoid this failure, we carry out consistency check for
+   * program header; for NetBSD, 1st entry of program header refers program
+   * header itself. If this is not the case, we should be reading random
+   * garbage from core dump.
+   */
+  if (type == -1 && arch_size == 32)
+{
+  Elf32_External_Phdr phdr;
+  int p_type, p_filesz, p_memsz;
+
+  if (target_read_memory (at_phdr, (gdb_byte *), sizeof (phdr)))
+return {};
+
+  p_type = extract_unsigned_integer ((gdb_byte *) phdr.p_type, 4,
+	 byte_order);
+  p_filesz = extract_unsigned_integer ((gdb_byte *)phdr.p_filesz, 4,
+	   byte_order);
+  p_memsz = extract_unsigned_integer ((gdb_byte *)phdr.p_memsz, 4,
+	  byte_order);
+
+  if (p_type != PT_PHDR || p_filesz != sect_size || p_memsz != sect_size)
+	return {};
+}
+#endif
+
   if (p_arch_size)
 *p_arch_size = arch_size;
   if (base_addr)



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

2022-06-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 08:28:07 UTC 2022

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

Log Message:
PR toolchain/56268

For NetBSD/m68k, program header is erroneously readable from core dump,
although a page containing it is missing. This spoils relocation for
the main executable, and debugging with core dumps becomes impossible,
as described in the PR.

In order to avoid this failure, add consistency check for program header;
for NetBSD, 1st entry of program header refers program header itself. If
this is not the case, we should be reading random garbage from core dump.

Yes, this is a kind of the hackest hack. But, unable to debug with core
dump is critical. Therefore, I commit this workaround temporarily until
the real cause is found and fixed.

Note that this is not a recent regression for GDB nor kernel, as
mentioned in the PR. These from netbsd-8 and -9 fail in the same way
without this hack.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/solib-svr4.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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:55:30 UTC 2022

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

Log Message:
PR port-powerpc/56899

Disable 128-bit long double for NetBSD/powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.8 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.9
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.8	Sun Jun 26 05:52:43 2022
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c	Sun Jun 26 05:55:30 2022
@@ -177,6 +177,10 @@ ppcnbsd_init_abi (struct gdbarch_info in
 {
   nbsd_init_abi (info, gdbarch);
 
+  /* NetBSD doesn't support the 128-bit `long double' from the psABI.  */
+  set_gdbarch_long_double_bit (gdbarch, 64);
+  set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
+
   /* For NetBSD, this is an on again, off again thing.  Some systems
  do use the broken struct convention, and some don't.  */
   set_gdbarch_return_value (gdbarch, ppcnbsd_return_value);



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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:55:30 UTC 2022

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

Log Message:
PR port-powerpc/56899

Disable 128-bit long double for NetBSD/powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.



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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:52:44 UTC 2022

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

Log Message:
PR port-powerpc/56899

In addition to ``powerpc'', register NetBSD OS ABI also for ``rs6000'',
which is default target for powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c:1.7	Sun Dec  6 14:26:40 2020
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-tdep.c	Sun Jun 26 05:52:43 2022
@@ -198,6 +198,8 @@ _initialize_ppcnbsd_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD,
 			  ppcnbsd_init_abi);
+  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_NETBSD,
+			  ppcnbsd_init_abi);
 
   /* Avoid initializing the register offsets again if they were
  already initialized by ppcnbsd-nat.c.  */



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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:52:44 UTC 2022

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

Log Message:
PR port-powerpc/56899

In addition to ``powerpc'', register NetBSD OS ABI also for ``rs6000'',
which is default target for powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.



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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:44:28 UTC 2022

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

Log Message:
Part of PR port-powerpc/56899

Set default OS ABI to NetBSD when target is *-*-netbsd*.

This fixes default behaviors of GDB when no executable is loaded
(== OS ABI is not determined yet).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.25 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.26
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.25	Tue Sep 15 02:05:18 2020
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Sun Jun 26 05:44:28 2022
@@ -786,6 +786,7 @@ case "${targ}" in
 		gdb_osabi=GDB_OSABI_FREEBSD ;;
 *-*-linux* | *-*-uclinux*)
 		gdb_osabi=GDB_OSABI_LINUX ;;
+*-*-netbsd*)	gdb_osabi=GDB_OSABI_NETBSD ;;
 *-*-nto*)	gdb_osabi=GDB_OSABI_QNXNTO ;;
 m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
 *-*-openbsd*)	gdb_osabi=GDB_OSABI_OPENBSD ;;



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

2022-06-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jun 26 05:44:28 UTC 2022

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

Log Message:
Part of PR port-powerpc/56899

Set default OS ABI to NetBSD when target is *-*-netbsd*.

This fixes default behaviors of GDB when no executable is loaded
(== OS ABI is not determined yet).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.



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

2021-10-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct  1 17:20:32 UTC 2021

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

Log Message:
Make this compilable as tool with MKCROSSGDB=yes


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/alpha-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/alpha-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.9 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.10
--- src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.9	Sat Dec  5 22:14:44 2020
+++ src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c	Fri Oct  1 17:20:32 2021
@@ -161,6 +161,12 @@ static const struct regset alphanbsd_fpr
 
 /* Iterate over supported core file register note sections. */
 
+
+void
+alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+	iterate_over_regset_sections_cb *cb,
+	void *cb_data,
+	const struct regcache *regcache);
 void
 alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 	iterate_over_regset_sections_cb *cb,
@@ -239,8 +245,8 @@ alphanbsd_sigtramp_cache_init (const str
 			   struct trad_frame_cache *this_cache,
 			   CORE_ADDR func)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  /* struct gdbarch *gdbarch = get_frame_arch (this_frame); */
+  /* struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); */
   CORE_ADDR addr, sp;
   int i;
 



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

2021-10-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct  1 17:20:32 UTC 2021

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

Log Message:
Make this compilable as tool with MKCROSSGDB=yes


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

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



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

2020-12-10 Thread Kamil Rytarowski
On 10.12.2020 08:14, Rin Okuyama wrote:
> 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?
> 


Yes, please remove it from headers for arm. This was a hack for DTrace
as far as I recall, to expose PT_STEP that way and get DTrace building.

Then, please restore nbsd-nat.c to the previous state.



signature.asc
Description: OpenPGP digital signature


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

2020-10-14 Thread Christos Zoulas
Thanks for fixing it!

christos


signature.asc
Description: Message signed with OpenPGP


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

2020-10-14 Thread Kamil Rytarowski
On 13.10.2020 11:14, Leonardo Taccari wrote:
> Hello Kamil,
> 
> Kamil Rytarowski writes:
>> 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).
>> [...]
> 
> This seems to break gdb, e.g. by starting debugging sleep(1):
> 
>  | % gdb sleep
>  | Reading symbols from sleep...
>  | Reading symbols from /usr/libdata/debug//bin/sleep.debug...
>  | (gdb) r
>  | Starting program: /bin/sleep
>  | /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.
>  | Quit this debugging session? (y or n) y
>  | 
>  | This is a bug, please report it.  For instructions, see:
>  | .
>  | 
>  | /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.
>  | Create a core file of GDB? (y or n) y
>  | [ 240.7909538] sorry, pid 2675 was killed: orphaned traced process
>  | Abort (core dumped)
>  | Exit 134
>  | % gdb -core gdb.core gdb
>  | Reading symbols from gdb...
>  | Reading symbols from /usr/libdata/debug//usr/bin/gdb.debug...
>  | [New process 1687]
>  | [New process 2908]
>  | [New process 2801]
>  | [New process 1688]
>  | [New process 1668]
>  | Core was generated by `gdb'.
>  | Program terminated with signal SIGABRT, Aborted.
>  | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
>  | [Current thread is 1 (process 1687)]
>  | (gdb) bt
>  | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
>  | #1  0x76efa3983879 in abort () at /usr/src/lib/libc/stdlib/abort.c:74
>  | #2  0xd83814e9 in dump_core () at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:204
>  | #3  0xd8386315 in internal_vproblem(internal_problem *, const char 
> *, int, const char *, typedef __va_list_tag __va_list_tag *) (
>  | problem=problem@entry=0xd8bf05e0 , 
> file=, line=, fmt=, 
> ap=ap@entry=0x7f7fff084bc8)
>  | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:414
>  | #4  0xd83864fb in internal_verror (file=, 
> line=, fmt=, ap=ap@entry=0x7f7fff084bc8)
>  | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:439
>  | #5  0xd862e40a in internal_error (file=file@entry=0xd8758578 
> "/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c", 
> line=line@entry=1309, fmt=)
>  | at 
> /usr/src/external/gpl3/gdb/lib/libgdbsupport/../../dist/gdbsupport/errors.cc:55
>  | #6  0xd83a96f5 in switch_to_thread (thr=0x0) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309
>  | #7  switch_to_thread (thr=) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1307
>  | #8  0xd854e02e in startup_inferior 
> (proc_target=proc_target@entry=0xd8bf1c50 , 
> pid=pid@entry=2675, ntraps=ntraps@entry=1,
>  | last_waitstatus=last_waitstatus@entry=0x0, 
> last_ptid=last_ptid@entry=0x0) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/nat/fork-inferior.c:539
>  | #9  0xd854ef07 in gdb_startup_inferior (pid=pid@entry=2675, 
> num_traps=num_traps@entry=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/fork-child.c:129
>  | #10 0xd84f8592 in inf_ptrace_target::create_inferior 
> (this=this@entry=0xd8bf1c50 , 
> exec_file=exec_file@entry=0x76efa67946f0 "/bin/sleep", allargs=...,
>  | env=env@entry=0x76efa6b1e400, from_tty=from_tty@entry=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/inf-ptrace.c:117
>  | #11 0xd82b98e0 in run_command_1 (args=, from_tty=1, 
> run_how=RUN_NORMAL) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/infcmd.c:493
>  | #12 0xd83663d2 in cmd_func (cmd=, args= out>, from_tty=) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/cli/cli-decode.c:2181
>  | #13 0xd83a402d in execute_command (p=, 
> p@entry=0x76efa6b5c020 "", from_tty=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/top.c:668
>  | #14 0xd82d726c in command_handler (command=0x76efa6b5c020 "") at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:588
>  | #15 0xd82d81ad in command_line_handler (rl=...) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:773
>  | #16 0xd82d7ad5 in gdb_rl_callback_handler (rl=0x76efa6b5c200 "r") 
> at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:219
>  | #17 0xd864f85e in rl_callback_read_char () at 
> 

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

2020-10-13 Thread Leonardo Taccari
Hello Kamil,

Kamil Rytarowski writes:
> 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).
> [...]

This seems to break gdb, e.g. by starting debugging sleep(1):

 | % gdb sleep
 | Reading symbols from sleep...
 | Reading symbols from /usr/libdata/debug//bin/sleep.debug...
 | (gdb) r
 | Starting program: /bin/sleep
 | /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.
 | Quit this debugging session? (y or n) y
 | 
 | This is a bug, please report it.  For instructions, see:
 | .
 | 
 | /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.
 | Create a core file of GDB? (y or n) y
 | [ 240.7909538] sorry, pid 2675 was killed: orphaned traced process
 | Abort (core dumped)
 | Exit 134
 | % gdb -core gdb.core gdb
 | Reading symbols from gdb...
 | Reading symbols from /usr/libdata/debug//usr/bin/gdb.debug...
 | [New process 1687]
 | [New process 2908]
 | [New process 2801]
 | [New process 1688]
 | [New process 1668]
 | Core was generated by `gdb'.
 | Program terminated with signal SIGABRT, Aborted.
 | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
 | [Current thread is 1 (process 1687)]
 | (gdb) bt
 | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
 | #1  0x76efa3983879 in abort () at /usr/src/lib/libc/stdlib/abort.c:74
 | #2  0xd83814e9 in dump_core () at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:204
 | #3  0xd8386315 in internal_vproblem(internal_problem *, const char 
*, int, const char *, typedef __va_list_tag __va_list_tag *) (
 | problem=problem@entry=0xd8bf05e0 , 
file=, line=, fmt=, 
ap=ap@entry=0x7f7fff084bc8)
 | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:414
 | #4  0xd83864fb in internal_verror (file=, 
line=, fmt=, ap=ap@entry=0x7f7fff084bc8)
 | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:439
 | #5  0xd862e40a in internal_error (file=file@entry=0xd8758578 
"/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c", 
line=line@entry=1309, fmt=)
 | at 
/usr/src/external/gpl3/gdb/lib/libgdbsupport/../../dist/gdbsupport/errors.cc:55
 | #6  0xd83a96f5 in switch_to_thread (thr=0x0) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309
 | #7  switch_to_thread (thr=) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1307
 | #8  0xd854e02e in startup_inferior 
(proc_target=proc_target@entry=0xd8bf1c50 , 
pid=pid@entry=2675, ntraps=ntraps@entry=1,
 | last_waitstatus=last_waitstatus@entry=0x0, 
last_ptid=last_ptid@entry=0x0) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/nat/fork-inferior.c:539
 | #9  0xd854ef07 in gdb_startup_inferior (pid=pid@entry=2675, 
num_traps=num_traps@entry=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/fork-child.c:129
 | #10 0xd84f8592 in inf_ptrace_target::create_inferior 
(this=this@entry=0xd8bf1c50 , 
exec_file=exec_file@entry=0x76efa67946f0 "/bin/sleep", allargs=...,
 | env=env@entry=0x76efa6b1e400, from_tty=from_tty@entry=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/inf-ptrace.c:117
 | #11 0xd82b98e0 in run_command_1 (args=, from_tty=1, 
run_how=RUN_NORMAL) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/infcmd.c:493
 | #12 0xd83663d2 in cmd_func (cmd=, args=, from_tty=) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/cli/cli-decode.c:2181
 | #13 0xd83a402d in execute_command (p=, 
p@entry=0x76efa6b5c020 "", from_tty=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/top.c:668
 | #14 0xd82d726c in command_handler (command=0x76efa6b5c020 "") at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:588
 | #15 0xd82d81ad in command_line_handler (rl=...) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:773
 | #16 0xd82d7ad5 in gdb_rl_callback_handler (rl=0x76efa6b5c200 "r") at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:219
 | #17 0xd864f85e in rl_callback_read_char () at 
/usr/src/external/gpl3/gdb/dist/readline/readline/callback.c:281
 | #18 0xd82d6c5e in gdb_rl_callback_read_char_wrapper_noexcept () at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:177
 | #19 0xd82d78e0 in gdb_rl_callback_read_char_wrapper 
(client_data=) at 

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

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:49:20 UTC 2019

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

Log Message:
add missing files for 32 bit debugging on 64 bit host.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.24
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.23	Fri Jul 12 18:44:11 2019
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Thu Nov 21 20:49:20 2019
@@ -771,7 +771,8 @@ x86_64-*-mingw* | x86_64-*-cygwin*)
 ;;
 x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
 	# Target: NetBSD/amd64
-	gdb_target_obs="amd64-nbsd-tdep.o ${i386_tobjs}"
+	gdb_target_obs="amd64-nbsd-tdep.o ${i386_tobjs} \
+			i386-bsd-tdep.o i386-nbsd-tdep.o"
 	;;
 x86_64-*-openbsd*)
 	# Target: OpenBSD/amd64



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

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:49:20 UTC 2019

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

Log Message:
add missing files for 32 bit debugging on 64 bit host.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.



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

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:48:50 UTC 2019

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

Log Message:
Support for compat-32 type shared library paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/external/gpl3/gdb/dist/gdb/solib.c:1.8
--- src/external/gpl3/gdb/dist/gdb/solib.c:1.7	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/solib.c	Thu Nov 21 20:48:50 2019
@@ -507,10 +507,27 @@ solib_bfd_open (const char *pathname)
   /* Check bfd arch.  */
   b = gdbarch_bfd_arch_info (target_gdbarch ());
   if (!b->compatible (b, bfd_get_arch_info (abfd.get (
-warning (_("`%s': Shared library architecture %s is not compatible "
-   "with target architecture %s."), bfd_get_filename (abfd),
+{
+  char buf[SO_NAME_MAX_PATH_SIZE];
+  char *slash = strrchr(pathname, '/');
+  if (slash)
+{
+  struct stat st;
+
+	  snprintf(buf, sizeof(buf), "%.*s/%s/%s", 
+	(int)(slash - pathname), pathname, b->printable_name, slash + 1);
+	  if (stat(buf, ) == 0)
+	return solib_bfd_open(buf);
+	  snprintf(buf, sizeof(buf), "%s-%s", 
+	pathname, b->printable_name);
+	  if (stat(buf, ) == 0)
+	return solib_bfd_open(buf);
+	}
+  warning (_("`%s': Shared library architecture %s is not compatible "
+ "with target architecture %s."), bfd_get_filename (abfd),
  bfd_get_arch_info (abfd.get ())->printable_name,
 	 b->printable_name);
+}
 
   return abfd;
 }



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

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:48:50 UTC 2019

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

Log Message:
Support for compat-32 type shared library paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.



  1   2   >