Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb Switch to FreeBSD's native implementation ...



details:   https://anonhg.NetBSD.org/src/rev/73843e24e204
branches:  trunk
changeset: 828161:73843e24e204
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 30 15:26:54 2017 +0000

description:
Switch to FreeBSD's native implementation for threads.

diffstat:

 external/gpl3/gdb/bin/gdb/Makefile                      |    6 +-
 external/gpl3/gdb/bin/gdbtui/Makefile                   |    6 +-
 external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c             |    3 +-
 external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c               |    3 +-
 external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh         |    3 +-
 external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh        |    3 +-
 external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh        |    2 +-
 external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh       |    2 +-
 external/gpl3/gdb/dist/gdb/config/m68k/nbsdelf.mh       |    3 +-
 external/gpl3/gdb/dist/gdb/config/mips/nbsd.mh          |    2 +-
 external/gpl3/gdb/dist/gdb/config/pa/nbsd.mh            |    3 +-
 external/gpl3/gdb/dist/gdb/config/powerpc/nbsd.mh       |    3 +-
 external/gpl3/gdb/dist/gdb/config/powerpc/ppc64-nbsd.mh |    3 +-
 external/gpl3/gdb/dist/gdb/config/sh/nbsd.mh            |    3 +-
 external/gpl3/gdb/dist/gdb/config/sparc/nbsd64.mh       |    3 +-
 external/gpl3/gdb/dist/gdb/config/sparc/nbsdelf.mh      |    3 +-
 external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh        |    4 +-
 external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c              |    4 +-
 external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c              |    3 +-
 external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c              |    4 +-
 external/gpl3/gdb/dist/gdb/nbsd-nat.c                   |  996 +++++++++++++++-
 external/gpl3/gdb/dist/gdb/nbsd-nat.h                   |    7 +-
 external/gpl3/gdb/dist/gdb/nbsd-thread.c                |  516 --------
 external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c               |    3 +-
 external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c                |    3 +-
 external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c             |    3 +-
 external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c           |    3 +-
 external/gpl3/gdb/lib/libgdb/arch/alpha/defs.mk         |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/alpha/init.c          |    2 -
 external/gpl3/gdb/lib/libgdb/arch/arm/defs.mk           |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/init.c            |    2 -
 external/gpl3/gdb/lib/libgdb/arch/armeb/defs.mk         |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/armeb/init.c          |    2 -
 external/gpl3/gdb/lib/libgdb/arch/coldfire/defs.mk      |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/coldfire/init.c       |    2 -
 external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk          |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/hppa/init.c           |    2 -
 external/gpl3/gdb/lib/libgdb/arch/i386/defs.mk          |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/i386/init.c           |    2 -
 external/gpl3/gdb/lib/libgdb/arch/m68000/defs.mk        |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/m68000/init.c         |    2 -
 external/gpl3/gdb/lib/libgdb/arch/m68k/defs.mk          |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/m68k/init.c           |    2 -
 external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk      |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/mips64eb/init.c       |    2 -
 external/gpl3/gdb/lib/libgdb/arch/mips64el/defs.mk      |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/mips64el/init.c       |    2 -
 external/gpl3/gdb/lib/libgdb/arch/mipseb/defs.mk        |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/mipseb/init.c         |    2 -
 external/gpl3/gdb/lib/libgdb/arch/mipsel/defs.mk        |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/mipsel/init.c         |    2 -
 external/gpl3/gdb/lib/libgdb/arch/powerpc/defs.mk       |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/powerpc/init.c        |    2 -
 external/gpl3/gdb/lib/libgdb/arch/powerpc64/defs.mk     |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/powerpc64/init.c      |    2 -
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/defs.mk         |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/init.c          |    2 -
 external/gpl3/gdb/lib/libgdb/arch/sh3el/defs.mk         |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/sh3el/init.c          |    2 -
 external/gpl3/gdb/lib/libgdb/arch/sparc/defs.mk         |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/sparc/init.c          |    2 -
 external/gpl3/gdb/lib/libgdb/arch/sparc64/defs.mk       |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/sparc64/init.c        |    2 -
 external/gpl3/gdb/lib/libgdb/arch/vax/defs.mk           |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/vax/init.c            |    2 -
 external/gpl3/gdb/lib/libgdb/arch/x86_64/defs.mk        |    2 +-
 external/gpl3/gdb/lib/libgdb/arch/x86_64/init.c         |    2 -
 67 files changed, 1046 insertions(+), 631 deletions(-)

