Index: head/devel/gdb/Makefile =================================================================== --- head/devel/gdb/Makefile (revision 410228) +++ head/devel/gdb/Makefile (revision 410229) @@ -1,131 +1,131 @@ # Created by: Steven Kreuzer # $FreeBSD$ PORTNAME= gdb PORTVERSION= 7.10 PORTREVISION= 5 CATEGORIES= devel MASTER_SITES= GNU MAINTAINER= luca.pizzamiglio@gmail.com COMMENT= GNU GDB of newer version than comes with the system LICENSE= GPLv3 TEST_DEPENDS= runtest:${PORTSDIR}/misc/dejagnu TEST_TARGET= check USES= cpe iconv gmake libtool tar:xz USE_CSTD= gnu89 CPE_VENDOR= gnu GNU_CONFIGURE= yes CONFIGURE_ENV= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \ --enable-targets=all --enable-64-bit-bfd \ --with-gdb-datadir=${PREFIX}/share/gdb${PORTVERSION:S/.//g} \ --with-separate-debug-dir=/usr/lib/debug \ ${ICONV_CONFIGURE_ARG} \ --without-libunwind-ia64 CFLAGS:= ${CFLAGS:C/ +$//} # blanks at EOL creep in sometimes CFLAGS+= -DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable EXCLUDE= dejagnu expect sim texinfo intl EXTRACT_AFTER_ARGS= ${EXCLUDE:S/^/--exclude /} VER= ${PORTVERSION:S/.//g} PLIST_SUB= VER=${VER} -ONLY_FOR_ARCHS= i386 amd64 powerpc powerpc64 # untested elsewhere, might work +ONLY_FOR_ARCHS= i386 amd64 powerpc powerpc64 armv6 # untested elsewhere, might work OPTIONS_DEFINE= DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON THREADS TUI OPTIONS_DEFAULT= GDB_LINK KGDB THREADS TUI PORT_READLINE OPTIONS_SINGLE= READLINE OPTIONS_SINGLE_READLINE= BASE_READLINE BUNDLED_READLINE PORT_READLINE GDB_LINK_DESC= Create ${PREFIX}/bin/gdb symlink KGDB_DESC= Kernel Debugging Support BASE_READLINE_DESC= from base system (experimental) BUNDLED_READLINE_DESC= from gdb distfile PORT_READLINE_DESC= from devel/readline port TUI_DESC= Text User Interface enabled OPTIONS_SUB= yes BASE_READLINE_USES= readline BASE_READLINE_CFLAGS= -D_rl_echoing_p=readline_echoing_p BUNDLED_READLINE_CONFIGURE_OFF= --with-system-readline DEBUG_CFLAGS= -g EXPAT_CONFIGURE_WITH= expat EXPAT_LIB_DEPENDS= libexpat.so:${PORTSDIR}/textproc/expat2 GUILE_CONFIGURE_WITH= guile GUILE_USES= pkgconfig GUILE_LIB_DEPENDS= libguile-2.0.so:${PORTSDIR}/lang/guile2 PORT_READLINE_USES= readline:port PYTHON_CONFIGURE_ON= --with-python=${PYTHON_CMD} PYTHON_CONFIGURE_OFF= --without-python PYTHON_USES= python:2 TUI_CONFIGURE_ENABLE= tui .include .if ! ${PORT_OPTIONS:MBUNDLED_READLINE} EXCLUDE+= readline .endif .if ${ARCH} == "amd64" CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} .endif post-patch: @${REINPLACE_CMD} -e 's|$$| [GDB v${PORTVERSION} for FreeBSD]|' \ ${WRKSRC}/gdb/version.in .if ${PORT_OPTIONS:MTHREADS} @${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb/ @${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-threads .endif .if ${PORT_OPTIONS:MKGDB} @${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/ @${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb .if ${PORT_OPTIONS:MTHREADS} @${PATCH} ${PATCH_ARGS} < \ ${FILESDIR}/extrapatch-kgdb-configure.tgt-threads .else @${PATCH} ${PATCH_ARGS} < \ ${FILESDIR}/extrapatch-kgdb-configure.tgt-plain .endif .endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ ${STAGEDIR}${PREFIX}/bin/gdb${VER} ${INSTALL_MAN} ${WRKSRC}/gdb/doc/gdb.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1/gdb${VER}.1 do-install-KGDB-on: ${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \ ${STAGEDIR}${PREFIX}/bin/kgdb${VER} do-install-TUI-on: ${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER} do-install-GDB_LINK-on: ${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb .if ${PORT_OPTIONS:MKGDB} ${LN} -sf kgdb${VER} ${STAGEDIR}${PREFIX}/bin/kgdb .endif do-install-PYTHON-on: (cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python ) (cd ${WRKSRC}/gdb/data-directory ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python ) . for f in gdb gdb/command gdb/function @(cd ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/${f} ; ${CHMOD} 644 *.py* ) . endfor do-install-GUILE-on: (cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile ) (cd ${WRKSRC}/gdb/data-directory ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile ) .include Index: head/devel/gdb/files/patch-armfbsd =================================================================== --- head/devel/gdb/files/patch-armfbsd (nonexistent) +++ head/devel/gdb/files/patch-armfbsd (revision 410229) @@ -0,0 +1,366 @@ +diff --git gdb/armfbsd-nat.c gdb/armfbsd-nat.c +new file mode 100644 +index 0000000..b883411 +--- /dev/null ++++ gdb/armfbsd-nat.c +@@ -0,0 +1,215 @@ ++/* Native-dependent code for BSD Unix running on ARM's, for GDB. ++ ++ Copyright (C) 1988-2015 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include "defs.h" ++#include "gdbcore.h" ++#include "inferior.h" ++#include "regcache.h" ++#include "target.h" ++#include "gregset.h" ++#include ++#include ++#include ++#include ++ ++#include "fbsd-nat.h" ++#include "arm-tdep.h" ++#include "inf-ptrace.h" ++ ++extern int arm_apcs_32; ++ ++static pid_t ++ptrace_pid (ptid_t ptid) ++{ ++ pid_t pid; ++ ++#ifdef __FreeBSD__ ++ pid = ptid_get_lwp (ptid); ++ if (pid == 0) ++#endif ++ pid = ptid_get_pid (ptid); ++ return pid; ++} ++ ++static void ++arm_supply_gregset (struct regcache *regcache, const gregset_t *gregset, int regnum) ++{ ++ int r; ++ CORE_ADDR r_pc; ++ ++ /* Integer registers. */ ++ for (r = ARM_A1_REGNUM; r < ARM_SP_REGNUM; r++) ++ if ((r == regnum) || (regnum == -1)) ++ regcache_raw_supply (regcache, r, (char *) &gregset->r[r]); ++ ++ if ((regnum == ARM_SP_REGNUM) || (regnum == -1)) ++ regcache_raw_supply (regcache, ARM_SP_REGNUM, ++ (char *) &gregset->r_sp); ++ if ((regnum == ARM_LR_REGNUM) || (regnum == -1)) ++ regcache_raw_supply (regcache, ARM_LR_REGNUM, ++ (char *) &gregset->r_lr); ++ /* This is ok: we're running native... */ ++ if ((regnum == ARM_PC_REGNUM) || (regnum == -1)) ++ { ++ r_pc = gdbarch_addr_bits_remove (get_regcache_arch (regcache), gregset->r_pc); ++ regcache_raw_supply (regcache, ARM_PC_REGNUM, (char *) &r_pc); ++ } ++ ++ if ((regnum == ARM_PS_REGNUM) || (regnum == -1)) ++ { ++ if (arm_apcs_32) ++ regcache_raw_supply (regcache, ARM_PS_REGNUM, ++ (char *) &gregset->r_cpsr); ++ else ++ regcache_raw_supply (regcache, ARM_PS_REGNUM, ++ (char *) &gregset->r_pc); ++ } ++} ++ ++static void ++armbsd_collect_gregset (const struct regcache *regcache, gregset_t *gregset, int regnum) ++{ ++ int ret; ++ int r; ++ ++ for (r = ARM_A1_REGNUM; r < ARM_SP_REGNUM; r++) ++ if ((regnum == r) || (regnum == -1)) ++ regcache_raw_collect (regcache, r, ++ (char *) &gregset->r[r]); ++ ++ if ((regnum == ARM_SP_REGNUM) || (regnum == -1)) ++ regcache_raw_collect (regcache, ARM_SP_REGNUM, ++ (char *) &gregset->r_sp); ++ if ((regnum == ARM_LR_REGNUM) || (regnum == -1)) ++ regcache_raw_collect (regcache, ARM_LR_REGNUM, ++ (char *) &gregset->r_lr); ++ ++ ++ if ((regnum == ARM_PC_REGNUM) || (regnum == -1)) ++ regcache_raw_collect (regcache, ARM_PC_REGNUM, ++ (char *) &gregset->r_pc); ++ if ((regnum == ARM_PS_REGNUM) || (regnum == -1)) ++ { ++ if (arm_apcs_32) ++ { ++ regcache_raw_collect (regcache, ARM_PS_REGNUM, ++ (char *) &gregset->r_cpsr); ++ } ++ else ++ { ++ unsigned psr_val; ++ ++ regcache_raw_collect (regcache, ARM_PS_REGNUM, ++ (char *) &psr_val); ++ ++ psr_val ^= gdbarch_addr_bits_remove (get_regcache_arch (regcache), psr_val); ++ gregset->r_pc = gdbarch_addr_bits_remove ++ (get_regcache_arch (regcache), gregset->r_pc); ++ gregset->r_pc |= psr_val; ++ } ++ } ++} ++ ++/* Fill GDB's register array with the general-purpose register values ++ in *GREGSETP. */ ++ ++void ++supply_gregset (struct regcache *regcache, const gregset_t *gregsetp) ++{ ++ arm_supply_gregset (regcache, gregsetp, -1); ++} ++ ++/* Fill register REGNUM (if it is a general-purpose register) in ++ *GREGSETPS with the value in GDB's register array. If REGNUM is -1, ++ do this for all registers. */ ++ ++void ++fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regnum) ++{ ++ armbsd_collect_gregset (regcache, gregsetp, regnum); ++} ++ ++/* Fill GDB's register array with the floating-point register values ++ in *FPREGSETP. */ ++ ++void ++supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) ++{ ++} ++ ++/* Fill register REGNUM (if it is a floating-point register) in ++ *FPREGSETP with the value in GDB's register array. If REGNUM is -1, ++ do this for all registers. */ ++ ++void ++fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regnum) ++{ ++} ++ ++/* Fetch register REGNO from the child process. If REGNO is -1, do it ++ for all registers. */ ++ ++static void ++armfbsd_fetch_inferior_registers (struct target_ops *ops, ++ struct regcache *regcache, int regno) ++{ ++ gdb_gregset_t regs; ++ ++ if (ptrace (PT_GETREGS, ptrace_pid (inferior_ptid), ++ (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't get registers")); ++ ++ arm_supply_gregset (regcache, ®s, regno); ++ /* TODO: fpregs */ ++} ++ ++/* Store register REGNO back into the child process. If REGNO is -1, ++ do this for all registers. */ ++ ++static void ++armfbsd_store_inferior_registers (struct target_ops *ops, ++ struct regcache *regcache, int regno) ++{ ++ gdb_gregset_t regs; ++ ++ if (ptrace (PT_GETREGS, ptrace_pid (inferior_ptid), ++ (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't get registers")); ++ ++ fill_gregset (regcache, ®s, regno); ++ ++ if (ptrace (PT_SETREGS, ptrace_pid (inferior_ptid), ++ (PTRACE_TYPE_ARG3) ®s, 0) == -1) ++ perror_with_name (_("Couldn't write registers")); ++ /* TODO: FP regs */ ++} ++ ++void _initialize_armfbsd_nat (void); ++ ++void ++_initialize_armfbsd_nat (void) ++{ ++ struct target_ops *t; ++ ++ /* Add in local overrides. */ ++ t = inf_ptrace_target (); ++ t->to_fetch_registers = armfbsd_fetch_inferior_registers; ++ t->to_store_registers = armfbsd_store_inferior_registers; ++ fbsd_nat_add_target (t); ++} +diff --git gdb/armfbsd-tdep.c gdb/armfbsd-tdep.c +new file mode 100644 +index 0000000..f58c323 +--- /dev/null ++++ gdb/armfbsd-tdep.c +@@ -0,0 +1,109 @@ ++/* Target-dependent code for PowerPC systems running FreeBSD. ++ ++ Copyright (C) 2013-2015 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include "defs.h" ++#include "arch-utils.h" ++#include "frame.h" ++#include "gdbcore.h" ++#include "frame-unwind.h" ++#include "gdbtypes.h" ++#include "osabi.h" ++#include "regcache.h" ++#include "regset.h" ++#include "symtab.h" ++#include "target.h" ++#include "trad-frame.h" ++ ++#include "arm-tdep.h" ++#include "solib-svr4.h" ++ ++/* Description of the longjmp buffer. */ ++#define ARM_FBSD_JB_PC 24 ++#define ARM_FBSD_JB_ELEMENT_SIZE INT_REGISTER_SIZE ++ ++/* For compatibility with previous implemenations of GDB on arm/FreeBSD, ++ override the default little-endian breakpoint. */ ++static const gdb_byte arm_fbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6}; ++static const gdb_byte arm_fbsd_arm_be_breakpoint[] = {0xe6, 0x00, 0x00, 0x11}; ++static const gdb_byte arm_fbsd_thumb_le_breakpoint[] = {0xfe, 0xde}; ++static const gdb_byte arm_fbsd_thumb_be_breakpoint[] = {0xde, 0xfe}; ++ ++static void ++arm_freebsd_init_abi_common (struct gdbarch_info info, ++ struct gdbarch *gdbarch) ++{ ++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); ++ ++ tdep->lowest_pc = 0x8000; ++ switch (info.byte_order) ++ { ++ case BFD_ENDIAN_LITTLE: ++ tdep->arm_breakpoint = arm_fbsd_arm_le_breakpoint; ++ tdep->thumb_breakpoint = arm_fbsd_thumb_le_breakpoint; ++ tdep->arm_breakpoint_size = sizeof (arm_fbsd_arm_le_breakpoint); ++ tdep->thumb_breakpoint_size = sizeof (arm_fbsd_thumb_le_breakpoint); ++ break; ++ ++ case BFD_ENDIAN_BIG: ++ tdep->arm_breakpoint = arm_fbsd_arm_be_breakpoint; ++ tdep->thumb_breakpoint = arm_fbsd_thumb_be_breakpoint; ++ tdep->arm_breakpoint_size = sizeof (arm_fbsd_arm_be_breakpoint); ++ tdep->thumb_breakpoint_size = sizeof (arm_fbsd_thumb_be_breakpoint); ++ break; ++ ++ default: ++ internal_error (__FILE__, __LINE__, ++ _("arm_gdbarch_init: bad byte order for float format")); ++ } ++ ++ tdep->jb_pc = ARM_FBSD_JB_PC; ++ tdep->jb_elt_size = ARM_FBSD_JB_ELEMENT_SIZE; ++ ++ /* Single stepping. */ ++ set_gdbarch_software_single_step (gdbarch, arm_software_single_step); ++} ++ ++static void ++arm_freebsd_elf_init_abi (struct gdbarch_info info, ++ struct gdbarch *gdbarch) ++{ ++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); ++ ++ arm_freebsd_init_abi_common (info, gdbarch); ++ if (tdep->fp_model == ARM_FLOAT_AUTO) ++ tdep->fp_model = ARM_FLOAT_SOFT_VFP; ++ ++ /* NetBSD ELF uses SVR4-style shared libraries. */ ++ set_solib_svr4_fetch_link_map_offsets ++ (gdbarch, svr4_ilp32_fetch_link_map_offsets); ++} ++ ++ ++ ++/* Provide a prototype to silence -Wmissing-prototypes. */ ++ ++void _initialize_armfbsd_tdep (void); ++ ++void ++_initialize_armfbsd_tdep (void) ++{ ++ ++ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_FREEBSD_ELF, ++ arm_freebsd_elf_init_abi); ++} +diff --git gdb/config/arm/fbsd.mh gdb/config/arm/fbsd.mh +new file mode 100644 +index 0000000..0a2d8b1 +--- /dev/null ++++ gdb/config/arm/fbsd.mh +@@ -0,0 +1,3 @@ ++# Host: FreeBSD/arm ++NATDEPFILES= armfbsd-nat.o fbsd-nat.o fork-child.o inf-ptrace.o ++HAVE_NATIVE_GCORE_HOST = 1 +diff --git gdb/Makefile.in gdb/Makefile.in +index dfaa8a3..ddad28d 100644 +--- gdb/Makefile.in ++++ gdb/Makefile.in +@@ -655,7 +655,7 @@ ALL_64_TARGET_OBS = \ + # All other target-dependent objects files (used with --enable-targets=all). + ALL_TARGET_OBS = \ + armbsd-tdep.o arm-linux-tdep.o arm-symbian-tdep.o \ +- armnbsd-tdep.o armobsd-tdep.o \ ++ armnbsd-tdep.o armobsd-tdep.o armfbsd-tdep.o \ + arm-tdep.o arm-wince-tdep.o \ + avr-tdep.o \ + bfin-linux-tdep.o bfin-tdep.o \ +@@ -1660,6 +1660,6 @@ ALLDEPFILES = \ + amd64-linux-nat.c amd64-linux-tdep.c \ + amd64-sol2-tdep.c \ + arm-linux-nat.c arm-linux-tdep.c arm-symbian-tdep.c arm-tdep.c \ +- armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \ ++ armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c armfbsd-tdep.c \ + avr-tdep.c \ + bfin-linux-tdep.c bfin-tdep.c \ Property changes on: head/devel/gdb/files/patch-armfbsd ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/gdb/files/patch-gdb-configure.host =================================================================== --- head/devel/gdb/files/patch-gdb-configure.host (nonexistent) +++ head/devel/gdb/files/patch-gdb-configure.host (revision 410229) @@ -0,0 +1,12 @@ +diff --git gdb/configure.host gdb/configure.host +index 48714f4..53989d3 100644 +--- gdb/configure.host ++++ gdb/configure.host +@@ -90,6 +90,7 @@ alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) + gdb_host=nbsd ;; + alpha*-*-openbsd*) gdb_host=nbsd ;; + ++arm*-*-freebsd*) gdb_host=fbsd ;; + arm*-*-linux*) gdb_host=linux ;; + arm*-*-netbsdelf* | arm*-*-knetbsd*-gnu) + gdb_host=nbsdelf ;; Property changes on: head/devel/gdb/files/patch-gdb-configure.host ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property