This updates GDB to the latest version, 8.1. Tested on amd64, i386, armv7 and hppa.
This port has become somewhat essential infrastructure, so I'd appreciate some tests with various applications and platforms before this goes in. Index: Makefile =================================================================== RCS file: /cvs/ports/devel/gdb/Makefile,v retrieving revision 1.53 diff -u -p -r1.53 Makefile --- Makefile 24 Jan 2018 00:19:56 -0000 1.53 +++ Makefile 9 Feb 2018 20:22:45 -0000 @@ -6,8 +6,7 @@ NOT_FOR_ARCHS= aarch64 COMMENT= GNU debugger CATEGORIES= devel -DISTNAME= gdb-7.12.1 -REVISION= 1 +DISTNAME= gdb-8.1 HOMEPAGE= https://www.gnu.org/software/gdb/ @@ -22,7 +21,7 @@ EXTRACT_SUFX= .tar.xz MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC} ${WRKSRC}/gdb -WANTLIB = c expat kvm m ncurses pthread ${MODPY_WANTLIB} ${COMPILER_LIBCXX} util +WANTLIB = c expat kvm m curses pthread ${MODPY_WANTLIB} ${COMPILER_LIBCXX} util #SEPARATE_BUILD = Yes CONFIGURE_STYLE=gnu @@ -35,9 +34,14 @@ CONFIGURE_ARGS= --program-prefix=e \ USE_GMAKE= Yes +COMPILER = base-clang ports-gcc + MODULES += lang/python LIB_DEPENDS += ${MODPY_LIB_DEPENDS} TEST_DEPENDS += devel/dejagnu MODPY_BUILDDEP = No + +# for max_align_t configure test +CFLAGS += -std=gnu11 .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/devel/gdb/distinfo,v retrieving revision 1.22 diff -u -p -r1.22 distinfo --- distinfo 28 Jan 2017 21:38:15 -0000 1.22 +++ distinfo 9 Feb 2018 20:22:45 -0000 @@ -1,2 +1,2 @@ -SHA256 (gdb/gdb-7.12.1.tar.xz) = RgdoC5c9PsksMK0Cnxt9veOHaGnms6EX2KfpAIERMYY= -SIZE (gdb/gdb-7.12.1.tar.xz) = 19225392 +SHA256 (gdb/gdb-8.1.tar.xz) = r2GgJjhY5pxdzlHqsmZi/z0q2apo2pWD6BQ7VCa+SzQ= +SIZE (gdb/gdb-8.1.tar.xz) = 20095080 Index: patches/patch-bfd_elf_c =================================================================== RCS file: /cvs/ports/devel/gdb/patches/patch-bfd_elf_c,v retrieving revision 1.9 diff -u -p -r1.9 patch-bfd_elf_c --- patches/patch-bfd_elf_c 9 Oct 2016 11:39:20 -0000 1.9 +++ patches/patch-bfd_elf_c 9 Feb 2018 20:22:45 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-bfd_elf_c,v 1.9 2016/10/09 11:39:20 pascal Exp $ ---- bfd/elf.c.orig Fri Oct 7 19:09:21 2016 -+++ bfd/elf.c Fri Oct 7 20:53:14 2016 -@@ -9866,6 +9866,11 @@ elfcore_grok_openbsd_procinfo (bfd *abfd, Elf_Internal +Index: bfd/elf.c +--- bfd/elf.c.orig ++++ bfd/elf.c +@@ -10183,6 +10183,11 @@ elfcore_grok_openbsd_procinfo (bfd *abfd, Elf_Internal static bfd_boolean elfcore_grok_openbsd_note (bfd *abfd, Elf_Internal_Note *note) { Index: patches/patch-gdb_alpha-bsd-nat_c =================================================================== RCS file: patches/patch-gdb_alpha-bsd-nat_c diff -N patches/patch-gdb_alpha-bsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_alpha-bsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,55 @@ +$OpenBSD$ + +Index: gdb/alpha-bsd-nat.c +--- gdb/alpha-bsd-nat.c.orig ++++ gdb/alpha-bsd-nat.c +@@ -91,7 +91,7 @@ alphabsd_fetch_inferior_registers (struct target_ops * + { + struct reg gregs; + +- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &gregs, 0) == -1) + perror_with_name (_("Couldn't get registers")); + +@@ -105,7 +105,7 @@ alphabsd_fetch_inferior_registers (struct target_ops * + { + struct fpreg fpregs; + +- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) + perror_with_name (_("Couldn't get floating point status")); + +@@ -123,13 +123,13 @@ alphabsd_store_inferior_registers (struct target_ops * + if (regno == -1 || getregs_supplies (regno)) + { + struct reg gregs; +- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &gregs, 0) == -1) + perror_with_name (_("Couldn't get registers")); + + alphabsd_fill_reg (regcache, (char *) &gregs, regno); + +- if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_SETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &gregs, 0) == -1) + perror_with_name (_("Couldn't write registers")); + +@@ -142,13 +142,13 @@ alphabsd_store_inferior_registers (struct target_ops * + { + struct fpreg fpregs; + +- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) + perror_with_name (_("Couldn't get floating point status")); + + alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno); + +- if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_SETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) + perror_with_name (_("Couldn't write floating point status")); + } Index: patches/patch-gdb_alphabsd-nat_c =================================================================== RCS file: patches/patch-gdb_alphabsd-nat_c diff -N patches/patch-gdb_alphabsd-nat_c --- patches/patch-gdb_alphabsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ -$OpenBSD: patch-gdb_alphabsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/alphabsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/alphabsd-nat.c Sat May 14 22:54:35 2016 -@@ -91,7 +91,7 @@ alphabsd_fetch_inferior_registers (struct target_ops * - { - struct reg gregs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &gregs, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -105,7 +105,7 @@ alphabsd_fetch_inferior_registers (struct target_ops * - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - -@@ -123,13 +123,13 @@ alphabsd_store_inferior_registers (struct target_ops * - if (regno == -1 || getregs_supplies (regno)) - { - struct reg gregs; -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &gregs, 0) == -1) - perror_with_name (_("Couldn't get registers")); - - alphabsd_fill_reg (regcache, (char *) &gregs, regno); - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &gregs, 0) == -1) - perror_with_name (_("Couldn't write registers")); - -@@ -142,13 +142,13 @@ alphabsd_store_inferior_registers (struct target_ops * - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - - alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno); - -- if (ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't write floating point status")); - } Index: patches/patch-gdb_arm-nbsd-nat_c =================================================================== RCS file: patches/patch-gdb_arm-nbsd-nat_c diff -N patches/patch-gdb_arm-nbsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_arm-nbsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,141 @@ +$OpenBSD$ + +Index: gdb/arm-nbsd-nat.c +--- gdb/arm-nbsd-nat.c.orig ++++ gdb/arm-nbsd-nat.c +@@ -65,10 +65,10 @@ arm_supply_fparegset (struct regcache *regcache, struc + + for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++) + regcache_raw_supply (regcache, regno, +- (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]); ++ (char *) &fparegset->fp_reg[regno - ARM_F0_REGNUM]); + + regcache_raw_supply (regcache, ARM_FPS_REGNUM, +- (char *) &fparegset->fpr_fpsr); ++ (char *) &fparegset->fp_scr); + } + + static void +@@ -77,7 +77,7 @@ fetch_register (struct regcache *regcache, int regno) + struct reg inferior_registers; + int ret; + +- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_registers, 0); + + if (ret < 0) +@@ -130,7 +130,7 @@ fetch_regs (struct regcache *regcache) + int ret; + int regno; + +- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_registers, 0); + + if (ret < 0) +@@ -148,7 +148,7 @@ fetch_fp_register (struct regcache *regcache, int regn + struct fpreg inferior_fp_registers; + int ret; + +- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); + + if (ret < 0) +@@ -161,12 +161,12 @@ fetch_fp_register (struct regcache *regcache, int regn + { + case ARM_FPS_REGNUM: + regcache_raw_supply (regcache, ARM_FPS_REGNUM, +- (char *) &inferior_fp_registers.fpr_fpsr); ++ (char *) &inferior_fp_registers.fp_scr); + break; + + default: + regcache_raw_supply (regcache, regno, +- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); ++ (char *) &inferior_fp_registers.fp_reg[regno - ARM_F0_REGNUM]); + break; + } + } +@@ -178,7 +178,7 @@ fetch_fp_regs (struct regcache *regcache) + int ret; + int regno; + +- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); + + if (ret < 0) +@@ -216,7 +216,7 @@ store_register (const struct regcache *regcache, int r + struct reg inferior_registers; + int ret; + +- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_registers, 0); + + if (ret < 0) +@@ -279,7 +279,7 @@ store_register (const struct regcache *regcache, int r + break; + } + +- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_SETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_registers, 0); + + if (ret < 0) +@@ -327,7 +327,7 @@ store_regs (const struct regcache *regcache) + inferior_registers.r_pc = pc_val | psr_val; + } + +- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_SETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_registers, 0); + + if (ret < 0) +@@ -340,7 +340,7 @@ store_fp_register (const struct regcache *regcache, in + struct fpreg inferior_fp_registers; + int ret; + +- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); + + if (ret < 0) +@@ -353,16 +353,16 @@ store_fp_register (const struct regcache *regcache, in + { + case ARM_FPS_REGNUM: + regcache_raw_collect (regcache, ARM_FPS_REGNUM, +- (char *) &inferior_fp_registers.fpr_fpsr); ++ (char *) &inferior_fp_registers.fp_scr); + break; + + default: + regcache_raw_collect (regcache, regno, +- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); ++ (char *) &inferior_fp_registers.fp_reg[regno - ARM_F0_REGNUM]); + break; + } + +- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_SETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); + + if (ret < 0) +@@ -379,12 +379,12 @@ store_fp_regs (const struct regcache *regcache) + + for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++) + regcache_raw_collect (regcache, regno, +- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); ++ (char *) &inferior_fp_registers.fp_reg[regno - ARM_F0_REGNUM]); + + regcache_raw_collect (regcache, ARM_FPS_REGNUM, +- (char *) &inferior_fp_registers.fpr_fpsr); ++ (char *) &inferior_fp_registers.fp_scr); + +- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ ret = ptrace (PT_SETFPREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); + + if (ret < 0) Index: patches/patch-gdb_armnbsd-nat_c =================================================================== RCS file: patches/patch-gdb_armnbsd-nat_c diff -N patches/patch-gdb_armnbsd-nat_c --- patches/patch-gdb_armnbsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,93 +0,0 @@ -$OpenBSD: patch-gdb_armnbsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/armnbsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/armnbsd-nat.c Sat May 14 22:54:35 2016 -@@ -77,7 +77,7 @@ fetch_register (struct regcache *regcache, int regno) - struct reg inferior_registers; - int ret; - -- ret = ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0); - - if (ret < 0) -@@ -130,7 +130,7 @@ fetch_regs (struct regcache *regcache) - int ret; - int regno; - -- ret = ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0); - - if (ret < 0) -@@ -148,7 +148,7 @@ fetch_fp_register (struct regcache *regcache, int regn - struct fpreg inferior_fp_registers; - int ret; - -- ret = ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); - - if (ret < 0) -@@ -178,7 +178,7 @@ fetch_fp_regs (struct regcache *regcache) - int ret; - int regno; - -- ret = ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); - - if (ret < 0) -@@ -216,7 +216,7 @@ store_register (const struct regcache *regcache, int r - struct reg inferior_registers; - int ret; - -- ret = ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0); - - if (ret < 0) -@@ -279,7 +279,7 @@ store_register (const struct regcache *regcache, int r - break; - } - -- ret = ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0); - - if (ret < 0) -@@ -327,7 +327,7 @@ store_regs (const struct regcache *regcache) - inferior_registers.r_pc = pc_val | psr_val; - } - -- ret = ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0); - - if (ret < 0) -@@ -340,7 +340,7 @@ store_fp_register (const struct regcache *regcache, in - struct fpreg inferior_fp_registers; - int ret; - -- ret = ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); - - if (ret < 0) -@@ -362,7 +362,7 @@ store_fp_register (const struct regcache *regcache, in - break; - } - -- ret = ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); - - if (ret < 0) -@@ -384,7 +384,7 @@ store_fp_regs (const struct regcache *regcache) - regcache_raw_collect (regcache, ARM_FPS_REGNUM, - (char *) &inferior_fp_registers.fpr_fpsr); - -- ret = ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), -+ ret = ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); - - if (ret < 0) Index: patches/patch-gdb_data-directory_Makefile_in =================================================================== RCS file: /cvs/ports/devel/gdb/patches/patch-gdb_data-directory_Makefile_in,v retrieving revision 1.9 diff -u -p -r1.9 patch-gdb_data-directory_Makefile_in --- patches/patch-gdb_data-directory_Makefile_in 9 Oct 2016 11:39:20 -0000 1.9 +++ patches/patch-gdb_data-directory_Makefile_in 9 Feb 2018 20:22:45 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-gdb_data-directory_Makefile_in,v 1.9 2016/10/09 11:39:20 pascal Exp $ ---- gdb/data-directory/Makefile.in.orig Mon Aug 1 17:50:20 2016 -+++ gdb/data-directory/Makefile.in Fri Oct 7 20:53:14 2016 -@@ -187,7 +187,7 @@ stamp-syscalls: Makefile $(SYSCALLS_FILES) +Index: gdb/data-directory/Makefile.in +--- gdb/data-directory/Makefile.in.orig ++++ gdb/data-directory/Makefile.in +@@ -198,7 +198,7 @@ stamp-syscalls: Makefile $(SYSCALLS_FILES) for file in $$files ; do \ f=$(SYSCALLS_SRCDIR)/$$file ; \ if test -f $$f ; then \ @@ -10,7 +11,7 @@ $OpenBSD: patch-gdb_data-directory_Makef fi ; \ done touch $@ -@@ -229,8 +229,8 @@ stamp-python: Makefile $(PYTHON_FILES) +@@ -240,8 +240,8 @@ stamp-python: Makefile $(PYTHON_FILES) if test "x$$files" != x ; then \ for file in $$files ; do \ dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ @@ -21,7 +22,7 @@ $OpenBSD: patch-gdb_data-directory_Makef done ; \ fi touch $@ -@@ -323,7 +323,7 @@ stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES) +@@ -334,7 +334,7 @@ stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES) for file in $$files ; do \ f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \ if test -f $$f ; then \ Index: patches/patch-gdb_hppa-obsd-nat_c =================================================================== RCS file: patches/patch-gdb_hppa-obsd-nat_c diff -N patches/patch-gdb_hppa-obsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_hppa-obsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,59 @@ +$OpenBSD$ + +Index: gdb/hppa-obsd-nat.c +--- gdb/hppa-obsd-nat.c.orig ++++ gdb/hppa-obsd-nat.c +@@ -49,7 +49,7 @@ static void + hppaobsd_supply_gregset (struct regcache *regcache, const void *gregs) + { + gdb_byte zero[4] = { 0 }; +- const char *regs = gregs; ++ const char *regs = (const char *)gregs; + int regnum; + + regcache_raw_supply (regcache, HPPA_R0_REGNUM, &zero); +@@ -88,7 +88,7 @@ hppaobsd_supply_gregset (struct regcache *regcache, co + static void + hppaobsd_supply_fpregset (struct regcache *regcache, const void *fpregs) + { +- const char *regs = fpregs; ++ const char *regs = (const char *)fpregs; + int regnum; + + for (regnum = HPPA_FP0_REGNUM; regnum <= HPPA_FP31R_REGNUM; +@@ -106,7 +106,7 @@ static void + hppaobsd_collect_gregset (const struct regcache *regcache, + void *gregs, int regnum) + { +- char *regs = gregs; ++ char *regs = (char *)gregs; + int i; + + for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++) +@@ -168,7 +168,7 @@ static void + hppaobsd_collect_fpregset (struct regcache *regcache, + void *fpregs, int regnum) + { +- char *regs = fpregs; ++ char *regs = (char *)fpregs; + int i; + + for (i = HPPA_FP0_REGNUM; i <= HPPA_FP31R_REGNUM; i += 2, regs += 8) +@@ -189,7 +189,7 @@ static void + hppaobsd_fetch_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) + { +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum)) + { +@@ -219,6 +219,8 @@ static void + hppaobsd_store_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) + { ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); ++ + if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum)) + { + struct reg regs; Index: patches/patch-gdb_hppaobsd-nat_c =================================================================== RCS file: patches/patch-gdb_hppaobsd-nat_c diff -N patches/patch-gdb_hppaobsd-nat_c --- patches/patch-gdb_hppaobsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ -$OpenBSD: patch-gdb_hppaobsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/hppaobsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/hppaobsd-nat.c Sat May 14 22:54:35 2016 -@@ -193,7 +193,7 @@ hppaobsd_fetch_registers (struct target_ops *ops, - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -204,7 +204,7 @@ hppaobsd_fetch_registers (struct target_ops *ops, - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - -@@ -223,13 +223,13 @@ hppaobsd_store_registers (struct target_ops *ops, - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - - hppaobsd_collect_gregset (regcache, ®s, regnum); - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't write registers")); - } -@@ -238,13 +238,13 @@ hppaobsd_store_registers (struct target_ops *ops, - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - - hppaobsd_collect_fpregset (regcache, &fpregs, regnum); - -- if (ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't write floating point status")); - } Index: patches/patch-gdb_m88k-bsd-nat_c =================================================================== RCS file: patches/patch-gdb_m88k-bsd-nat_c diff -N patches/patch-gdb_m88k-bsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_m88k-bsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,30 @@ +$OpenBSD$ + +Index: gdb/m88k-bsd-nat.c +--- gdb/m88k-bsd-nat.c.orig ++++ gdb/m88k-bsd-nat.c +@@ -68,7 +68,7 @@ m88kbsd_fetch_inferior_registers (struct target_ops *o + { + struct reg regs; + +- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); + +@@ -84,13 +84,13 @@ m88kbsd_store_inferior_registers (struct target_ops *o + { + struct reg regs; + +- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_GETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); + + m88kbsd_collect_gregset (regcache, ®s, regnum); + +- if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), ++ if (ptrace (PT_SETREGS, get_ptrace_pid (regcache_get_ptid (regcache)), + (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't write registers")); + } Index: patches/patch-gdb_m88kbsd-nat_c =================================================================== RCS file: patches/patch-gdb_m88kbsd-nat_c diff -N patches/patch-gdb_m88kbsd-nat_c --- patches/patch-gdb_m88kbsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,28 +0,0 @@ -$OpenBSD: patch-gdb_m88kbsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/m88kbsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/m88kbsd-nat.c Sat May 14 22:54:35 2016 -@@ -68,7 +68,7 @@ m88kbsd_fetch_inferior_registers (struct target_ops *o - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -84,13 +84,13 @@ m88kbsd_store_inferior_registers (struct target_ops *o - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - - m88kbsd_collect_gregset (regcache, ®s, regnum); - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't write registers")); - } Index: patches/patch-gdb_mips64-obsd-nat_c =================================================================== RCS file: patches/patch-gdb_mips64-obsd-nat_c diff -N patches/patch-gdb_mips64-obsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_mips64-obsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,41 @@ +$OpenBSD$ + +Index: gdb/mips64-obsd-nat.c +--- gdb/mips64-obsd-nat.c.orig ++++ gdb/mips64-obsd-nat.c +@@ -40,7 +40,7 @@ + static void + mips64obsd_supply_gregset (struct regcache *regcache, const void *gregs) + { +- const char *regs = gregs; ++ const char *regs = (const char *) gregs; + int regnum; + + for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++) +@@ -57,7 +57,7 @@ static void + mips64obsd_collect_gregset (const struct regcache *regcache, + void *gregs, int regnum) + { +- char *regs = gregs; ++ char *regs = (char *) gregs; + int i; + + for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++) +@@ -82,7 +82,7 @@ mips64obsd_fetch_inferior_registers (struct target_ops + struct regcache *regcache, int regnum) + { + struct reg regs; +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); +@@ -98,7 +98,7 @@ mips64obsd_store_inferior_registers (struct target_ops + struct regcache *regcache, int regnum) + { + struct reg regs; +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); Index: patches/patch-gdb_mips64obsd-nat_c =================================================================== RCS file: patches/patch-gdb_mips64obsd-nat_c diff -N patches/patch-gdb_mips64obsd-nat_c --- patches/patch-gdb_mips64obsd-nat_c 21 Oct 2016 13:13:31 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -$OpenBSD: patch-gdb_mips64obsd-nat_c,v 1.2 2016/10/21 13:13:31 visa Exp $ ---- gdb/mips64obsd-nat.c.orig Mon Aug 1 09:50:20 2016 -+++ gdb/mips64obsd-nat.c Tue Oct 18 07:24:31 2016 -@@ -40,7 +40,7 @@ - static void - mips64obsd_supply_gregset (struct regcache *regcache, const void *gregs) - { -- const char *regs = gregs; -+ const char *regs = (const char *) gregs; - int regnum; - - for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++) -@@ -57,7 +57,7 @@ static void - mips64obsd_collect_gregset (const struct regcache *regcache, - void *gregs, int regnum) - { -- char *regs = gregs; -+ char *regs = (char *) gregs; - int i; - - for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++) -@@ -83,7 +83,7 @@ mips64obsd_fetch_inferior_registers (struct target_ops - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -99,13 +99,13 @@ mips64obsd_store_inferior_registers (struct target_ops - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - - mips64obsd_collect_gregset (regcache, ®s, regnum); - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't write registers")); - } Index: patches/patch-gdb_ppc-obsd-nat_c =================================================================== RCS file: patches/patch-gdb_ppc-obsd-nat_c diff -N patches/patch-gdb_ppc-obsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_ppc-obsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: gdb/ppc-obsd-nat.c +--- gdb/ppc-obsd-nat.c.orig ++++ gdb/ppc-obsd-nat.c +@@ -75,7 +75,7 @@ ppcobsd_fetch_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) + { + struct reg regs; +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); +@@ -110,7 +110,7 @@ ppcobsd_store_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) + { + struct reg regs; +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) + perror_with_name (_("Couldn't get registers")); Index: patches/patch-gdb_ppcobsd-nat_c =================================================================== RCS file: patches/patch-gdb_ppcobsd-nat_c diff -N patches/patch-gdb_ppcobsd-nat_c --- patches/patch-gdb_ppcobsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,56 +0,0 @@ -$OpenBSD: patch-gdb_ppcobsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/ppcobsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/ppcobsd-nat.c Sat May 14 22:54:35 2016 -@@ -76,7 +76,7 @@ ppcobsd_fetch_registers (struct target_ops *ops, - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -93,7 +93,7 @@ ppcobsd_fetch_registers (struct target_ops *ops, - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - -@@ -112,7 +112,7 @@ ppcobsd_store_registers (struct target_ops *ops, - { - struct reg regs; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -123,7 +123,7 @@ ppcobsd_store_registers (struct target_ops *ops, - regnum, ®s, sizeof regs); - #endif - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't write registers")); - -@@ -133,14 +133,14 @@ ppcobsd_store_registers (struct target_ops *ops, - { - struct fpreg fpregs; - -- if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); - - ppc_collect_fpregset (&ppcobsd_fpregset, regcache, - regnum, &fpregs, sizeof fpregs); - -- if (ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't write floating point status")); - } Index: patches/patch-gdb_sh-nbsd-nat_c =================================================================== RCS file: patches/patch-gdb_sh-nbsd-nat_c diff -N patches/patch-gdb_sh-nbsd-nat_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_sh-nbsd-nat_c 9 Feb 2018 20:22:45 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: gdb/sh-nbsd-nat.c +--- gdb/sh-nbsd-nat.c.orig ++++ gdb/sh-nbsd-nat.c +@@ -45,7 +45,7 @@ static void + shnbsd_fetch_inferior_registers (struct target_ops *ops, + struct regcache *regcache, int regno) + { +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) + { +@@ -68,7 +68,7 @@ static void + shnbsd_store_inferior_registers (struct target_ops *ops, + struct regcache *regcache, int regno) + { +- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); ++ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + + if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) + { Index: patches/patch-gdb_shnbsd-nat_c =================================================================== RCS file: patches/patch-gdb_shnbsd-nat_c diff -N patches/patch-gdb_shnbsd-nat_c --- patches/patch-gdb_shnbsd-nat_c 3 Sep 2016 13:48:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -$OpenBSD: patch-gdb_shnbsd-nat_c,v 1.1 2016/09/03 13:48:39 jca Exp $ ---- gdb/shnbsd-nat.c.orig Wed Feb 10 04:19:39 2016 -+++ gdb/shnbsd-nat.c Sat May 14 22:54:35 2016 -@@ -49,7 +49,7 @@ shnbsd_fetch_inferior_registers (struct target_ops *op - { - struct reg inferior_registers; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -70,7 +70,7 @@ shnbsd_store_inferior_registers (struct target_ops *op - { - struct reg inferior_registers; - -- if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) - perror_with_name (_("Couldn't get registers")); - -@@ -78,7 +78,7 @@ shnbsd_store_inferior_registers (struct target_ops *op - (char *) &inferior_registers, - SHNBSD_SIZEOF_GREGS); - -- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), -+ if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) - perror_with_name (_("Couldn't set registers")); -