diffs (truncated from 2434 to 300 lines):

diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/bin/gdb/Makefile
--- a/external/gpl3/gdb/bin/gdb/Makefile        Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/bin/gdb/Makefile        Thu Nov 30 15:26:54 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.12 2017/11/29 21:22:36 christos Exp $
+#      $NetBSD: Makefile,v 1.13 2017/11/30 15:26:54 christos Exp $
 
 NOCTF=
 .include <bsd.own.mk>
@@ -83,8 +83,8 @@
        ${LIBTERMINFO} \
        ${LIBIBERTYDIR}/libiberty.a
 
-LDADD+=                -lexpat -llzma -lz -lcurses -lintl -lm -lkvm 
-DPADD+=                ${LIBEXPAT} ${LIBLZMA} ${LIBZ} ${LIBCURSES} ${LIBINTL} ${LIBM} ${LIBKVM}
+LDADD+=                -lexpat -llzma -lz -lcurses -lintl -lm -lkvm -lutil
+DPADD+=                ${LIBEXPAT} ${LIBLZMA} ${LIBZ} ${LIBCURSES} ${LIBINTL} ${LIBM} ${LIBKVM} ${LIBUTIL}
 
 .include <bsd.prog.mk>
 
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/bin/gdbtui/Makefile
--- a/external/gpl3/gdb/bin/gdbtui/Makefile     Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/bin/gdbtui/Makefile     Thu Nov 30 15:26:54 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.9 2017/11/29 21:22:36 christos Exp $
+#      $NetBSD: Makefile,v 1.10 2017/11/30 15:26:54 christos Exp $
 NOCTF=
 .include "../Makefile.inc"
 
@@ -72,8 +72,8 @@
        ${LIBTERMINFO} \
        ${LIBIBERTYDIR}/libiberty.a
 
-LDADD+=                -lexpat -llzma -lz -lcurses -lintl -lm -lkvm
-DPADD+=                ${LIBEXPAT} ${LIBLZMA} ${LIBZ} ${LIBCURSES} ${LIBINTL} ${LIBM} ${LIBKVM}
+LDADD+=                -lexpat -llzma -lz -lcurses -lintl -lm -lkvm -lutil
+DPADD+=                ${LIBEXPAT} ${LIBLZMA} ${LIBZ} ${LIBCURSES} ${LIBINTL} ${LIBM} ${LIBKVM} ${LIBUTIL}
 
 .PATH: ${DIST}/gdb ${DIST}/gdb/mi ${DIST}/gdb/cli ${DIST}/gdb/tui \
     ${DIST}/gdb/signals ${DIST}/gdb/doc ${.CURDIR}/../arch/${GDB_MACHINE_ARCH}
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c       Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c       Thu Nov 30 15:26:54 2017 +0000
@@ -175,8 +175,7 @@
 
   /* Add some extra features to the common *BSD/amd64 target.  */
   t = amd64bsd_target ();
-  t->to_pid_to_exec_file = nbsd_pid_to_exec_file;
-  add_target (t);
+  nbsd_nat_add_target (t);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (amd64nbsd_supply_pcb);
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c Thu Nov 30 15:26:54 2017 +0000
@@ -623,8 +623,7 @@
   t = inf_ptrace_target ();
   t->to_fetch_registers = armnbsd_fetch_registers;
   t->to_store_registers = armnbsd_store_registers;
-  t->to_pid_to_exec_file = nbsd_pid_to_exec_file;
-  add_target (t);
+  nbsd_nat_add_target (t);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (armnbsd_supply_pcb);
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh   Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/alpha/nbsd.mh   Thu Nov 30 15:26:54 2017 +0000
@@ -1,5 +1,4 @@
 # Host: NetBSD/alpha
-NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o nbsd-nat.o \
-       nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o nbsd-nat.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh
--- a/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh  Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/arm/nbsdelf.mh  Thu Nov 30 15:26:54 2017 +0000
@@ -1,5 +1,4 @@
 # Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o arm-nbsd-nat.o \
-       bsd-kvm.o nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o arm-nbsd-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
--- a/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh  Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh  Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,6 @@
 # Host: NetBSD/amd64
 NATDEPFILES= fork-child.o inf-ptrace.o \
        nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o \
-       bsd-kvm.o nbsd-thread.o x86-nat.o x86-dregs.o
+       bsd-kvm.o x86-nat.o x86-dregs.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh
--- a/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,6 @@
 # Host: NetBSD/i386 ELF
 NATDEPFILES= fork-child.o inf-ptrace.o \
-       nbsd-nat.o nbsd-thread.o x86-bsd-nat.o x86-nat.o x86-dregs.o \
+       nbsd-nat.o x86-bsd-nat.o x86-nat.o x86-dregs.o \
        i386-bsd-nat.o i386-nbsd-nat.o \
        bsd-kvm.o
 
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/m68k/nbsdelf.mh
--- a/external/gpl3/gdb/dist/gdb/config/m68k/nbsdelf.mh Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/m68k/nbsdelf.mh Thu Nov 30 15:26:54 2017 +0000
@@ -1,5 +1,4 @@
 # Host: NetBSD/m68k ELF
-NATDEPFILES= nbsd-nat.o m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o \
-       nbsd-thread.o
+NATDEPFILES= nbsd-nat.o m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/mips/nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/mips/nbsd.mh    Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/mips/nbsd.mh    Thu Nov 30 15:26:54 2017 +0000
@@ -1,4 +1,4 @@
 # Host: NetBSD/mips
 NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o mips-nbsd-nat.o \
-       nbsd-thread.o bsd-kvm.o
+       bsd-kvm.o
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/pa/nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mh      Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/pa/nbsd.mh      Thu Nov 30 15:26:54 2017 +0000
@@ -1,3 +1,2 @@
 # Host: NetBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o \
-       nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/powerpc/nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/powerpc/nbsd.mh Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/powerpc/nbsd.mh Thu Nov 30 15:26:54 2017 +0000
@@ -1,5 +1,4 @@
 # Host: NetBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o ppc-nbsd-nat.o bsd-kvm.o \
-       nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o ppc-nbsd-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/powerpc/ppc64-nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/powerpc/ppc64-nbsd.mh   Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/powerpc/ppc64-nbsd.mh   Thu Nov 30 15:26:54 2017 +0000
@@ -1,5 +1,4 @@
 # Host: NetBSD/powerpc64
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o ppc-nbsd-nat.o bsd-kvm.o \
-       nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o ppc-nbsd-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/sh/nbsd.mh
--- a/external/gpl3/gdb/dist/gdb/config/sh/nbsd.mh      Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/sh/nbsd.mh      Thu Nov 30 15:26:54 2017 +0000
@@ -1,3 +1,2 @@
 # Host: NetBSD/sh
-NATDEPFILES= inf-ptrace.o fork-child.o nbsd-nat.o sh-nbsd-nat.o \
-       nbsd-thread.o
+NATDEPFILES= inf-ptrace.o fork-child.o nbsd-nat.o sh-nbsd-nat.o
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/sparc/nbsd64.mh
--- a/external/gpl3/gdb/dist/gdb/config/sparc/nbsd64.mh Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/sparc/nbsd64.mh Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,5 @@
 # Host: NetBSD/sparc64
 NATDEPFILES= fork-child.o inf-ptrace.o \
-       nbsd-nat.o sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o \
-       nbsd-thread.o
+       nbsd-nat.o sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/sparc/nbsdelf.mh
--- a/external/gpl3/gdb/dist/gdb/config/sparc/nbsdelf.mh        Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/sparc/nbsdelf.mh        Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,5 @@
 # Host: NetBSD/sparc ELF
 NATDEPFILES= fork-child.o inf-ptrace.o \
-       nbsd-nat.o sparc-nbsd-nat.o sparc-nat.o bsd-kvm.o \
-       nbsd-thread.o
+       nbsd-nat.o sparc-nbsd-nat.o sparc-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh
--- a/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh  Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/config/vax/nbsdelf.mh  Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,4 @@
 # Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       nbsd-nat.o vax-bsd-nat.o bsd-kvm.o \
-       nbsd-thread.o
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o vax-bsd-nat.o bsd-kvm.o
 
 LOADLIBES= -lkvm
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c        Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c        Thu Nov 30 15:26:54 2017 +0000
@@ -285,7 +285,5 @@
   t->to_fetch_registers = hppanbsd_fetch_registers;
   t->to_store_registers = hppanbsd_store_registers;
 
-  t->to_pid_to_exec_file = nbsd_pid_to_exec_file;
-
-  add_target (t);
+  nbsd_nat_add_target (t);
 }
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c        Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c        Thu Nov 30 15:26:54 2017 +0000
@@ -141,8 +141,7 @@
 
   /* Add some extra features to the common *BSD/i386 target.  */
   t = i386bsd_target ();
-  t->to_pid_to_exec_file = nbsd_pid_to_exec_file;
-  add_target (t);
+  nbsd_nat_add_target (t);
  
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (i386nbsd_supply_pcb);
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c        Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c        Thu Nov 30 15:26:54 2017 +0000
@@ -161,7 +161,7 @@
   return 0;
 }
 
-/* Wrapper functions.  These are only used by nbsd-thread.  */
+/* Wrapper functions. */
 void
 supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
@@ -199,7 +199,7 @@
   t = inf_ptrace_target ();
   t->to_fetch_registers = mipsnbsd_fetch_inferior_registers;
   t->to_store_registers = mipsnbsd_store_inferior_registers;
-  add_target (t);
+  nbsd_nat_add_target (t);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (mipsnbsd_supply_pcb);
diff -r 271bc257ac90 -r 73843e24e204 external/gpl3/gdb/dist/gdb/nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/nbsd-nat.c     Thu Nov 30 14:51:01 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/nbsd-nat.c     Thu Nov 30 15:26:54 2017 +0000
@@ -1,6 +1,6 @@
-/* Native-dependent code for NetBSD.
+/* Native-dependent code for NetBSD
 
-   Copyright (C) 2006-2017 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,19 +18,46 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "regset.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "gdb_wait.h"
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <sys/sysctl.h>
+#ifdef HAVE_KINFO_GETVMMAP
+#include <util.h>
+#endif
 
+#include "elf-bfd.h"
 #include "nbsd-nat.h"
 
 /* Return the name of a file that can be opened to get the symbols for
    the child process identified by PID.  */
 
-char *
+static char *
 nbsd_pid_to_exec_file (struct target_ops *self, int pid)
 {
   ssize_t len;
   static char buf[PATH_MAX];
   char name[PATH_MAX];
 
+#ifdef KERN_PROC_PATHNAME
+  size_t buflen;
+  int mib[4];
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
+  mib[2] = KERN_PROC_PATHNAME;
+  mib[3] = pid;
+  buflen = sizeof buf;
+  if (sysctl (mib, 4, buf, &buflen, NULL, 0) == 0)
+    return buf;
+#endif
+
   xsnprintf (name, PATH_MAX, "/proc/%d/exe", pid);



Home | Main Index | Thread Index | Old Index