debian/0000755000000000000000000000000012301105145007156 5ustar debian/gdb-multiarch.postinst0000755000000000000000000000044212165767700013533 0ustar #!/bin/sh set -e # Replace documentation directory with symlink if [ -d /usr/share/doc/gdb-multiarch ] && [ ! -L /usr/share/doc/gdb-multiarch ]; then if rmdir /usr/share/doc/gdb-multiarch 2>/dev/null; then ln -sf gdb /usr/share/doc/gdb-multiarch fi fi #DEBHELPER# exit 0 debian/sanitize-gdb.sh0000644000000000000000000000443212165767700012120 0ustar #!/bin/bash set -e tarball=$1 if ! test -f "$tarball"; then echo "Could not open $tarball" exit 1 fi tardir=$(dirname "$tarball") tardir=$(cd "$tardir" && pwd) version=$(basename "$tarball" | sed "s/^gdb-//; s/\.tar\.bz2\$//") debversion=${version} tarball="$tardir"/gdb-$version.tar.bz2 dfsg="$tardir/gdb_$debversion.orig.tar.gz" doc="$tardir/gdb-doc_$version.orig.tar.gz" dir=`cd $(dirname "$0") && pwd` temp=$(mktemp -d) olddir=`pwd` cd "$temp" mkdir src cd src tar xjf "$tarball" cd .. src=src/gdb-$version dest=gdb-$debversion dest2=gdb-doc-$version if ! test -d "$src"; then echo "Could not find source directory $src" exit 1 fi if test -z "$dest" || test -e "$dest"; then echo "Could not create dest directory $dest" exit 1 fi if test -z "$dest2" || test -e "$dest2"; then echo "Could not create dest directory $dest2" exit 1 fi src=`cd "$src" && pwd` cp -a "$src" "$dest" pushd "$dest" > /dev/null # The GDB manual pages are not covered by the GFDL, but the simulator's # is. echo > sim/common/run.1 # Almost all of the texinfo documentation is GFDL. PSIM's is not, but # we don't need that manual especially anyway. Special care must be taken # with observer.texi, which is necessary for the build process. Remove # all pregenerated info files, then replace all texinfo files with dummy # versions. rm -f $(find . \( -name \*.info -o -name \*.info-\* \)) for f in $(find . \( -name \*.texinfo -o -name \*.texi \)); do if test $(basename $f) = observer.texi; then sed -ne '/@c This/,/@c any later/p; /@deftype/p' "$src/$f" > $f continue fi echo > "$f" done popd > /dev/null mkdir "$dest2" mkdir "$dest2"/readline cp -a "$src"/readline/doc "$dest2"/readline/doc mkdir "$dest2"/gdb cp -a "$src"/gdb/doc "$dest2"/gdb/doc cp -a "$src"/config "$dest2"/config # Supporting files. cp -a "$src"/COPYING* "$dest2/" cp -a "$src"/ChangeLog "$dest2/" cp -a "$src"/MAINTAINERS "$dest2/" cp -a "$src"/README* "$dest2/" cp -a "$src"/config.guess "$dest2/" cp -a "$src"/config.sub "$dest2/" cp -a "$src"/install-sh "$dest2/" cp -a "$src"/mkinstalldirs "$dest2/" cp -a "$src"/gdb/.gitignore "$dest2"/gdb/ cp -a "$src"/gdb/version.in "$dest2"/gdb/ cp -a "$src"/readline/[A-Z]* "$dest2"/readline/ tar czf "$dfsg" gdb-$debversion tar czf "$doc" gdb-doc-$version cd "$olddir" rm -rf $temp debian/control.in0000644000000000000000000001155712253041351011203 0ustar Source: gdb Maintainer: Ubuntu Core developers XSBC-Original-Maintainer: Héctor Orón Martínez Uploaders: Luca Bruno , Samuel Bronson Section: devel Priority: optional Standards-Version: 3.9.4 Build-Depends: # Packaging deps cdbs (>= 0.4.17), debhelper (>= 7.0.50), lsb-release, bzip2, # Other tool deps autoconf, libtool, gettext, bison, dejagnu, flex | flex-old, procps, g++-multilib [i386 powerpc s390 sparc], gcj-jdk | gcj, gobjc, mig [hurd-any], # TeX[info] deps texinfo (>= 4.7-2.2), texlive-base, # Libdev deps libexpat1-dev, lib64expat1-dev [i386 powerpc s390 sparc], libncurses5-dev, lib64ncurses5-dev [i386 powerpc s390 sparc], libreadline-dev, lib64readline6-dev [i386 powerpc s390 sparc], zlib1g-dev, libbz2-dev, liblzma-dev, libpython3-dev, libkvm-dev [kfreebsd-any], libunwind7-dev [ia64], Vcs-Git: git://anonscm.debian.org/crosstoolchain/gdb.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=crosstoolchain/gdb.git Homepage: http://www.gnu.org/s/gdb/ Package: gdb@TS@ Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, ${shlibs:Depends}, libpython3-stdlib Recommends: libc-dbg, python3 Suggests: gdb-doc, gdbserver [amd64 armel armhf arm64 i386 ia64 m32r m68k mips mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x x32] Description: GNU Debugger GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. Package: gdb-minimal Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: gdb Description: GNU Debugger (minimal version) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a minimal version of GDB with optional features disabled. Package: gdb64 Architecture: i386 powerpc s390 sparc Replaces: gdb-multiarch (<< 7.6-1) Depends: gdb (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: GNU Debugger (64-bit) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a version of GDB compiled for a 64-bit variant of its architecture. Package: gdb-multiarch Architecture: any Depends: gdb (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: GNU Debugger (with support for multiple architectures) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a version of GDB which supports multiple target architectures. Package: gdbserver Architecture: amd64 armel armhf arm64 i386 ia64 m32r m68k mips mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x x32 Depends: ${misc:Depends}, ${shlibs:Depends} Replaces: gdb (<< 7.0.1-1) Description: GNU Debugger (remote server) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains gdbserver. Install this to debug remotely from another system where GDB is installed. Package: gdb-source Architecture: all Depends: ${misc:Depends} Description: GNU Debugger (source) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains the sources and patches which are needed to build GDB. debian/gdb.install0000644000000000000000000000006312165767700011324 0ustar usr/bin/gdb usr/share/gdb usr/share/man/man1/gdb.1 debian/gdb-minimal.manpages0000644000000000000000000000006312253044355013065 0ustar debian/tmp/usr/share/man/man1/gdb.1 debian/gcore.1 debian/copyright0000644000000000000000000000236212165767700011137 0ustar This is the Debian GNU/Linux packaged version of the GNU debugger, GDB. Earlier versions of this package were assembled by David Engel , Stuart Lamble , and others. GDB is Copyright (C) 2008 Free Software Foundation, Inc. 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 . On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses'. The file `gdb/doc/observer.texi' is normally distributed under the GNU Free Documentation License, but certain lines from it are also permitted to be distributed under the GPL. Only those lines are included in this package. debian/gdb64.lintian-overrides0000644000000000000000000000014712165767700013471 0ustar # Yes, this is *supposed* to be from another architecture binary-from-other-architecture usr/bin/gdb64 debian/changelog.old0000644000000000000000000000022712165767700011631 0ustar gdb (4.16-1) unstable; urgency=low * Updated to new upstream version (Bug#4373) * Added a simple extended description (Bug#3599) -- David Engel debian/gdb64.postinst0000755000000000000000000000040212165767700011713 0ustar #!/bin/sh set -e # Replace documentation directory with symlink if [ -d /usr/share/doc/gdb64 ] && [ ! -L /usr/share/doc/gdb64 ]; then if rmdir /usr/share/doc/gdb64 2>/dev/null; then ln -sf gdb /usr/share/doc/gdb64 fi fi #DEBHELPER# exit 0 debian/changelog0000644000000000000000000021752212301105144011040 0ustar gdb (7.7-0ubuntu3) trusty; urgency=medium * Rebuild with Python 3.4. -- Matthias Klose Wed, 19 Feb 2014 11:41:03 +0100 gdb (7.7-0ubuntu2) trusty; urgency=medium * Don't encode the distribution name into the version string. -- Matthias Klose Sat, 08 Feb 2014 20:23:43 +0100 gdb (7.7-0ubuntu1) trusty; urgency=medium * GDB 7.7 release. -- Matthias Klose Fri, 07 Feb 2014 18:59:59 +0100 gdb (7.6.50.20140106-0ubuntu1) trusty; urgency=medium * New upstream snapshot. -- Matthias Klose Mon, 06 Jan 2014 11:01:33 +0100 gdb (7.6.50.20131218-0ubuntu1) trusty; urgency=medium * New upstream snapshot. * Configure with --disable-werror. * Handle Debian's local elf.h / sys/auxv.h header reorganization. -- Matthias Klose Wed, 18 Dec 2013 13:50:41 +0100 gdb (7.6.50.20131214-0ubuntu1) trusty; urgency=medium * New upstream snapshot. -- Matthias Klose Sat, 14 Dec 2013 12:31:29 +0100 gdb (7.6-5ubuntu2) saucy; urgency=low * Re-apply changes dropped in last merge: - gdb suggest gdbserver, instead of depending on it. - gdb depends on libpython3-stdlib. -- Matthias Klose Tue, 30 Jul 2013 09:24:29 +0200 gdb (7.6-5ubuntu1) saucy; urgency=low * Merge with Debian; remaining changes: - Add Multi-arch: allowed field to gdb. - gdb-strings.patch: Fix typo in gdb/remote.c. - ptrace-error-verbosity.patch: Try to make the PTRACE scope sysctl more discoverable via a verbose error message when failures happen. * Build using python3, recommend python3. -- Matthias Klose Sun, 28 Jul 2013 10:55:50 +0200 gdb (7.6-5) unstable; urgency=low [ Samuel Bronson ] * d/control{,.in}: revert to B-D on libunwind7-dev [ia64]. -- Héctor Orón Martínez Sat, 06 Jul 2013 12:17:24 +0200 gdb (7.6-4) unstable; urgency=low [ Samuel Bronson ] * d/rules: Exclude .git from gdb-source package. * d/control{,.in}: Bump ia64 B-D to libunwind8-dev for transition. * d/NEWS: Fix version number so lintian will shut up about it. * d/patches: - Remove no-longer-used patches: + 0000-tui-skip-registers-pr-tui-13073.patch: Old Backport + 0001-netbsd-init-match-property-field.patch: Old Backport + 0002-add-cpu-to-source-release.patch: Old Backport + m68k-thread-debugging.patch: Old Backport or Merged Upstream + gdbinit-ownership.patch: handled differently upstream + member-field-symtab.patch: the patched code disappeared - Drop patches for problems that have gone away: + dwarf2-cfi-warning.patch: I'm not seeing any spam without this. + linux-clear-thread-list.patch: #303736 is gone even without this. - Add/reformat metadata: + gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + solve_PATH_MAX_issue.patch + linuxthreads_signal_handling.patch * d/control{,.in}: Reformat relationship fields. * d/rules: - Allow gdb-minimal to use expat. - Get hardening flags working. - Explicitly configure gdb64 --with-expat. - s/--with-libunwind/--with-libunwind-ia64/; the former is depracated. - Make gdb --version report exact package version much as gcc --version does. * Build gdbserver on arm64. * Avoid identical short or long descriptions between packages. * Remove stray "The" from short descriptions. [ Hector Oron ] * d/p/upstream-print_insn_rl78-workaround.patch + Fix "FTBFS: gdb compile failed" (Closes: #713735) -- Hector Oron Wed, 26 Jun 2013 02:59:24 +0200 gdb (7.6-3) unstable; urgency=low [ Héctor Orón Martínez ] * d/gbp.conf: - switch debian-branch to master * d/control{,.in}: - add replaces gdb-multiarch (<< 7.6-1). (Closes: #709232) * d/p/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch: - fix refuses to print errno. (Closes: #581707) [ Svante Signell ] * d/p/solve_PATH_MAX_issue.patch: new patch fixes FTBFS on hurd. (Closes: #709508) [ Samuel Bronson ] * debian/rules: Don't abort test suite on "ulimit -c unlimited" failure; do abort building early on failure to invoke the test suite. -- Héctor Orón Martínez Fri, 24 May 2013 10:09:03 +0200 gdb (7.6-2) unstable; urgency=low * Fix truncated maintainer field. (Closes: #709118) * d/control{,.in}: link 64-bit arch against expat. -- Hector Oron Tue, 21 May 2013 12:58:01 +0200 gdb (7.6-1) unstable; urgency=low * Imported Upstream version 7.6 * New upstream features: - GDB 7.6 brings new targets, features and improvements, including: * New native configurations: ARM AArch64 GNU/Linux aarch64*-*-linux-gnu FreeBSD/powerpc powerpc*-*-freebsd x86_64/Cygwin x86_64-*-cygwin* Tilera TILE-Gx GNU/Linux tilegx*-*-linux-gnu * New target configurations: ARM AArch64 aarch64*-*-elf ARM AArch64 GNU/Linux aarch64*-*-linux Lynx 178 PowerPC powerpc-*-lynx*178 x86_64/Cygwin x86_64-*-cygwin* Tilera TILE-Gx GNU/Linux tilegx*-*-linux * New configure options: -enable-libmcheck/--disable-libmcheck * Support for the "mini debuginfo" section, .gnu_debugdata * The C++ ABI now defaults to the GNU v3 ABI. This has been the default for GCC since November 2000. * New command line option: -nh (disables auto-loading of ~/.gdbinit) * Various GDB/MI changes * Python scripting: ** Vectors can be created with gdb.Type.vector. ** Python's atexit.register now works in GDB. ** Types can be pretty-printed via a Python API. ** Python 3 is now supported (in addition to Python 2.4 or later) ** New class gdb.Architecture exposes GDB's internal representation of architecture in the Python API. ** New method Frame.architecture returns the gdb.Architecture object corresponding to the frame's architecture. ** New Python-based convenience functions ($_memeq, $_streq, $_strlen and $_regex) * The 'cd' command now defaults to using '~' (the home directory) if not given an argument. * New commands: ** catch signal ** maint info bfds ** python-interactive ** enable/disable type-printer * New remote packets (QTBuffer:size, Qbtrace:bts, Qbtrace:off and qXfer:btrace:read) * New options: ** set/show print type methods (on|off) ** set/show print type typedefs (on|off) ** set/show filename-display basename|relative|absolute ** set/show trace-buffer-size ** set/show remote trace-buffer-size-packet auto|on|off ** set/show debug aarch64 ** set/show debug coff-pe-read ** set/show debug mach-o ** set/show debug notification * target record: The "target record" command has been renamed to "target record-full", and a new "target record-btrace" has been added. This new target uses hardward support to record the control-flow of a process. Execution replay is not supported, but this targets allows investigating the program's recorded execution. * d/control{,.in}: bump standards version -- Héctor Orón Martínez Sun, 19 May 2013 00:14:02 +0200 gdb (7.6~20130417-0ubuntu1) raring; urgency=low * gdb 7.6 snapshot, taken from the 7.6 release branch. LP: #1166304. * Build again with Python2, not all pretty printers are ready for 3.x. -- Matthias Klose Thu, 18 Apr 2013 00:00:23 +0200 gdb (7.6~20130408-0ubuntu1) raring; urgency=low * gdb 7.6 snapshot, taken from the 7.6 release branch. LP: #1166304. - Adds support for Aarch64. * Build using Python3. -- Matthias Klose Mon, 08 Apr 2013 16:06:17 +0200 gdb (7.5-0ubuntu4) raring; urgency=low * Use python-config to pick up the python version. * Build-depend on libpython-dev, python:any. -- Matthias Klose Thu, 20 Dec 2012 16:21:32 +0100 gdb (7.5-0ubuntu3) raring; urgency=low * Remove excessive fclose in gdbinit patch (LP: #1069897). -- Dr. David Alan Gilbert Sat, 24 Nov 2012 16:54:53 +0000 gdb (7.5-0ubuntu2) quantal; urgency=low [ Mark Russell ] * Add Multi-arch: allowed field to gdb. (LP: #1036834) -- Adam Stokes Thu, 16 Aug 2012 14:29:05 -0400 gdb (7.5-0ubuntu1) quantal; urgency=low * New upstream release 7.5. * Backport fix for PR gdb/14365. LP: #1006860. * Stop building libgdb-dev (libgdb.a not built anymore). -- Matthias Klose Wed, 22 Aug 2012 17:39:32 +0200 gdb (7.4-2012.06-0ubuntu1) quantal; urgency=low * Update to the Linaro 7.4-2012.06 release. -- Matthias Klose Thu, 14 Jun 2012 09:38:38 +0200 gdb (7.4-2012.04-0ubuntu3) quantal; urgency=low * Merge packaging bits from Debian unstable. -- Matthias Klose Tue, 12 Jun 2012 12:56:30 +0200 gdb (7.4.1-1.1) unstable; urgency=low * Non-maintainer upload. * Fix LinuxThreads signal handling on GNU/kFreeBSD. (Closes: #550361, #669043) -- Robert Millan Sat, 12 May 2012 12:25:16 +0200 gdb (7.4.1-1) unstable; urgency=low * New upstream release: - [GDB/MI] Error when resuming program execution in all-stop mode ("Cannot execute this command without a live selected thread"). - [Pascal] Polluted display of class methods parameters. - [target remote] Errror when connecting to remote target where disconnected tracing is in effect. - [AVX] Float and ymm* register values not available. - [GDB] Crash when using the "finish" command. - [build] makeinfo should not be required to build GDB. * d/control: enable gdb-multiarch packages * d/rules: disable simulator for gdb-multiarch builds. -- Hector Oron Thu, 26 Apr 2012 18:26:18 +0200 gdb (7.4-2012.04-0ubuntu2) precise-proposed; urgency=low * debian/control: enabling gdbserver package for armhf (LP: #989153) -- Ricardo Salveti de Araujo Thu, 26 Apr 2012 15:59:49 -0300 gdb (7.4-2012.04-0ubuntu1) precise-proposed; urgency=low * Update to the Linaro 7.4-2012.04 release. LP: #984994. -- Matthias Klose Wed, 18 Apr 2012 17:08:57 +0200 gdb (7.4-2012.02-0ubuntu2) precise; urgency=low * Update and re-enable the gdb-7.2-gcore-relro-writer patch (Steve Beattie). LP: #954714. -- Matthias Klose Fri, 16 Mar 2012 01:32:38 +0100 gdb (7.4-2012.02-0ubuntu1) precise; urgency=low * Update to the Linaro 7.4-2012.02 release. * Disable the gdb-7.2-gcore-relro-writer patch (needs an update). -- Matthias Klose Tue, 13 Mar 2012 20:12:36 +0100 gdb (7.4-0ubuntu1) precise; urgency=low * gdb 7.4 release. -- Matthias Klose Tue, 24 Jan 2012 11:23:25 +0100 gdb (7.3.92-0ubuntu3) precise; urgency=low * Fix PR 9538 (handle debuginfo for symlinked files), taken from the trunk. -- Matthias Klose Tue, 24 Jan 2012 11:08:40 +0100 gdb (7.3.92-0ubuntu2) precise; urgency=low * Build-depend on lib64ncurses5-dev [i386 powerpc s390 sparc]. -- Matthias Klose Sat, 21 Jan 2012 01:45:54 +0100 gdb (7.3.92-0ubuntu1) precise; urgency=low * gdb-7.4 release candidate 2. -- Matthias Klose Fri, 20 Jan 2012 21:26:22 +0100 gdb (7.3.1-2011.12-0ubuntu1) precise; urgency=low * Update to the Linaro 7.3-2011-12 release. -- Matthias Klose Fri, 09 Dec 2011 16:15:50 +0100 gdb (7.3-0ubuntu2) oneiric; urgency=low * Update to the Linaro 7.3-2011-08 release. -- Matthias Klose Thu, 18 Aug 2011 11:00:25 +0200 gdb (7.3-0ubuntu1) oneiric; urgency=low * New upstream release. * Update Linaro changes to 7.3-2011-08~. -- Matthias Klose Mon, 08 Aug 2011 07:45:57 +0200 gdb (7.2-1ubuntu11) natty; urgency=low * Fix minor ARM prologue parsing bug (Ulrich Weigand). LP: #684218. -- Matthias Klose Thu, 24 Mar 2011 10:41:22 +0100 gdb (7.2-1ubuntu10) natty; urgency=low * Update with changes from the Linaro 7.2-2011.03-0 release (Ulrich Weigand). * Configure with --with-pkgversion, don't run post-patches. -- Matthias Klose Tue, 15 Mar 2011 16:14:08 +0100 gdb (7.2-1ubuntu9) natty; urgency=low * Set MULTIARCH_TARGETS similarly to binutils-multiarch to avoid the need for users to specify which actual target they care about. -- Loïc Minier Tue, 08 Mar 2011 14:31:09 +0100 gdb (7.2-1ubuntu8) natty; urgency=low * Add gdb-multiarch package supporting extra bfd targets similarly to binutils-multiarch; the package is constructed much like gdb64 except that it's build with the gdb configure flags and --enable-targets=all for now. * New patch, disable-werror-on-coff-tic, fixes build of coff stuff with gcc-4.5; from upstream mailing-list. -- Loïc Minier Tue, 18 Jan 2011 17:44:56 +0100 gdb (7.2-1ubuntu7) natty; urgency=low * Pass --gdb-datadir=/usr/share/gdb-$triplet when building a cross-gdb and update gdb.install sed snippet to match; fixes conflict with gdb; Debian #603347. -- Loïc Minier Mon, 17 Jan 2011 17:50:20 +0100 gdb (7.2-1ubuntu6) natty; urgency=low * Add support to "gcore" command for executables with GNU_RELRO sections (Debian bug 606667, LP: #680588). -- Kees Cook Thu, 09 Dec 2010 19:47:22 -0800 gdb (7.2-1ubuntu5) natty; urgency=low * Rebuild with python 2.7. -- Matthias Klose Thu, 09 Dec 2010 15:09:43 +0100 gdb (7.2-1ubuntu4) natty; urgency=low * No-change upload to drop upstream changelog. -- Martin Pitt Fri, 03 Dec 2010 08:55:48 +0100 gdb (7.2-1ubuntu3) maverick-proposed; urgency=low * Re-add debian/patches/ptrace-error-verbosity.patch that got accidentally dropped in the 7.2 merge: try to make PTRACE scope sysctl more discoverable (LP: #667815). -- Kees Cook Thu, 28 Oct 2010 07:16:05 -0700 gdb (7.2-1ubuntu2) maverick; urgency=low * Really disable building the gdb-minimal package. -- Matthias Klose Mon, 06 Sep 2010 13:43:20 +0200 gdb (7.2-1ubuntu1) maverick; urgency=low * Merge with Debian; remaining changes: - PIE testsuite support. - Fix some typos in messages. - Don't build the gdb-minimal package. - Install symlink to compressed gdb64 manpage. - Don't install the upstream changelog in gdbserver. -- Matthias Klose Mon, 06 Sep 2010 11:43:18 +0200 gdb (7.2-1) unstable; urgency=low * New upstream release, including: - C++ improvements including argument-dependent lookup, improved user-defined operator support, and static const member evaluation. - Expanded Python API. - Tracepoint improvements, including x86 gdbserver support for tracepoints and static tracepoints. - Observer mode support. You can attach to a program in observer mode and GDB will not allow you to modify the program's state at all. - x86 byte and half-word register names, and 32-bit register named on 64-bit targets. - The "eval" command for the GDB CLI. - "save breakpoints" to save breakpoints between sessions. - Improved hardware breakpoint support for PowerPC. -- Daniel Jacobowitz Sun, 05 Sep 2010 10:05:31 -0400 gdb (7.1-2) unstable; urgency=low * Add sanitize-gdb.sh and README.source to source package (used to create tarballs). * Fix cross-gdb build. Patch from Hector Oron. (Closes: #575923). -- Daniel Jacobowitz Tue, 31 Aug 2010 10:57:57 -0400 gdb (7.1-1ubuntu4) maverick; urgency=low * debian/patches/ptrace-error-verbosity.patch: update for new yama path. -- Kees Cook Tue, 06 Jul 2010 15:26:03 -0700 gdb (7.1-1ubuntu3) maverick; urgency=low * Add debian/patches/ptrace-error-verbosity.patch: try to make PTRACE scope sysctl more discoverable. -- Kees Cook Tue, 08 Jun 2010 15:46:44 -0700 gdb (7.1-1ubuntu2) lucid; urgency=low * Fix TBB TBH decoding in Thumb-2, patch taken from the trunk. -- Matthias Klose Thu, 08 Apr 2010 11:48:33 +0200 gdb (7.1-1ubuntu1) lucid; urgency=low * Merge with Debian; remaining changes: - PIE testsuite support. - Fix some typos in messages. - Don't build the gdb-minimal package. - Install symlink to compressed gdb64 manpage. - Don't install the upstream changelog in gdbserver. -- Matthias Klose Sat, 20 Mar 2010 14:19:26 +0100 gdb (7.1-1) unstable; urgency=low * New upstream release, including: - PIE support (Closes: #346409). - C++ improvements, including static_cast<> et al, namespace imports, and bug fixes in printing virtual base classes. - Multi-program debugging. One GDB can now debug multiple programs at the same time. - Python scripting improvements, including gdb.parse_and_eval. - Updated MIPS Linux signal frame layout (Closes: #570875). - No internal error stepping over _dl_debug_state (Closes: #569551). * Update to Standards-Version: 3.8.4 (no changes required). * Include more relevant (and smaller) docs in the gdbserver package (Closes: #571132). * Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev. * Fix crash when switching into TUI mode (Closes: #568489). -- Daniel Jacobowitz Sat, 20 Mar 2010 01:21:29 -0400 gdb (7.0.90.20100309-0ubuntu2) lucid; urgency=low [ Matthias Klose ] * Snapshot, taken from the 7.1 release branch. * Adjust patches, remove obsolete patches. [ Kees Cook ] * Rebase PIE testsuite, updates patch series. -- Matthias Klose Wed, 10 Mar 2010 01:25:14 +0100 gdb (7.0.1-2ubuntu3) lucid; urgency=low * On ARM, add support for single-stepping through IF-THEN blocks (taken from the trunk). -- Matthias Klose Tue, 09 Mar 2010 15:37:16 +0100 gdb (7.0.1-2ubuntu2) lucid; urgency=low * gdb: Make gdbserver a suggestion instead of a dependency. * gdbserver: Don't install the toplevel upstream changelog. -- Matthias Klose Sat, 27 Feb 2010 10:58:31 +0100 gdb (7.0.1-2ubuntu1) lucid; urgency=low * Merge with Debian; remaining changes: - debian/rules: on sparc, configure the 64bit build with --disable-werror. - Work around a build failure on the ia64 buildd. - PIE support. - Add patch to handle debug_info less frames better. - Fix some typos in messages. - reduce build-id verbosity. - fixup PPC auxv prototype. * Don't build the gdb-minimal package. -- Matthias Klose Tue, 23 Feb 2010 18:27:19 +0100 gdb (7.0.1-2) unstable; urgency=low * Add Replaces to the new gdbserver package (Closes: #567925, #568018). * Add patch to fix FreeBSD build (Closes: #561924). -- Daniel Jacobowitz Tue, 02 Feb 2010 14:59:41 -0500 gdb (7.0.1-1) unstable; urgency=low * New upstream release. * Avoid hardcoded "debian" in the binary using lsb_release (from Matthias Klose). * Use DEB_MAKE_ENVVARS for 64-bit builds also (from Matthias Klose). * Build depend on gcj-jdk | gcj (from Matthias Klose). * Add gdb-source package (Closes: #550755). * Move gdbserver into its own package (Closes: #562651). * Add gdb-minimal package (Closes: #560786). * Update to Standards-Version: 3.8.3. * Package /usr/share/gdb. * Switch to 3.0 (quilt) source package format. -- Daniel Jacobowitz Sat, 30 Jan 2010 15:16:35 -0500 gdb (7.0.1-0ubuntu1) lucid; urgency=low * New upstream version. -- Matthias Klose Thu, 31 Dec 2009 10:07:48 +0100 gdb (7.0-1ubuntu2) lucid; urgency=low * [arm] Prevent disassembler from aborting on an invalid Thumb2 instruction, taken from the trunk. -- Matthias Klose Tue, 15 Dec 2009 14:41:05 +0100 gdb (7.0-1ubuntu1) lucid; urgency=low * Merge with Debian; remaining changes: - debian/rules: on sparc, configure the 64bit build with --disable-werror. - Work around a build failure on the ia64 buildd. - PIE support. - Add patch to handle debug_info less frames better. - Fix some typos in messages. - reduce build-id verbosity. - fixup PPC auxv prototype. * Update to the 7.0 branch 20091120. - Add Thumb2 debugging for armel. -- Matthias Klose Fri, 20 Nov 2009 14:48:57 -0600 gdb (7.0-1) unstable; urgency=low * New upstream release (Closes: #550567). * Order options alphabetically in the man page (Closes: #540811). -- Daniel Jacobowitz Sun, 11 Oct 2009 17:16:26 -0400 gdb (7.0-0ubuntu1) karmic; urgency=low * 7.0 final release. - Fix PR gdb/10649. -- Matthias Klose Fri, 09 Oct 2009 09:27:53 +0200 gdb (6.8.92-0ubuntu1) karmic; urgency=low * 7.0 prerelease 2. -- Matthias Klose Thu, 01 Oct 2009 15:04:44 +0200 gdb (6.8.90.20090918-0ubuntu2) karmic; urgency=low * Update gdb-workaround-rh-stack-off.patch: - reduce build-id verbosity. - fixup PPC auxv prototype. -- Kees Cook Sat, 19 Sep 2009 10:26:41 -0700 gdb (6.8.90.20090918-0ubuntu1) karmic; urgency=low [ Matthias Klose ] * Merge with Debian; remaining changes: - debian/rules: on sparc, configure the 64bit build with --disable-werror. * Update to the 7.0 release branch. [ Kees Cook ] * Add patches to support PIE, thanks to RH's 6.8.91.20090917 branch: - gdb-6.3-test-pie-20050107.patch - gdb-6.5-bz203661-emit-relocs.patch - gdb-workaround-rh-stack-on.patch (workaround lack of Archer, CRC) - gdb-6.6-buildid-locate.patch - gdb-6.3-pie-20050110.patch - gdb-workaround-rh-stack-off.patch (undo workarounds) -- Matthias Klose Sat, 19 Sep 2009 15:38:43 +0000 gdb (6.8.50.20090628-4) unstable; urgency=low * Mention online documentation in README.Debian (Closes: #537795). * Fix GNU/Hurd support (Closes: #539351). * Depend on libreadline-dev and lib64readline6-dev. -- Daniel Jacobowitz Mon, 14 Sep 2009 16:17:50 -0400 gdb (6.8.50.20090628-3) unstable; urgency=low * Remove stray "set -x" from gdbtui script. -- Daniel Jacobowitz Mon, 13 Jul 2009 16:49:41 -0400 gdb (6.8.50.20090628-2) unstable; urgency=low * Re-enable gobjc testing on armel (Closes: #497161). * Do not install an extra copy of the GDB man page in cross-debugger packages (Closes: #492846). * Add i386 %ebp backtrace patch from Michael Matz (Closes: #498030). This improves backtraces on 32-bit programs with missing debug info for some functions on the stack. * Replace the separate gdbtui binary with a shell script (suggested by Matthias Klose). * Support parallel= in DEB_BUILD_OPTIONS (from Matthias Klose). * Support nocheck in DEB_BUILD_OPTIONS (from Matthias Klose). * Run the testsuite on linux-gnueabi and linux-gnulp systems also (from Matthias Klose). * Package the DejaGNU .sum file instead of part of the build log. It's bigger, but more useful (especially with parallel=). -- Daniel Jacobowitz Mon, 06 Jul 2009 14:52:31 -0400 gdb (6.8.50.20090628-1ubuntu3) karmic; urgency=low * Refresh PIE support patches to gain analysis of PIE core files. -- Kees Cook Tue, 14 Jul 2009 13:20:57 -0700 gdb (6.8.50.20090628-1ubuntu2) karmic; urgency=low * Replace the gdbtui binary by a shell script. LP: #244065. * Enable parallel builds. -- Matthias Klose Mon, 06 Jul 2009 13:59:42 +0200 gdb (6.8.50.20090628-1ubuntu1) karmic; urgency=low * Merge with Debian; remaining changes: - debian/rules: on sparc, configure the 64bit build with --disable-werror. - Support nocheck and parallel= in DEB_BUILD_OPTIONS. - lpia fix for running the check target. - Work around a build failure on the ia64 buildd. * Disable patches (not yet updated): pie-support-alt, pie-support-tests, handle-nodebuginfo-better. -- Matthias Klose Mon, 06 Jul 2009 09:51:58 +0200 gdb (6.8.50.20090628-1) unstable; urgency=low * New snapshot from trunk. The experimental packages used the archer-tromey-python branch; the whole branch has not been merged to trunk, but significant portions of it have, and will be in GDB 7. So this includes some Python scripting support. Other highlights since the last experimental package: - Reverse debugging commands. With a remote target that supports reverse debugging, you can step backwards as easily as forwards. - Process record and replay, a native Linux implementation of reverse debugging. Only 32-bit IA32 Linux is currently supported. - MIPS/Linux hardware watchpoint support. - Multi-byte and wide character set support, including wchar_t display. - Inlined function support, including in backtrace and step/next/finish. - Improved C++ template name parsing. - Non-stop debugging (some threads remain running while others are stopped in the debugger). Only implemented so far for i386, x86-64, and powerpc. - A bug fix for discontiguous code, e.g. as found in the Linux kernel (Closes: #513816). - A build fix that affected SPARC (Closes: #512121). - A build fix for casts on hurd-i386 (Closes: #494839). - A fix for debugging multi-threaded programs that call exec, including Eclipse with the Sun JVM (Closes: #490046). * Removed thread-db-multiple-libraries.patch. This let one GDB work with both LinuxThreads and NPTL, but no Debian platform has both now. * GDB now reads /etc/gdb/gdbinit at startup (Closes: #33187). * Ship required libraries (libbfd, libopcodes, and libiberty) in /usr/lib/gdb in the libgdb-dev package, in case binutils-dev's versions are not close enough (Closes: #509873). * Add dev package dependencies to libgdb-dev. -- Daniel Jacobowitz Sun, 05 Jul 2009 16:25:07 -0400 gdb (6.8.50.20090519.python-1) experimental; urgency=low * New snapshot from archer-tromey-python branch. * Update debhelper compatibility level to 7. * Update to Standards-Version: 3.8.1. -- Daniel Jacobowitz Thu, 04 Jun 2009 09:38:13 -0400 gdb (6.8.50.20090116.python-1) experimental; urgency=low * New snapshot from archer-tromey-python branch. * Make sure that Python is enabled for the main gdb package. -- Daniel Jacobowitz Fri, 12 Dec 2008 11:30:41 -0500 gdb (6.8.50.20081210.python-1) experimental; urgency=low * New snapshot from archer-tromey-python branch. -- Daniel Jacobowitz Wed, 10 Dec 2008 21:36:26 -0500 gdb (6.8.50.20081120.python-1) experimental; urgency=low * Package archer-tromey-python branch for experimental. Highlights since GDB 6.8 (for more, see the NEWS file): - Python scripting support. This is experimental; the interfaces are subject to change. Some example scripts are packaged, including STL pretty-printers for libstdc++. - Improved preprocessor macro support. - Non-stop debugging support (for 32-bit i386 only). You can stop just one thread of interest while the others continue to run. - Improved tab completion, including C structure fields. - Faster remote debugging. - Compressed debug information support; the new "gold" linker can generate compressed debug sections. - New "find" command to search memory. - Native i386 debugger does not get confused about watchpoints when using "target remote" (Closes: #513678). * Build depend on zlib1g-dev and python-dev. * Removed bfd-get-mtime-less.patch, gdb-rbreak-quoting.patch, ia64-array-bound.patch, cp-support-uninit.patch, and m68k-nat-build-fix.patch, merged upstream. * Build depend on procps for testsuite cleanup calls to "kill". * Remove use of -p0 in series file (Closes: #484945). -- Daniel Jacobowitz Fri, 28 Nov 2008 14:28:47 -0500 gdb (6.8-3ubuntu2) intrepid; urgency=low * debian/rules: on sparc, configure the 64bit build with --disable-werror. * Reapply debian/patches/gdb-cvs-reinit_frame_cache.patch. LP: #196274. -- Matthias Klose Tue, 24 Jun 2008 15:42:23 +0200 gdb (6.8-3ubuntu1) intrepid; urgency=low * Merge with Debian; remaining changes: - PIE support. - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. - Add patch to handle debug_info less frames better. - Fix some typos in messages. * Fix build errors with gcc-4.3. * TODO: Fix testcases failing with default hardening options. -- Matthias Klose Tue, 24 Jun 2008 15:42:23 +0200 gdb (6.8-3) unstable; urgency=low * Initialize some uninitialized variables (Closes: #479561). * Drop gdb-arm and insight conflict/replace. * Fix build on m68k. -- Daniel Jacobowitz Wed, 07 May 2008 08:40:02 -0400 gdb (6.8-2) unstable; urgency=low * Make removal of stamp files the first action of the clean target (from Justin Pryzby). * Correct array access in ia64 port to fix build failure. * Fix GDB_TARGET support (reported by Fathi BOUDRA). * Update gcj build dependencies (Closes: #477863, #479111). * Add a man page for gcore, from Nicolas Bonifas (Closes: #479066). -- Daniel Jacobowitz Fri, 02 May 2008 18:28:37 -0400 gdb (6.8-1ubuntu2) hardy-proposed; urgency=low [ Robert Collins ] * Add patch from Michael Matz to handle debug_info less frames better. Origin of patch: https://bugzilla.novell.com/show_bug.cgi?id=390722#c25 (LP: #111869). [ Martin Pitt ] * Port above patch for amd64, too, since it suffers from the same problem. -- Robert Collins Mon, 26 May 2008 11:49:07 +0200 gdb (6.8-1ubuntu1) hardy; urgency=low * Merge with Debian; remaining changes: - PIE support. - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. * Remove patches merged upstream. * Update pie-support patch. -- Matthias Klose Tue, 01 Apr 2008 15:25:20 +0200 gdb (6.8-1) unstable; urgency=low * New upstream release. - Remove patches merged upstream. - GDB automatically sets breakpoints in every copy of C++ templates and cloned constructors (Closes: #421540). - Improved support for debugging optimized code - local variables are displayed more often. - Automatically recognizes ObjC sources (Closes: #462882). * Backported patch to fix quoting for rbreak (Closes: #357319). * Adjust copyright file, quilt build dependency, and oldest changelog entry on lintian's advice. * Add libsim.a to libgdb-dev (Closes: #473295). -- Daniel Jacobowitz Thu, 27 Mar 2008 18:13:39 -0400 gdb (6.7.1-2ubuntu3) hardy; urgency=low * debian/patches/pie-support.patch: updated for 6.7.1; works for attach and core, but not "run". * debian/patches/pie-support-tests.patch: re-enabled, some failures remain. * debian/rules: fix logic to enable running testsuite by default. -- Kees Cook Thu, 20 Mar 2008 02:00:27 -0700 gdb (6.7.1-2ubuntu2) hardy; urgency=low * debian/patches/gdb-cvs-reinit_frame_cache.patch: upstream fix for SEGV when dealing with register caches (LP: #196274). -- Kees Cook Fri, 07 Mar 2008 09:51:58 -0800 gdb (6.7.1-2ubuntu1) hardy; urgency=low * Merge with Debian; remaining changes: - Do not depend on type-handling. - PIE support. - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. * Add patch from Ulrich Weigand to fix stepping over shared library functions on PowerPC (Closes: #432461). LP: #137312. -- Matthias Klose Mon, 14 Jan 2008 17:32:12 +0100 gdb (6.7.1-2) unstable; urgency=low * Add patch from Ulrich Weigand to fix stepping over shared library functions on PowerPC (Closes: #432461). * Add libgdb-dev package for fp-ide (Closes: #458250). * Avoid gcc-4.3 uninitialized warnings (Closes: #455669). * Updated Standards-Version to 3.7.3 - Correct Apps -> Applications in gdb.menu. -- Daniel Jacobowitz Wed, 02 Jan 2008 08:49:43 -0500 gdb (6.7.1-1ubuntu1) hardy; urgency=low * Merge with Debian; remaining changes: - Do not depend on type-handling. - PIE support. - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. * Add build-dependency on lib64expat1-dev. -- Matthias Klose Tue, 04 Dec 2007 09:13:57 +0100 gdb (6.7.1-1) unstable; urgency=low * New upstream release. - Correct makeinfo version check (Closes: #453202). * Merge Ubuntu support for a gdb64 package (Closes: #254270). * Run the testsuite on all GNU/Linux platforms. * Remove old support for skipping thread tests. * Add an expat build dependency and add --with-expat. * Update copyright notice. * Do not freeze on division by zero (Closes: #414887). * Rewrite HPPA kernel offsets patch to support HPPA64. * Include Vladimir Prus's varobj fix for kdevelop (Closes: #443080). -- Daniel Jacobowitz Mon, 03 Dec 2007 10:12:27 -0500 gdb (6.6.dfsg.90.20070912-1) unstable; urgency=low * New upstream snapshot (pre-release for GDB 6.7). - Patches 10.selected-frame.patch, dwarf2-long-size.patch merged upstream. - Backports unwind-check-pc-regnum.patch, ia64-unwind-signedness.patch removed. - Patch 13.use-dynamic-readline.patch replaced by --with-system-readline. - Patch sim-destdir.patch unnecessary. * Disable gcj and gobjc build dependencies for armel (Closes: #441741). * Replace tetex-bin build dependency with texlive-base. * Include kernel offsets for HPPA. -- Daniel Jacobowitz Sat, 15 Sep 2007 13:40:34 -0400 gdb (6.6.dfsg-3) unstable; urgency=low * Correct signedness error in ia64-tdep.c (Closes: #423631) (again). -- Daniel Jacobowitz Fri, 24 Aug 2007 15:48:11 -0400 gdb (6.6.dfsg-2) unstable; urgency=low * Check PC_REGNUM before using it (Closes: #423631). -- Daniel Jacobowitz Thu, 23 Aug 2007 22:26:20 -0400 gdb (6.6.dfsg-1ubuntu7) gutsy; urgency=low * Cross-compile gdb64. * Don't try to install gdbserver on architectures where it doesn't exist. -- Matthias Klose Mon, 10 Sep 2007 21:28:07 +0200 gdb (6.6.dfsg-1ubuntu6) gutsy; urgency=low * Fix build failures on targets only building gdb. * Remove the gdb32 package. * Fix typos in message strings (LP: #63200). -- Matthias Klose Fri, 07 Sep 2007 18:06:20 +0000 gdb (6.6.dfsg-1ubuntu5) gutsy; urgency=low * Build a gdb64/gdb32 package on biarch architectures. LP: #25559. * Set Ubuntu maintainer address. -- Matthias Klose Wed, 15 Aug 2007 19:01:05 +0000 gdb (6.6.dfsg-1ubuntu4) gutsy; urgency=low * Fix register definitions for hppa (Randolph Chung). -- Matthias Klose Fri, 03 Aug 2007 17:11:20 +0000 gdb (6.6.dfsg-1ubuntu3) gutsy; urgency=low * Run the testsuite on lpia. -- Matthias Klose Sat, 28 Jul 2007 18:32:30 +0200 gdb (6.6.dfsg-1ubuntu2) feisty; urgency=low * Reenable the workaround for a build failure on the ia64 buildd. -- Matthias Klose Sun, 11 Feb 2007 23:34:47 +0100 gdb (6.6.dfsg-1ubuntu1) feisty; urgency=low * Merge with Debian unstable; remaining changes: - Do not depend on type-handling. - PIE support. - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. -- Matthias Klose Sun, 11 Feb 2007 14:54:38 +0100 gdb (6.6.dfsg-1) unstable; urgency=low [ Matthias Klose ] * New upstream version. - Prints a newline after EOF (Closes: #233467). * sim-destdir.patch, gdbinit-ownership.patch, bfd-get-mtime-less.patch, pie-support.patch, thread-db-multiple-libraries.patch: Update. * thread-db-live-threads.patch, fork-context-switch.patch: Remove, applied upstream. [ Daniel Jacobowitz ] * Merge changes from Matthias Klose (thanks). * Refresh all patches. * Fix "corrupted DWARF expression" error (Closes: #405116). * Do not crash if loading libthread_db failed (Closes: #408402). * Initial support for building cross-GDB packages, based on the work of Raphael Bossek and Kazuhiro Inaoka (Closes: #313340, #343419, #373927). * Change priority to optional (since ftpmaster did). -- Daniel Jacobowitz Sat, 27 Jan 2007 21:59:06 -0500 gdb (6.6-0ubuntu1) feisty; urgency=low * New upstream version. * sim-destdir.patch, gdbinit-ownership.patch, bfd-get-mtime-less.patch, pie-support.patch, thread-db-multiple-libraries.patch: Update. * thread-db-live-threads.patch, fork-context-switch.patch, glibc2.5-gnu-hash.patch: Remove, applied upstream. -- Matthias Klose Thu, 4 Jan 2007 15:11:39 +0100 gdb (6.5.dfsg-2ubuntu3) feisty; urgency=low * Add PIE support, taken from Fedora patch bundle: - debian/patches/pie-support.patch: core PIE support. - debian/patches/pie-support-tests.patch: PIE operational tests. * debian/rules: drop use of "tee" to solve strange hangs on i386/amd64. -- Kees Cook Thu, 14 Dec 2006 15:05:33 -0800 gdb (6.5.dfsg-2ubuntu2) feisty; urgency=low * Add debian/patches/glibc2.5-gnu-hash.patch: - Teach gdb how to deal with glibc 2.5's .gnu.hash sections, so that gdb works on feisty at all. - Patch taken from upstream CVS head. - Closes: LP#73724 -- Martin Pitt Thu, 14 Dec 2006 09:17:51 +0100 gdb (6.5.dfsg-2ubuntu1) feisty; urgency=low * Merge from debian unstable. Changes left: - type-handling - 'dwarf2-stack-boundry.diff' - security fix for CVE-2006-4146 -- Michael Vogt Thu, 23 Nov 2006 06:56:42 +0100 gdb (6.5.dfsg-2) unstable; urgency=low * Backport a patch to fix GDB segfaults on threaded programs. * Backport a patch to fix errors on fork/vfork in threaded programs. -- Daniel Jacobowitz Thu, 16 Nov 2006 11:06:50 -0500 gdb (6.5.dfsg-1) unstable; urgency=low * New upstream release (Closes: #386586). * Update Standards-Version to 3.7.2 (no changes required). * Mention --args in the man page (Closes: #394150). * Mention gdbtui and -tui (Closes: #362795). * Correctly detect changed executables when rerunning. -- Daniel Jacobowitz Sun, 5 Nov 2006 18:33:48 -0500 gdb (6.4.90.dfsg-1ubuntu3) edgy; urgency=low * SECURITY UPDATE: fix local arbitrary code execution in DWARF processing. * Add 'dwarf2-stack-boundry.diff': limits the DWARF operation stack. Without this, arbitrary code execution would be possible if a user were tricked into debugging an executable with malicious DWARF headers. * References: CVE-2006-4146 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=204845 -- Kees Cook Thu, 28 Sep 2006 11:13:50 -0700 gdb (6.4.90.dfsg-1ubuntu2) edgy; urgency=low * debian/patches/from_upstream_fix_context_switch.patch: - upstream patch (http://sourceware.org/ml/gdb-cvs/2006-09/msg00053.html), should fix a multi-threading issue (Ubuntu: #56391) -- Sebastien Bacher Fri, 29 Sep 2006 17:42:43 +0200 gdb (6.4.90.dfsg-1ubuntu1) edgy; urgency=low * Merge from debian unstable: - left only type-handling bit. -- Fabio M. Di Nitto Tue, 04 Jul 2006 07:46:08 +0200 gdb (6.4.90.dfsg-1) unstable; urgency=low * New upstream snapshot (GDB 6.5 prerelease). - BFD build fix for GCC 4.2 (Closes: #364124). - xstrvprintf error message corrected (Closes: #296483). - Rewritten printf command (Closes: #186037, #231162). - Build fix for hurd-i386 (Closes: #345108). * Split the GDB package into DFSG and non-DFSG portions (Closes: #212522). The documentation has been moved to the new gdb-doc package, which this one Suggests. - Remove packaging for info files. - Remove GFDL section from debian/copyright. - Update README.Debian. * Correct control.in to also use libreadline5-dev. * Update type-handling usage. * Update copyright file with the new FSF address. * Update gcj build dependency (allow mips and mipsel, skip kfreebsd) (Closes: #343199). -- Daniel Jacobowitz Tue, 6 Jun 2006 09:23:45 -0400 gdb (6.4-1ubuntu5) dapper; urgency=low Changes by David S. Miller: * Fix linux_nat regression introduced with the last upload. -- Fabio M. Di Nitto Tue, 09 May 2006 07:48:51 +0200 gdb (6.4-1ubuntu4) dapper; urgency=low Changes by David S. Miller: * Fix core file generation on sparc. * sparc patches split and clean up as applied upstream. -- Fabio M. Di Nitto Sat, 06 May 2006 06:44:31 +0200 gdb (6.4-1ubuntu3) dapper; urgency=low Changes by David S. Miller: * Fix signal frame handling on sparc and use dwarf2 frame unwinding on sparc/linux: - Add patch sparc-dwarf2-and-sigframe.patch. - Update debian/patches/series. -- Fabio M. Di Nitto Thu, 06 Apr 2006 07:16:23 +0200 gdb (6.4-1ubuntu2) dapper; urgency=low Changes by David S. Miller: * Fix sparc threads support: - Add patch gdb-sparclinux-threads.patch. - Update debian/patches/series. NOTE: the patch will work only with properly patched kernel. The patch should be in 2.6.15-20 kernel serie. -- Fabio M. Di Nitto Sun, 02 Apr 2006 09:42:13 +0200 gdb (6.4-1ubuntu1) dapper; urgency=low * merged with debian, * debian/control, debian/rules: Remove type-handling. -- Michael Vogt Wed, 28 Dec 2005 11:19:23 +0100 gdb (6.4-1) unstable; urgency=low * New upstream release. * Reset core ulimit before running the testsuite (Closes: #342343). * Ignore cancellation signal for NPTL by default (Closes: #324683). * Include a description of the front cover texts, et cetera for the manual in the copyright file (Closes: #321803). * Set the default name of main to MAIN__ for Fortran programs (Closes: #319520). * Handle PowerPC PIC prologues a little better (Closes: #312059). * Cope with attaching to threaded programs after the exit of a threaded program (Closes: #303736). -- Daniel Jacobowitz Sun, 11 Dec 2005 13:14:04 -0500 gdb (6.3.90.20051119-1ubuntu1) dapper; urgency=low * debian/control, debian/rules: Remove type-handling. -- Martin Pitt Mon, 21 Nov 2005 19:50:49 +0000 gdb (6.3.90.20051119-1) unstable; urgency=low * New upstream snapshot (6.4 branch prerelease). - Many Debian patches merged. - Selected frame and C++ pass-by-reference patches updated. - Fixes segfault when executing malformed TUI window commands (Closes: #317317). - Behaves more gracefully when the executable disappears, et cetera (Closes: #293637, #323217, #332184). - Handle vfork from threaded programs using NPTL (Closes: #320391). * Do not rebuild bfd.info. * Build depend on a version of debhelper which will put menu fils in /usr/share. * Don't build depend on gcj on the Hurd (Closes: #298088). * Prevent unnecessary SIGTTOU when resolving pending breakpoints (Closes: #306267). * Enable the testsuite on amd64. * Use libreadline5 instead of libreadline4 (Closes: #309538, #326358). * Install gdb_gcore.sh as gcore (Closes: #328580). * Add GPC support (Closes: #261330). -- Daniel Jacobowitz Sun, 20 Nov 2005 13:40:44 -0500 gdb (6.3-6) unstable; urgency=high * Do not crash on certain malformed input files [CAN-2005-1704] (Closes: #308624, #310972). * Do not load untrusted .gdbinit files [CAN-2005-1705] (Closes: #310728). -- Daniel Jacobowitz Sun, 29 May 2005 18:55:44 -0400 gdb (6.3-5) unstable; urgency=low * Fix NPTL debugging using gdbserver. * Disable the "Incomplete CFI data" warning. * Really include the menu file this time (Closes: #80010). * Include a patch to handle strange binaries produced by Kylix (Closes: #249008). * Fix printing of fork status messages, and disable them by default (Closes: #254039). -- Daniel Jacobowitz Wed, 8 Dec 2004 18:35:02 -0500 gdb (6.3-4) unstable; urgency=low * Backport a patch for a warning about the vsyscall DSO. * Backport a spelling fix for PTRACE_EVENT_VFORK_DONE to fix S/390 build failure. -- Daniel Jacobowitz Mon, 15 Nov 2004 11:52:13 -0500 gdb (6.3-3) unstable; urgency=low * Add flex to build dependencies for ada-lex.l. -- Daniel Jacobowitz Sun, 14 Nov 2004 00:28:18 -0500 gdb (6.3-2) unstable; urgency=low * Backport a patch for a C++ / stabs debug info crash (Closes: #251322). * Correct build dependency for gcj (missed a !). * Correct build dependency for libunwind (it's libunwind7-dev now). * Update fix for fork tracing. This removes a warning on 2.4 kernels, and fixes UML debugging (Closes: #271069). * Fix single-stepping through a call to NULL on SPARC (Closes: #256012). -- Daniel Jacobowitz Sat, 13 Nov 2004 16:50:55 -0500 gdb (6.3-1) unstable; urgency=low * New upstream release (Closes: #259219). - Give an error for division by 0 (Closes: #280051). - Includes support for -feliminate-dwarf2-dups. - Limited support for Ada is included; more to come (Closes: #39516, #46470, #57876, #85947). * Update build dependency on texinfo; 4.7-1 could not build GDB. * Build depend on gcj on all architectures other than mips and mipsel (Closes: #272327). * Build depend on libkvm-dev for kfreebsd-gnu (Closes: #264103). * Add libunwind support on ia64 (Closes: #279596). * Make the fork tracing checks more robust. Prevents stray processes on 2.6.10-rc1. * Add a Debian menu entry for GDB (Closes: #80010). -- Daniel Jacobowitz Fri, 12 Nov 2004 18:45:46 -0500 gdb (6.1-3) unstable; urgency=low * Fix passing and returning of non-trivial C++ objects (Closes: #160459). * Update hppa patches (Closes: #247948). * Add a patch for finding C++ member variables in base classes (Closes: #239535). * Replace versions of insight which contain gdbtui. Partial fix for #242498. -- Daniel Jacobowitz Thu, 27 May 2004 11:30:23 -0400 gdb (6.1-2) unstable; urgency=low * Add an NPTL thread-exit patch. Short-lived threads could cause GDB to leave unattached threads, which would crash as soon as they hit a breakpoint. * Testsuite patches - no unexpected FAILs on i386-linux. -- Daniel Jacobowitz Mon, 19 Apr 2004 11:43:07 -0400 gdb (6.1-1) unstable; urgency=low * New upstream version. * Re-add the -debian suffix to GDB's version number. This got lost in the transition to CDBS. * Revised HPPA port. Thanks to Randolph Chung, as usual. * Run the testsuite on SPARC again. The SPARC port is much improved (it has been basically rewritten from scratch). -- Daniel Jacobowitz Tue, 6 Apr 2004 00:13:00 -0400 gdb (6.0-6) unstable; urgency=low * Also add DESTDIR to the ranlib invocation. * Fix typo in moving run.1 manpage. * Link linux-nat.o on HPPA. -- Daniel Jacobowitz Tue, 3 Feb 2004 11:07:27 -0500 gdb (6.0-5) unstable; urgency=low * Add DESTDIR support to sim/, to fix build failures on targets with a simulator. -- Daniel Jacobowitz Mon, 2 Feb 2004 15:32:23 -0500 gdb (6.0-4) unstable; urgency=low * Switch to CDBS and quilt. * Suppress warning about "" on re-run with a vsyscall DSO. * Import gdb 6.0 CVS branch; fixes a segfault with development GCC and frequent segfaults when rereading changed binaries (Closes: #230550). -- Daniel Jacobowitz Mon, 2 Feb 2004 10:03:19 -0500 gdb (6.0-3) unstable; urgency=low * Include instead of on HPPA (Closes: #208928). * Support backtraces through the vsyscall DSO on i386. * Do not run testsuite on hurd-i386 (Closes: #221956). * Fix up texinfo files so that dh_installinfo puts them in the right section. * Update build dependency on texinfo (Closes: #219337). -- Daniel Jacobowitz Sun, 25 Jan 2004 18:04:24 -0500 gdb (6.0-2) unstable; urgency=low * Add build dependency on mig for hurd-i386 (Closes: #216428). * Don't paginate symbol file progress messages. In combination with recent changes to dwarf2-frame.c this fixes some potential internal errors (Closes: #199889). - 28.symfile-unfiltered.patch -- Daniel Jacobowitz Mon, 27 Oct 2003 23:32:39 -0500 gdb (6.0-1) unstable; urgency=low * New upstream release - 11.read-var-value.patch merged upstream. - 12.dwarf-loc-register.patch merged upstream. - -data-list-changed-registers no longer segfaults (Closes: #204561). * Include the text of the GFDL in the copyright file (Closes: #212890). * Include a threading patch which may fix #212949. - 26.lin-lwp-assert.patch * Include a patch which should improve Control-C handling for LinuxThreads on 2.6 kernels. - 27.lin-lwp-2.6.patch -- Daniel Jacobowitz Sat, 4 Oct 2003 17:47:35 -0400 gdb (5.3.20030824-1) unstable; urgency=low * New upstream CVS snapshot, from the GDB 6.0 branch. - 27.tui-paginate-backtrace.patch merged upstream. - 28.minsym-section.patch merged upstream. - Watchpoint handling bug for ia64 fixed (Closes: #205241). * Squash some warnings for HPPA. -- Daniel Jacobowitz Sun, 24 Aug 2003 14:26:52 -0400 gdb (5.3.20030801-1) unstable; urgency=low * New upstream CVS snapshot, from the GDB 6.0 branch. - 26.fix-sparc-build-two.patch merged upstream. - Includes a fix for backtracing from noreturn functions like abort (). - Insert a space between the address and code when disassembling, even if we don't have a function name (Closes: #199672). * Update HPPA patch again; is anyone ever going to submit this upstream? Better do it soon. (Closes: #200980). * Make filtered output paginate correctly again. - 27.tui-paginate-backtrace.patch * Fix an internal error on -data-list-changed-registers, and possibly many others (Closes: #203553). - 10.selected-frame.patch * Add two patches for watchpoints in optimized programs (Closes: #203000). - 11.read-var-value.patch - 12.dwarf-loc-register.patch * Add a patch for several shared library single-stepping bugs. - 28.minsym-section.patch -- Daniel Jacobowitz Sun, 3 Aug 2003 23:09:56 -0400 gdb (5.3.20030629-2) unstable; urgency=low * Yet another sparc build fix. - 26.fix-sparc-build-two.patch -- Daniel Jacobowitz Sun, 29 Jun 2003 17:11:12 -0400 gdb (5.3.20030629-1) unstable; urgency=low * New upstream CVS snapshot, from the GDB 6.0 branch. - Remote debugging isn't totally broken any more. * Remove merge or obsoleted patches. - Parts of 23.static-thread-apps.patch - 26.fix-tui-build.patch - 27.fix-sparc-build-two.patch - 28.dwarf2-reread-segv.patch -- Daniel Jacobowitz Sat, 28 Jun 2003 21:17:13 -0400 gdb (5.3.20030606-3) unstable; urgency=low * Fix build failure on HPPA. * Fix a segfault when reread applications (Closes: #197226). - 28.dwarf2-reread-segv.patch -- Daniel Jacobowitz Sun, 22 Jun 2003 14:30:49 -0400 gdb (5.3.20030606-2) unstable; urgency=low * Add 27.fix-sparc-build-two.patch to fix build failure on sparc. * Disable the testsuite on sparc, since it's completely broken. * Conditionalize gcj build dependency for architectures which both have gcj and run the testsuite. -- Daniel Jacobowitz Sat, 14 Jun 2003 12:30:33 -0400 gdb (5.3.20030606-1) unstable; urgency=low * New upstream snapshot, with lots of nice features. - Improved prologue analyzer and DWARF-2 frame unwind support for i386. - Overhauled Alpha support. - More C++ namespace support (still not complete). - DW_AT_ranges support - if you've noticed local variables in your code being missing in GDB, this is the most likely cause. - Integrated Objective C support, finally! It's got some rough edges but it works (Closes: #62081, #24598, #57824, #86506). - "set cp-abi" command for debugging combined v2 and v3 C++ code. - Some bug fixes in the parsing for gdb --args (Closes: #33361, #193413). - Support for debug info in separate files, coming soon to a Debian near you. * Removed integrated or obsoleted patches: - 01.const-tilde_expand.patch - 05.i386-backtrace-to-main.patch - 08.max-ui-out.patch - 12.tui-readline.patch - 15.m68k-build.patch - 16.use-rl-prefixed-function.patch - 19.alpha-doublest-correction.patch - 21.lin-lwp-schedlock.patch * Disabled some patches which I hope are no longer needed: - 06.java-testsuite-jmisc.patch - 11.thread-confused-exit.patch - 20.alpha-testsuite.patch - 22.alpha-proc-desc-stack.patch * Updated HPPA patches for this snapshot. - 02.gdb-hppa.patch - 03.hppa-core.patch - 04.hppa-func-returns.patch * Add some build fixes for TUI. - 26.fix-tui-build.patch * Build with an absolute path to configure, to work around three failing MI tests. * Don't bother running the testsuite for two debug formats any more. * Add build-dependencies for gcj and gobjc, for the testsuite. * Adjust configure --mandir argument to match more stupid quoting. * Re-enable thread testsuite on Alpha. * Enable the testsuite on ia64, hppa, and s390. -- Daniel Jacobowitz Sun, 8 Jun 2003 20:15:55 -0400 gdb (5.3-2) unstable; urgency=low * Fix build on SPARC. * Fix buid on HPPA. -- Daniel Jacobowitz Sat, 4 Jan 2003 01:02:36 -0500 gdb (5.3-1) unstable; urgency=low * New upstream release. * Patches updated for new release. - Patch 14.gdb-maint-its-typo.patch included. - Patch 17.tui-fixes.patch included. - Patch 18.threads-much-faster.patch included. -- Daniel Jacobowitz Mon, 16 Dec 2002 14:43:03 -0500 gdb (5.2.debian90.cvs20021120-4) unstable; urgency=low * Fix thread debugging for statically linked applications (Closes: #170107). * Prevent a segfault when entering tracepoint actions if you hit EOF (Closes: #167997). -- Daniel Jacobowitz Tue, 3 Dec 2002 14:46:07 -0500 gdb (5.2.debian90.cvs20021120-3) unstable; urgency=low * Add another Alpha patch for setting breakpoints after the process exits. * Disable running the thread tests on Alpha (ew). It hangs the build daemon; the problem appears to be in glibc. It returns nonexistant and duplicate threads. -- Daniel Jacobowitz Sun, 24 Nov 2002 23:16:36 -0500 gdb (5.2.debian90.cvs20021120-2) unstable; urgency=low * Add patch for testsuite false failures on Alpha. * Add patch for floating point support on Alpha. * Add a patch from the CVS HEAD for schedule-lock mode and for software single step platforms. * Correct the testsuite to match "help maint dump-me". -- Daniel Jacobowitz Sun, 24 Nov 2002 18:11:26 -0500 gdb (5.2.debian90.cvs20021120-1) unstable; urgency=low * New upstream CVS snapshot from 5.3 CVS branch. - Builds with new bison (Closes: #169656). - Fixes crashes without SSE support or when loading core files without applications. - TUI no longer crashes if there is no debugging information for main (Closes: #141491). - GDB no longer crashes on "info win" if there are no windows (Closes: #158186). - Setting some C++ breakpoints works the first time instead of having to do it twice (Closes: #110684). * Patches updated for new release. - Patch 07.manual-vector.dpatch included in CVS. - Patch 09.mips-linux-buildfixes-aug02.patch included in CVS. - Patch 10.no-readline-docs.patch removed - we still use readline, I believe that leaving it as an appendix to the GDB manual is appropriate. - Patch 12.tui-readline.patch updated. - Patch 17.tui-fixes.patch added to fix a TUI problem with -i=mi. * Remove useless --enable-shared. * Fix a typo in "help maint dump-me" (Closes: #168495). * Add a patch to fix build on m68k, from Michael Fedrowitz (Closes: #163543). * Added a patch to call rl_filename_completion_function instead of filename_completion_function, from Matt Chapman (Closes: #165366). * Tag GDB version with "-debian" because we apply patches. * Add a patch which makes debugging threaded applications drastically (5x - 10x) faster. Whee! -- Daniel Jacobowitz Fri, 22 Nov 2002 17:30:26 -0500 gdb (5.2.cvs20020818-3) unstable; urgency=low * HPPA fix from Randolph Chung (Closes: #158055). -- Daniel Jacobowitz Sun, 25 Aug 2002 00:37:34 -0400 gdb (5.2.cvs20020818-2) unstable; urgency=low * MIPS and MIPSel build fixes. * Apply and remove patches in numbered order. * HPPA build fixes. -- Daniel Jacobowitz Mon, 19 Aug 2002 10:49:40 -0400 gdb (5.2.cvs20020818-1) unstable; urgency=low * New upstream CVS snapshot. - Don't include in TUI (Closes: #145040). - Don't use libthread_db with core files (Closes: #133778). * Recompile against current readline package (Closes: #153972). * Reduce some thread-db errors to warnings (Closes: #123675, #126614, #134693). * Bump MAX_UI_OUT_LEVELS for the Hurd (Closes: #145630). * Include patch from Richard Hirst to improve function return printing on HPPA. It looks like there's finally a little progress on getting the HPPA code in upstream... (Closes: #148672). * Mention Peter Jay Salzman's GDB tutorial in the documentation (Closes: #151128). -- Daniel Jacobowitz Sun, 18 Aug 2002 23:09:46 -0400 gdb (5.2.cvs20020401-6) unstable; urgency=medium * More HPPA build fixes - I forgot linux-proc.o again (Closes: #143707). * Add support for HPPA core files, patch from Randolph Chung (Closes: #137316). -- Daniel Jacobowitz Sun, 21 Apr 2002 10:29:40 -0400 gdb (5.2.cvs20020401-5) unstable; urgency=low * More HPPA build fixes. -- Daniel Jacobowitz Fri, 19 Apr 2002 12:43:56 -0400 gdb (5.2.cvs20020401-4) unstable; urgency=medium * Add linux-proc.o to NATDEPFILES for S/390; should fix S/390 build. * Change `value_ptr' to `struct value *' in HPPA patch. Should fix HPPA build in combination with libc6 2.2.5-4.0.2. -- Daniel Jacobowitz Wed, 17 Apr 2002 00:43:32 -0400 gdb (5.2.cvs20020401-3) unstable; urgency=low * Add a patch to fix initialization on non-multi-arch targets (particularly Alpha and Sparc). * Enable testsuite on Alpha and Sparc. -- Daniel Jacobowitz Thu, 4 Apr 2002 21:49:24 -0500 gdb (5.2.cvs20020401-2) unstable; urgency=low * My apologies to all you autobuilders out there. Results were worse than I feared. Testsuite is now run only on PowerPC and i386 until I can clean up the results everywhere else. -- Daniel Jacobowitz Wed, 3 Apr 2002 17:24:17 -0500 gdb (5.2.cvs20020401-1) unstable; urgency=low * The "Ahhhhhhhhhhhhhhhhhh!" Release. * New snapshot from CVS (post-5.2) (yes, I know 5.2 isn't out yet). - Fixes crash on printing large types (Closes: #111017, #130592, #131033). - In one upstream patch and one pending patch, greatly improve debugging with GCC 2.95. If you've ever breakpointed the beginning of a function and been frustrated when arguments printed incorrectly, this release is for you! It should fix most occurances of that problem. * Patches from J.H.M. Dassen to use system readline. Slightly tweaked. - [debian/rules] Build the refcard; figure out patches automatically. - [debian/use-dynamic-readline.patch] Link against dynamic readline again. - [debian/no-readline-docs.patch] Remove readline documentation. - [debian/const-tilde_expand.patch] Bring extern declaration of tilde_expand in sync with current readline headers. - [debian/rules] Ensure we don't build against the local readline copy by mistake; remove generated config.status files. * Include gdbserver if it is built. * Include a version of GDB with the TUI interface enabled (Closes: #137503). * Run 'make check' during build, for stabs and DWARF-2. * Add --disable-gdbtk (Closes: #115429). * Add a patch to prevent a hang while running the Java testsuite if gcj-3.0 is installed. * Include simulator in the binary package if one is built (PPC, ARM, MIPS) (Closes: #123185). -- Daniel Jacobowitz Mon, 1 Apr 2002 17:17:30 -0500 gdb (5.1.1-1) unstable; urgency=low * New upstream release (Closes: #132314). - Corrected manual licenses (Closes: #129311). * Apply HPPA patch (Closes: #127301). * Add patch to fix conflict with new ncurses. -- Daniel Jacobowitz Wed, 13 Feb 2002 16:39:32 -0500 gdb (5.1-1) unstable; urgency=low * New upstream release. * All patches merged upstream, including (hopefully) everything needed for S/390. -- Daniel Jacobowitz Fri, 7 Dec 2001 13:04:15 -0500 gdb (5.0.cvs20011007-3) unstable; urgency=low * Add ARM patch (committed to upstream CVS). -- Daniel Jacobowitz Wed, 31 Oct 2001 10:59:21 -0500 gdb (5.0.cvs20011007-2) unstable; urgency=low * Updated S/390 patch from Gerhard Tonn. -- Daniel Jacobowitz Mon, 8 Oct 2001 13:55:06 -0400 gdb (5.0.cvs20011007-1) unstable; urgency=low * New upstream release. * Remove obsolete patches (gdb-docs, gdb-ppc-core). * Add S/390 support patch. * Configure for $(DEB_HOST_GNU_TYPE) (Closes: #109715). -- Daniel Jacobowitz Sun, 7 Oct 2001 14:06:20 -0400 gdb (5.0.cvs20010729-2) unstable; urgency=low * Fix m68k build. Again. (Closes: #107807). -- Daniel Jacobowitz Sat, 25 Aug 2001 15:32:16 -0700 gdb (5.0.cvs20010729-1) unstable; urgency=low * Call dh_installinfo from rules file (Closes: #107119). * Put info files in "Development" to match other Debian development tools. * Fix malformed gdbint.info file. * Use DH_COMPAT=3 to make dh_installinfo work better with wildcards, and bump debhelper build dependency. * Update to 5.1 release branch (Closes: #103992). * Fix PowerPC core files (Re: bug #107072). * Fix up patch handling in rules file a little bit. -- Daniel Jacobowitz Mon, 30 Jul 2001 13:48:27 -0700 gdb (5.0.cvs20010704-1) unstable; urgency=low * The "Independence Day" release - CVS snapshot from July 4th. * New maintainer. * Update build-depends (Closes: #96835, #96897). * New version includes thread support - for some platforms. I'm not going to close the related bugs until I've verified it on a few more targets. * Debhelperize (Closes: #97715, #97593). * Add Replaces: gdb-arm for upgrades (Closes: #79992). -- Daniel Jacobowitz Thu, 5 Jul 2001 12:46:06 -0700 gdb (5.0-4) unstable; urgency=low * Made almost lintian clean: - added Section: and Priority: fields in gdb binary package - info files are now installed in /usr/share/info - binaries get now stripped - debian/copyright now refers to '/usr/share/common-licenses' for full GPL license text (patch by Domenico Andreoli ) * added texinfo & tetex-bin to the build-dependencies. -- Vincent Renardias Sun, 6 May 2001 21:19:16 +0200 gdb (5.0-3) unstable; urgency=low * Include upstream README & NEWS files. closes: #37978 gdb documentation. * s|usr/doc|usr/share/doc|g. closes: #69272: gdb: docs should be in /usr/share/doc according policy. * Fix description. -- Vincent Renardias Wed, 16 Aug 2000 21:58:45 +0200 gdb (5.0-2) unstable; urgency=low * Include patch to get it to work on m68k. closes: #69185: gdb doesn't build on m68k. -- Vincent Renardias Wed, 16 Aug 2000 19:33:16 +0200 gdb (5.0-1) unstable; urgency=low * New upstream code. (Foreign patches not re-applied for now. Will see if they are necessary) closes: #66221 New major upstream version (5.0) out. closes: #63337 gdb: Recompilation with libncurse5 needed. closes: #58450 gdb: Won't compile on PowerPC. closes: #54738 gdb does not compile on i386 under current glibc. -- Vincent Renardias Sun, 13 Aug 2000 01:27:40 +0200 gdb (4.18.19990928-1) unstable; urgency=low * New upstream code. Fixes some problems related to the C++ code: closes: #46125: gdb seg faults calling C++ functions. closes: #46195: gdb is broken for C++ closes: #43955: gdb can't resolve virtual methods with new g++ closes: #36341: gdb: Gives a parse error when casting an expression * Include patch from David N. Welton : closes: #45308: gdb: Patch for gdb debian/rules * ACK NMU: closes: #39661: gdb is broken on ppc arch. * Now compiles on non-i386 archs: closes: #32267 * Updated my email address. -- Vincent Renardias Wed, 29 Sep 1999 17:39:17 +0200 gdb (4.18-1.1) unstable; urgency=low * Applied some ppc patch i got from the linuxppc gdb. -- Sven LUTHER Mon, 14 Jun 1999 19:54:49 +0200 gdb (4.18-1) unstable; urgency=low * New upstream version! -- Vincent Renardias Thu, 22 Apr 1999 17:35:41 +0200 gdb (4.17.19981224-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low * Upgrade to new code. * Apply HJL's 4.17.0.4 -> 4.17.0.8 patch. * Fix #30463. -- Vincent Renardias Mon, 18 Jan 1999 23:38:36 +0100 gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.3) frozen unstable; urgency=low * Non-maintainer upload. * Apply threads patch (dynamically) only if building on i386; the patch works currently only correct on i386 and breaks compilation at least on m68k and sparc. -- Roman Hodek Fri, 11 Dec 1998 13:56:00 +0100 gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.2) unstable; urgency=low * Non-maintainer upload. * debian/rules (checkroot): use tab not spaces, thanks to Roman Hodek . [#26798] -- James Troup Tue, 20 Oct 1998 02:41:26 +0100 gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.1) unstable; urgency=low * NMU with yet more hideous revision. * PowerPC support via Matt McLean. * Clean up corrupted m68k files a little bit - move config/m68k/* to gdb/config/m68k/* and remove literal ^L's. -- Daniel Jacobowitz Fri, 11 Sep 1998 22:40:22 -0400 gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low * Apply yet another patch to improve Objective-C support (Fix #24599). -- Vincent Renardias Wed, 15 Jul 1998 12:34:47 +0200 gdb (4.17-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low * re-integrated gnat support. (Was repported as a bug against 4.16, patch had been integrated then, but dropped while switching to version 4.17). (NB: Not being an ADA expert, I'd appreciate if s/o could confirm it now works properly, thanx) -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 gdb (4.17-2.m68k.objc.threads.hwwp.fpu) unstable; urgency=low * Include patch to support debugging of multithreaded programs (Bug #23823) Note: Needs a patch to libc6 to work (submitted as #24213). * Include JH Lu patch to have hardware watchpoint and FPU support (Fix bug #660!! (40 months old!!!) & bug #16435) * Bug #8861 also appears to be fixed... Isn't that great? :) * Now provide the reference card (Bug #20772). -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 gdb (4.17-1) unstable; urgency=low * Fix #22555 (enable building on sparc) * Fix #21932 (acknowledge NMU) -- Vincent Renardias Mon, 18 May 1998 17:56:10 +0200 gdb (4.17-0.1) frozen unstable; urgency=low * New upstream release (differences with upstream 4.16.98 are negligable). * Non-maintainer upload. * Disabled linking -rpath: * bfd/configure.in, opcodes/configure.in: applied libtool-rpath-workaround * gdb/configure.in, gdb/configure: don't use -rpath on Linux. * regenerate "configure" scripts involved. -- J.H.M. Dassen (Ray) Thu, 30 Apr 1998 19:47:34 +0200 gdb (4.16.98-1) frozen unstable; urgency=low * New upstream code. Only change relevant on Linux: Patch by H.J. Lu so debugging of shared library works properly (That was the important patch motivating this upload). This release _is_ supposed to be the final gdb-4.17 (from the announce: 'I wanted to make a "this is the release unless something is very wrong" release and then kick 4.17 out'). -- Vincent Renardias Thu, 23 Apr 1998 20:44:36 +0200 gdb (4.16.86-1) unstable; urgency=low * New upstream code. (still unreleased). * Re-added the m68k stuff that didn't make it upstream (Bug #19539, #19635). * Re-added the Objective-C stuff (Bug #19630) -- Vincent Renardias Sat, 14 Mar 1998 23:40:06 +0100 gdb (4.16.85-2) unstable; urgency=low * debian/rules: Also remove gdb/doc/GDBvn.texi and config.log when cleaning up. * The following has been done by : * TODO: this version of gdb uses an evil new version of libtool which forces -rpath. With lesstif, I got around this by replacing the libtool scripts with those from the Debian libtool package. * Use dynamic readline library. * Install with preserved timestamps. * Clean out .tab.c files missed by "make distclean", so the .diff.gz is smaller. * Clean out symlinks, so dpkg-source works after debian/rules build clean. * Several other minor clean-ups of the rules file. * Updated FSF address (lintian). * Bumped Standards-Version. -- Vincent Renardias Fri, 6 Mar 1998 20:49:54 +0100 gdb (4.16.85-1) unstable; urgency=low * New upstream code (Although not released yet). -- Vincent Renardias Thu, 5 Mar 1998 20:19:14 +0100 gdb (4.16-12) unstable; urgency=low * Applied alpha patches (#11841). -- Vincent Renardias Mon, 4 Aug 1997 22:28:54 +0200 gdb (4.16-11) unstable; urgency=low * Included patch to fix bugs (#11552,#11324). -- Vincent Renardias Wed, 30 Jul 1997 20:40:01 +0200 gdb (4.16-10) unstable; urgency=low * Fixed #11136 (support for Ada; Thanx to Marc Eichin for pointing this patch). -- Vincent Renardias Thu, 10 Jul 1997 19:38:07 +0200 gdb (4.16-9) unstable; urgency=low * Fixed #11037 (compilation on m68k). -- Vincent Renardias Sat, 5 Jul 1997 16:14:39 +0200 gdb (4.16-8) unstable; urgency=low * Compiled with libc6/ncurses3.4/libreadline2.1. * Fixed #9654 (cosmetic fix). * Updated debian/control file (now supports Objective-C). -- Vincent Renardias Sat, 21 Jun 1997 15:15:13 +0200 gdb (4.16-7) unstable; urgency=low * Fixed typo. in documentation (Fixes bug #5477). -- Vincent Renardias Mon, 7 Apr 1997 16:35:53 +0200 gdb (4.16-6) unstable; urgency=low * Corrected texinfo documentation (Fixes bug #3823). * Added upstream ChangeLog file. -- Vincent Renardias Sun, 16 Mar 1997 18:32:23 +0100 gdb (4.16-5) unstable; urgency=low * Included patch for glibc-2.0 support. -- Vincent Renardias Sun, 16 Mar 1997 07:46:29 +0100 gdb (4.16-4) unstable; urgency=low * Included patch for Objective-C support (Fixes bug #7063). -- Vincent Renardias Sun, 16 Mar 1997 03:12:13 +0100 gdb (4.16-3) unstable; urgency=low * New maintainer. * Included patches for m68k support. -- Vincent Renardias Fri, 14 Mar 1997 22:07:58 +0100 gdb (4.16-2) unstable; urgency=MEDIUM * New caretaker: Stuart Lamble (note: this package is still up for adoption, as I would prefer not to be maintaining it full-time.) * Upgraded to the 2.1.1.0 source format. * Recompiled, with a corrected procfs.h, to correct problems with ELF coredumps. * Reformatted the changelog :-) -- Stuart Lamble Sun, 20 Oct 1996 18:48:40 +1000 debian/gdb-source.preinst0000644000000000000000000000026712165767700012646 0ustar #! /bin/sh set -e # Delete symlink that will be replaced by a directory docdir="/usr/share/doc/gdb-source" if [ -L $docdir ]; then rm $docdir 2>/dev/null fi #DEBHELPER# exit 0 debian/gcore.10000644000000000000000000000243412165767700010365 0ustar .TH gcore "1" "May 2007" "gdb 6.8" "GNU Tools" .SH NAME gcore \- Generate a core file for a running process .SH SYNOPSIS .B gcore [-o \fIfilename\fR] \fIpid\fR .SH DESCRIPTION .\" Add any additional description here .PP gcore generates a core file for the process specified by its process ID, \fIpid\fR. By default, the core file is written to core.\fIpid\fR, in the current directory. .TP \fB\-o\fR \fIfilename\fR write core file to \fIfilename\fR instead of core.\fIpid\fR .SH COPYING Copyright \(co 2003, 2005, 2007, 2008 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. .PP Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. .PP Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .SH "SEE ALSO" .BR gdb (1), .BR core (5) debian/NEWS0000644000000000000000000000027612165767700007705 0ustar gdb (7.4really-1) unstable; urgency=low gdbtui binary is deprecated, starting with GDB 7.5. Use "gdb -tui" instead. -- Hector Oron Sat, 28 Jan 2012 00:43:37 +0100 debian/libgdb-dev.postinst0000755000000000000000000000042612165767700013012 0ustar #!/bin/sh set -e # Replace documentation directory with symlink if [ -d /usr/share/doc/libgdb-dev ] && [ ! -L /usr/share/doc/libgdb-dev ]; then if rmdir /usr/share/doc/libgdb-dev 2>/dev/null; then ln -sf gdb /usr/share/doc/libgdb-dev fi fi #DEBHELPER# exit 0 debian/compat0000644000000000000000000000000212165767700010377 0ustar 7 debian/gdb.menu0000644000000000000000000000016612165767700010626 0ustar ?package(gdb):needs="text" title="GDB" section="Applications/Programming"\ hints="Debuggers" command="/usr/bin/gdb" debian/patches/0000755000000000000000000000000012275437454010632 5ustar debian/patches/ptrace-error-verbosity.patch0000644000000000000000000000165712275217566016315 0ustar Description: try to make the PTRACE scope sysctl more discoverable via a verbose error message when failures happen. Author: Kees Cook Index: b/gdb/inf-ptrace.c =================================================================== --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -226,7 +226,16 @@ errno = 0; ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3)0, 0); if (errno != 0) - perror_with_name (("ptrace")); + { + if (errno == EPERM) + { + fprintf_unfiltered (gdb_stderr, + _("Could not attach to process. If your uid matches the uid of the target\n" + "process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try\n" + "again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf\n")); + } + perror_with_name (("ptrace")); + } #else error (_("This system does not support attaching to a process")); #endif debian/patches/gdb-fortran-main.patch0000644000000000000000000000613412275217543015001 0ustar Daniel, Although the proper way of adding case insensitivity to symbol lookup is still under discussion, I think it might be desirable to set the main function of Fortran programs to "MAIN__" first. Because it can at least let GDB recognize that the language is Fortran after loading a Fortran executable only. What is your idea on this? Please comments. TIA! Here is the patch to set the main function in Fortran programs to "MAIN__". And followed is a patch to verify this. Tested with g77 and gfortran on x86, and g77 on ppc64. With the first patch, it reported PASS; without, report FAIL. No regression is found in gdb.fortran testcases. P.S: if there is a symbol named "MAIN__" in sources of other languages, it might disturb the debugging. But I am not sure how much it is. --- gdb/symtab.c | 8 +++++-- gdb/testsuite/gdb.fortran/lang.exp | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) Index: b/gdb/symtab.c =================================================================== --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -5069,8 +5069,12 @@ } /* The languages above didn't identify the name of the main procedure. - Fallback to "main". */ - set_main_name ("main"); + Fallback to "MAIN__" (g77 and gfortran) if we can find it in the + minimal symtab, to "main" otherwise. */ + if (lookup_minimal_symbol ("MAIN__", NULL, NULL)) + set_main_name ("MAIN__"); + else + set_main_name ("main"); } char * Index: b/gdb/testsuite/gdb.fortran/lang.exp =================================================================== --- /dev/null +++ b/gdb/testsuite/gdb.fortran/lang.exp @@ -0,0 +1,40 @@ +# Copyright 2005 Free Software Foundation, Inc. + +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# This file was written by Wu Zhou. (woodzltc@cn.ibm.com) + +# This file is part of the gdb testsuite. It is intended to test that gdb +# could recognize the Fortran language after loading the binary + +if $tracelevel then { + strace $tracelevel +} + +set testfile "array-element" +set srcfile ${srcdir}/${subdir}/${testfile}.f +set binfile ${objdir}/${subdir}/${testfile} + +if { [gdb_compile "${srcfile}" "${binfile}" executable {debug f77}] != "" } { + untested "Couldn't compile ${srcfile}" + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +gdb_test "show language" ".*currently fortran.*" "show language(fortran)" debian/patches/elf-auxv-diff0000644000000000000000000000172712254273773013220 0ustar Index: b/gdb/auxv.c =================================================================== --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -30,6 +30,7 @@ #include "auxv.h" #include "elf/common.h" +#include #include #include Index: b/gdb/gdbserver/linux-low.c =================================================================== --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include Index: b/gdb/solib-svr4.c =================================================================== --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -48,6 +48,8 @@ #include "gdb_bfd.h" #include "probe.h" +#include + static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); static void svr4_relocate_main_executable (void); debian/patches/linuxthreads_signal_handling.patch0000644000000000000000000000347612165767700017576 0ustar Description: Temporary support for LinuxThreads signal handling on GNU/kFreeBSD Author: Robert Millan Bug-Debian: http://bugs.debian.org/550361 Bug-Debian: http://bugs.debian.org/669043 Bug-Debian: http://bugs.debian.org/698200 Origin: vendor, http://bugs.debian.org/669043 Index: gdb/gdb/common/signals.c =================================================================== --- gdb.orig/gdb/common/signals.c 2013-01-30 00:42:18.000000000 -0500 +++ gdb/gdb/common/signals.c 2013-01-30 01:00:09.000000000 -0500 @@ -334,6 +334,15 @@ return GDB_SIGNAL_INFO; #endif +#if defined(__GLIBC__) && defined(__FreeBSD_kernel__) + if (hostsig == 32) + return TARGET_SIGNAL_LINUXTHREADS_RESTART; + if (hostsig == 33) + return TARGET_SIGNAL_LINUXTHREADS_CANCEL; + if (hostsig == 34) + return TARGET_SIGNAL_LINUXTHREADS_DEBUG; +#endif + #if defined (REALTIME_LO) if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI) { Index: gdb/include/gdb/signals.def =================================================================== --- gdb.orig/include/gdb/signals.def 2013-01-30 00:42:18.000000000 -0500 +++ gdb/include/gdb/signals.def 2013-01-30 01:00:09.000000000 -0500 @@ -194,7 +194,11 @@ SET (TARGET_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception") SET (TARGET_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint") +SET (TARGET_SIGNAL_LINUXTHREADS_RESTART, 151, "32", "LinuxThreads restart signal") +SET (TARGET_SIGNAL_LINUXTHREADS_CANCEL, 152, "33", "LinuxThreads cancel signal") +SET (TARGET_SIGNAL_LINUXTHREADS_DEBUG, 153, "34", "LinuxThreads debug signal") + /* If you are adding a new signal, add it just above this comment. */ /* Last and unused enum value, for sizing arrays, etc. */ -SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_MAGIC") +SET (GDB_SIGNAL_LAST, 154, NULL, "GDB_SIGNAL_MAGIC") debian/patches/solve_PATH_MAX_issue.patch0000644000000000000000000000253512275217550015532 0ustar Description: Patch out a PATH_MAX usage, for Hurd's benefit Author: Svante Signell Bug-Debian: http://bugs.debian.org/709508 Forwarded: http://sourceware.org/ml/gdb-patches/2013-05/msg00878.html Reviewed-By: Héctor Orón Martínez Last-Update: 2013-06-08 Index: b/gdb/nto-tdep.c =================================================================== --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -146,9 +146,11 @@ void nto_init_solib_absolute_prefix (void) { - char buf[PATH_MAX * 2], arch_path[PATH_MAX]; + char *buf, *arch_path; char *nto_root, *endian; const char *arch; + int arch_len, len; +#define FMT "set solib-absolute-prefix %s" nto_root = nto_target (); if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, "i386") == 0) @@ -171,9 +173,13 @@ == BFD_ENDIAN_BIG ? "be" : "le"; } - xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian); + arch_len = strlen (nto_root) + 1 + strlen (arch) + strlen (endian) + 1; + arch_path = alloca (arch_len); + xsnprintf (arch_path, arch_len, "%s/%s%s", nto_root, arch, endian); - xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path); + len = strlen (FMT) - 2 + strlen (arch_path) + 1; + buf = alloca (len); + xsnprintf (buf, len, FMT, arch_path); execute_command (buf, 0); } debian/patches/renesas-sh-native-support.patch0000644000000000000000000011677412165767700016737 0ustar Description: Add Renesas SH (sh4) support Add support for Renesas SH (sh4) architecture. . gdb (7.4-1~cvs20111117.2) experimental; urgency=low . * Add Renesas SH (sh4) support (Closes: #576242) - Thanks Nobuhiro Iwamatsu, Takashi Yoshii. Author: Hector Oron Bug-Debian: http://bugs.debian.org/576242 --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Forwarded: Last-Update: <2011-11-17> --- gdb-7.4.orig/gdb/configure.host +++ gdb-7.4/gdb/configure.host @@ -139,6 +139,7 @@ powerpc64-*-linux*) gdb_host=ppc64-l s390*-*-*) gdb_host=s390 ;; +sh*-*-linux*) gdb_host=linux ;; sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu) gdb_host=nbsd ;; sh*-*-openbsd*) gdb_host=nbsd ;; --- gdb-7.4.orig/gdb/Makefile.in +++ gdb-7.4/gdb/Makefile.in @@ -1538,6 +1538,7 @@ ALLDEPFILES = \ score-tdep.c \ ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \ sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \ + sh-linux-tdep.c sh-linux-nat.c \ sol2-tdep.c \ solib-irix.c solib-svr4.c solib-sunos.c \ sparc-linux-nat.c sparc-linux-tdep.c \ --- gdb-7.4.orig/gdb/sh-linux-tdep.c +++ gdb-7.4/gdb/sh-linux-tdep.c @@ -19,11 +19,34 @@ along with this program. If not, see . */ #include "defs.h" +#include "gdbcore.h" +#include "frame.h" +#include "frame-base.h" +#include "frame-unwind.h" +#include "dwarf2-frame.h" +#include "value.h" +#include "regcache.h" +#include "inferior.h" #include "osabi.h" +#include "reggroups.h" +#include "arch-utils.h" +#include "floatformat.h" #include "solib-svr4.h" #include "symtab.h" +#include "gdb_string.h" +#include "command.h" +#include "gdb_assert.h" +#include +#include +#include +#include +#include + +#include + +#include "regset.h" #include "glibc-tdep.h" #include "sh-tdep.h" #include "linux-tdep.h" @@ -71,9 +94,505 @@ static const struct sh_corefile_regmap f {-1 /* Terminator. */, 0} }; +/* Recognizing signal handler frames. */ + +/* GNU/Linux has two flavors of signals. Normal signal handlers, and + "realtime" (RT) signals. The RT signals can provide additional + information to the signal handler if the SA_SIGINFO flag is set + when establishing a signal handler using `sigaction'. It is not + unlikely that future versions of GNU/Linux will support SA_SIGINFO + for normal signals too. */ + +/* When the SH Linux kernel calls a signal handler and the + SA_RESTORER flag isn't set, the return address points to a bit of + code on the stack. This function returns whether the PC appears to + be within this bit of code. + + The instruction sequence for normal signals is + mov.w 1f,r3 + trapa #16 + or r0, r0 + or r0, r0 + or r0, r0 + or r0, r0 + or r0, r0 + 1: .word __NR_sigreturn + or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x0077. + + Checking for the code sequence should be somewhat reliable, because + the effect is to call the system call sigreturn. This is unlikely + to occur anywhere other than a signal trampoline. + + It kind of sucks that we have to read memory from the process in + order to identify a signal trampoline, but there doesn't seem to be + any other way. The PC_IN_SIGTRAMP macro in tm-linux.h arranges to + only call us if no function name could be identified, which should + be the case since the code is on the stack. + + Detection of signal trampolines for handlers that set the + SA_RESTORER flag is in general not possible. Unfortunately this is + what the GNU C Library has been doing for quite some time now. + However, as of version 2.1.2, the GNU C Library uses signal + trampolines (named __restore and __restore_rt) that are identical + to the ones used by the kernel. Therefore, these trampolines are + supported too. */ + +#define MOVW(n) (0x9300|((n)-2)) /* Move mem word at PC+n to R3 */ +#define TRAP16 0xc310 /* Syscall w/no args (NR in R3) */ +#define OR_R0_R0 0x200b /* or r0,r0 (insert to avoid hardware bug) */ + +#define LINUX_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */ +#define LINUX_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */ +#define LINUX_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */ + +static const unsigned short linux_sigtramp_code[] = +{ + LINUX_SIGTRAMP_INSN0, + LINUX_SIGTRAMP_INSN1, + LINUX_SIGTRAMP_INSN2, + LINUX_SIGTRAMP_INSN2, + LINUX_SIGTRAMP_INSN2, + LINUX_SIGTRAMP_INSN2, + LINUX_SIGTRAMP_INSN2, + __NR_sigreturn +}; + +#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code) + +/* If PC is in a sigtramp routine, return the address of the start of + the routine. Otherwise, return 0. */ + +static CORE_ADDR +sh_linux_sigtramp_start (struct frame_info *next_frame) +{ + CORE_ADDR pc = get_frame_pc (next_frame); + gdb_byte buf[LINUX_SIGTRAMP_LEN]; + + /* We only recognize a signal trampoline if PC is at the start of + one of the three instructions. We optimize for finding the PC at + the start, as will be the case when the trampoline is not the + first frame on the stack. We assume that in the case where the + PC is not at the start of the instruction sequence, there will be + a few trailing readable bytes on the stack. */ + + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN)) + return 0; + + if (buf[0] != LINUX_SIGTRAMP_INSN0) + { + if (buf[0] != LINUX_SIGTRAMP_INSN1) + return 0; + + pc -= 2; + + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN)) + return 0; + } + + if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0) + return 0; + + return pc; +} + +/* This function does the same for RT signals. Here the instruction + sequence is + mov.w 1f,r3 + trapa #16 + or r0, r0 + or r0, r0 + or r0, r0 + or r0, r0 + or r0, r0 + 1: .word __NR_rt_sigreturn + or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x00ad. + + The effect is to call the system call rt_sigreturn. */ + +#define LINUX_RT_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */ +#define LINUX_RT_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */ +#define LINUX_RT_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */ + +static const unsigned short linux_rt_sigtramp_code[] = +{ + LINUX_RT_SIGTRAMP_INSN0, + LINUX_RT_SIGTRAMP_INSN1, + LINUX_RT_SIGTRAMP_INSN2, + LINUX_RT_SIGTRAMP_INSN2, + LINUX_RT_SIGTRAMP_INSN2, + LINUX_RT_SIGTRAMP_INSN2, + LINUX_RT_SIGTRAMP_INSN2, + __NR_rt_sigreturn +}; + +#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code) + +/* If PC is in a RT sigtramp routine, return the address of the start + of the routine. Otherwise, return 0. */ + +static CORE_ADDR +sh_linux_rt_sigtramp_start (struct frame_info *next_frame) +{ + CORE_ADDR pc = get_frame_pc (next_frame); + gdb_byte buf[LINUX_RT_SIGTRAMP_LEN]; + + /* We only recognize a signal trampoline if PC is at the start of + one of the two instructions. We optimize for finding the PC at + the start, as will be the case when the trampoline is not the + first frame on the stack. We assume that in the case where the + PC is not at the start of the instruction sequence, there will be + a few trailing readable bytes on the stack. */ + + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN)) + return 0; + + if (buf[0] != LINUX_RT_SIGTRAMP_INSN0) + { + if (buf[0] != LINUX_RT_SIGTRAMP_INSN1) + return 0; + + pc -= 2; + + if (!safe_frame_unwind_memory (next_frame, pc, buf, + LINUX_RT_SIGTRAMP_LEN)) + return 0; + } + + if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0) + return 0; + + return pc; +} + +/* Return whether PC is in a GNU/Linux sigtramp routine. */ + +static int +sh_linux_sigtramp_p (struct frame_info *this_frame) +{ + CORE_ADDR pc = get_frame_pc (this_frame); + char *name; + + find_pc_partial_function (pc, &name, NULL, NULL); + + /* If we have NAME, we can optimize the search. The trampolines are + named __restore and __restore_rt. However, they aren't dynamically + exported from the shared C library, so the trampoline may appear to + be part of the preceding function. This should always be sigaction, + __sigaction, or __libc_sigaction (all aliases to the same function). */ + if (name == NULL || strstr (name, "sigaction") != NULL) + return (sh_linux_sigtramp_start (this_frame) != 0 + || sh_linux_rt_sigtramp_start (this_frame) != 0); + + return (strcmp ("__restore", name) == 0 + || strcmp ("__restore_rt", name) == 0); +} + +/* Offset to struct sigcontext in ucontext, from . */ +#define SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 12 + + +/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp + routine, return the address of the associated sigcontext structure. */ + +static CORE_ADDR +sh_linux_sigcontext_addr (struct frame_info *this_frame) +{ + CORE_ADDR pc; + CORE_ADDR sp; + + sp = get_frame_register_unsigned (this_frame, SP_REGNUM); + + pc = sh_linux_sigtramp_start (this_frame); + if (pc) + { + return sp; + } + + pc = sh_linux_rt_sigtramp_start (this_frame); + if (pc) + { + CORE_ADDR ucontext_addr; + + /* The sigcontext structure is part of the user context. A + pointer to the user context is passed as the third argument + to the signal handler. */ + ucontext_addr = get_frame_register_unsigned (this_frame, ARG0_REGNUM+2); + return ucontext_addr + SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; + } + + error ("Couldn't recognize signal trampoline."); + return 0; +} + +/* Signal trampolines. */ +extern struct sh_frame_cache *sh_alloc_frame_cache (void); + +static struct sh_frame_cache * +sh_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) +{ + struct sh_frame_cache *cache; + struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ()); + CORE_ADDR sigcontext_addr; + + if (*this_cache) + return *this_cache; + + cache = sh_alloc_frame_cache (); + + cache->base = get_frame_register_unsigned (this_frame, SP_REGNUM); + sigcontext_addr = tdep->sigcontext_addr (this_frame); + if (tdep->sc_reg_offset) + { + int i; + + gdb_assert (tdep->sc_num_regs <= SH_NUM_REGS); + + for (i = 0; i < tdep->sc_num_regs; i++) + if (tdep->sc_reg_offset[i] != -1) + cache->saved_regs[i] = sigcontext_addr + tdep->sc_reg_offset[i]; + } + + *this_cache = cache; + return cache; +} + +static void +sh_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache, + struct frame_id *this_id) +{ + struct sh_frame_cache *cache = + sh_linux_sigtramp_frame_cache (this_frame, this_cache); + + (*this_id) = frame_id_build (cache->base + 64, cache->pc); +} + +extern struct value * sh_frame_prev_register (); +static struct value * +sh_linux_sigtramp_frame_prev_register (struct frame_info *this_frame, + void **this_cache, int regnum) +{ + sh_linux_sigtramp_frame_cache (this_frame, this_cache); + + return sh_frame_prev_register (this_frame, this_cache, regnum); +} + +static int +sh_linux_sigtramp_frame_sniffer (const struct frame_unwind *self, + struct frame_info *this_frame, + void **this_prologue_cache) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); + + /* We shouldn't even bother if we don't have a sigcontext_addr + handler. */ + if (tdep->sigcontext_addr == NULL) + return 0; + + if (tdep->sigtramp_p != NULL) + { + if (tdep->sigtramp_p (this_frame)) + return 1; + } + + return 0; +} + +static const struct frame_unwind sh_linux_sigtramp_frame_unwind = +{ + SIGTRAMP_FRAME, + sh_linux_sigtramp_frame_this_id, + sh_linux_sigtramp_frame_prev_register, + NULL, + sh_linux_sigtramp_frame_sniffer +}; + +/* Supply register REGNUM from the buffer specified by GREGS and LEN + in the general-purpose register set REGSET to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ + +void +sh_supply_gregset (const struct regset *regset, struct regcache *regcache, + int regnum, const void *gregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + const char *regs = gregs; + int i; + + gdb_assert (len == tdep->sizeof_gregset); + + for (i = 0; i < tdep->gregset_num_regs; i++) + { + if ((regnum == i || regnum == -1) + && tdep->gregset_reg_offset[i] != -1) + regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]); + } +} + +/* Collect register REGNUM from the register cache REGCACHE and store + it in the buffer specified by GREGS and LEN as described by the + general-purpose register set REGSET. If REGNUM is -1, do this for + all registers in REGSET. */ + +void +sh_collect_gregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *gregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + char *regs = gregs; + int i; + + gdb_assert (len == tdep->sizeof_gregset); + + for (i = 0; i < tdep->gregset_num_regs; i++) + { + if ((regnum == i || regnum == -1) + && tdep->gregset_reg_offset[i] != -1) + regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]); + } +} + +/* Supply register REGNUM from the buffer specified by FPREGS and LEN + in the floating-point register set REGSET to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ + +static void +sh_supply_fpregset (const struct regset *regset, struct regcache *regcache, + int regnum, const void *fpregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + const char *regs = fpregs; + int i; + + gdb_assert (len == tdep->sizeof_fpregset); + for (i = 0; i < 16; i++) + { + if (regnum == i+25 || regnum == -1) + regcache_raw_supply (regcache, i+25, regs + i*4); + } + if (regnum == FPSCR_REGNUM || regnum == -1) + regcache_raw_supply (regcache, FPSCR_REGNUM, regs + 32*4); + if (regnum == FPUL_REGNUM || regnum == -1) + regcache_raw_supply (regcache, FPUL_REGNUM, regs + 33*4); +} + +/* Collect register REGNUM from the register cache REGCACHE and store + it in the buffer specified by FPREGS and LEN as described by the + floating-point register set REGSET. If REGNUM is -1, do this for + all registers in REGSET. */ + +static void +sh_collect_fpregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *fpregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + char *regs = fpregs; + int i; + + gdb_assert (len == tdep->sizeof_fpregset); + for (i = 0; i < 16; i++) + { + if (regnum == i+25 || regnum == -1) + regcache_raw_collect (regcache, i+25, regs + i*4); + } + if (regnum == FPSCR_REGNUM || regnum == -1) + regcache_raw_collect (regcache, FPSCR_REGNUM, regs + 32*4); + if (regnum == FPUL_REGNUM || regnum == -1) + regcache_raw_collect (regcache, FPUL_REGNUM, regs + 33*4); +} + +/* Return the appropriate register set for the core section identified + by SECT_NAME and SECT_SIZE. */ + +const struct regset * +sh_linux_regset_from_core_section (struct gdbarch *gdbarch, + const char *sect_name, size_t sect_size) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset) + { + if (tdep->gregset == NULL) + tdep->gregset = regset_alloc (gdbarch, sh_supply_gregset, + sh_collect_gregset); + return tdep->gregset; + } + + if ((strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)) + { + if (tdep->fpregset == NULL) + tdep->fpregset = regset_alloc (gdbarch, sh_supply_fpregset, + sh_collect_fpregset); + return tdep->fpregset; + } + + return NULL; +} + +/* The register sets used in GNU/Linux ELF core-dumps are identical to + the register sets in `struct user' that are used for a.out + core-dumps. These are also used by ptrace(2). The corresponding + types are `elf_gregset_t' for the general-purpose registers (with + `elf_greg_t' the type of a single GP register) and `elf_fpregset_t' + for the floating-point registers. + + Those types used to be available under the names `gregset_t' and + `fpregset_t' too, and GDB used those names in the past. But those + names are now used for the register sets used in the `mcontext_t' + type, which have a different size and layout. */ + +/* Mapping between the general-purpose registers in `struct user' + format and GDB's register cache layout. */ + +/* From . */ +static int sh_linux_gregset_reg_offset[] = +{ + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 44, 48, 52, 56, 60, + + REG_PC*4, REG_PR*4, REG_GBR*4, -1, + REG_MACH*4, REG_MACL*4, REG_SR*4, +}; + +/* Mapping between the general-purpose registers in `struct + sigcontext' format and GDB's register cache layout. */ + +/* From . */ +static int sh_linux_sc_reg_offset[] = +{ + 4, 8, 12, 16, 20, 24, 28, 32, + 36, 40, 44, 48, 52, 56, 60, 64, + 68, 72, 80, -1, + 84, 88, 76 +}; + static void sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + bfd abfd; + + tdep->gregset_reg_offset = sh_linux_gregset_reg_offset; + tdep->gregset_num_regs = ARRAY_SIZE (sh_linux_gregset_reg_offset); + tdep->sizeof_gregset = 23 * 4; + + tdep->jb_pc_offset = 32; /* From . */ + + tdep->sigtramp_p = sh_linux_sigtramp_p; + tdep->sigcontext_addr = sh_linux_sigcontext_addr; + tdep->sc_reg_offset = sh_linux_sc_reg_offset; + tdep->sc_num_regs = ARRAY_SIZE (sh_linux_sc_reg_offset); + + frame_unwind_append_unwinder(gdbarch, &sh_linux_sigtramp_frame_unwind); + + /* If we have a register mapping, enable the generic core file + support, unless it has already been enabled. */ + if (tdep->gregset_reg_offset + && !gdbarch_regset_from_core_section_p (gdbarch)) + set_gdbarch_regset_from_core_section (gdbarch, + sh_linux_regset_from_core_section); + linux_init_abi (info, gdbarch); /* GNU/Linux uses SVR4-style shared libraries. */ --- gdb-7.4.orig/gdb/sh-tdep.h +++ gdb-7.4/gdb/sh-tdep.h @@ -22,6 +22,12 @@ /* Contributed by Steve Chamberlain sac@cygnus.com. */ +struct frame_info; +struct gdbarch; +struct reggroup; +struct regset; +struct regcache; + /* Registers for all SH variants. Used also by sh3-rom.c. */ enum { @@ -30,6 +36,7 @@ enum ARG0_REGNUM = 4, ARGLAST_REGNUM = 7, FP_REGNUM = 14, + SP_REGNUM = 15, PC_REGNUM = 16, PR_REGNUM = 17, GBR_REGNUM = 18, @@ -83,8 +90,26 @@ enum FV_LAST_REGNUM = 79 }; +#define SH_NUM_REGS 67 + +struct sh_frame_cache +{ + /* Base address. */ + CORE_ADDR base; + LONGEST sp_offset; + CORE_ADDR pc; + + /* Flag showing that a frame has been created in the prologue code. */ + int uses_fp; + + /* Saved registers. */ + CORE_ADDR saved_regs[SH_NUM_REGS]; + CORE_ADDR saved_sp; +}; + extern gdbarch_init_ftype sh64_gdbarch_init; extern void sh64_show_regs (struct frame_info *); +extern struct sh_frame_cache *sh_frame_cache (struct frame_info *next_frame, void **this_cache); /* This structure describes a register in a core-file. */ struct sh_corefile_regmap @@ -93,8 +118,32 @@ struct sh_corefile_regmap unsigned int offset; }; +/* sh architecture specific information. */ struct gdbarch_tdep { + /* General-purpose registers. */ + struct regset *gregset; + int *gregset_reg_offset; + int gregset_num_regs; + size_t sizeof_gregset; + + /* Floating-point registers. */ + struct regset *fpregset; + size_t sizeof_fpregset; + + /* Offset of saved PC in jmp_buf. */ + int jb_pc_offset; + + /* Detect sigtramp. */ + int (*sigtramp_p) (struct frame_info *); + + /* Get address of sigcontext for sigtramp. */ + CORE_ADDR (*sigcontext_addr) (struct frame_info *); + + /* Offset of registers in `struct sigcontext'. */ + int *sc_reg_offset; + int sc_num_regs; + /* Non-NULL when debugging from a core file. Provides the offset where each general-purpose register is stored inside the associated core file section. */ --- /dev/null +++ gdb-7.4/gdb/sh-linux-nat.c @@ -0,0 +1,269 @@ +/* Low level SH interface to ptrace, for GDB when running native. + Copyright (C) 2002, 2004 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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "gdbcore.h" +#include "regcache.h" +#include "linux-nat.h" +#include "target.h" +#include "arch-utils.h" + +#include "gdb_assert.h" +#include "gdb_string.h" +#include +#include +#include +#include + +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" +#include "sh-tdep.h" + +/* Defines ps_err_e, struct ps_prochandle. */ +#include "gdb_proc_service.h" + +//#include + +#define SH_LINUX_NUM_REGS 40 +/* This table must line up with REGISTER_NAME in "sh-tdep.c". */ +static const int regmap[] = +{ + /* general registers 0-15 */ + REG_REG0 , REG_REG0+1 , REG_REG0+2 , REG_REG0+3, + REG_REG0+4 , REG_REG0+5 , REG_REG0+6 , REG_REG0+7, + REG_REG0+8 , REG_REG0+9 , REG_REG0+10, REG_REG0+11, + REG_REG0+12, REG_REG0+13, REG_REG0+14, REG_REG0+15, + /* 16 - 22 */ + REG_PC, REG_PR, REG_GBR, -1, REG_MACH, REG_MACL, REG_SR, + /* 23, 24 */ + REG_FPUL, REG_FPSCR, + /* floating point registers 25 - 40 */ + REG_FPREG0 , REG_FPREG0+1 , REG_FPREG0+2 , REG_FPREG0+3 , + REG_FPREG0+4 , REG_FPREG0+5 , REG_FPREG0+6 , REG_FPREG0+7 , + REG_FPREG0+8 , REG_FPREG0+9 , REG_FPREG0+10, REG_FPREG0+11, + REG_FPREG0+12, REG_FPREG0+13, REG_FPREG0+14, REG_FPREG0+15, +}; + +CORE_ADDR +register_u_addr (CORE_ADDR blockend, int regnum) +{ + if (regnum < 0 || regnum >= sizeof regmap/sizeof regmap[0]) + return (CORE_ADDR)-1; + return (blockend + 4 * regmap[regnum]); +} + + +/* Return the address in the core dump or inferior of register REGNO. + BLOCKEND is the address of the end of the user structure. */ + +CORE_ADDR +register_addr (int regno, CORE_ADDR blockend) +{ + CORE_ADDR addr; + + if (regno < 0 || regno >= SH_LINUX_NUM_REGS) { + internal_error (__FILE__, __LINE__, + _("Got request for bad register number %d."), regno); + } + + REGISTER_U_ADDR (addr, blockend, regno); + + return addr; +} + +/* Fetch one register. */ + +static void +fetch_register (struct regcache *regcache, int tid, int regno) +{ + int val; + + if (cannot_fetch_register (regno)) + { + regcache_raw_supply (regcache, regno, NULL); + return; + } + + errno = 0; + val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0); + if (errno != 0) + perror_with_name (_("Couldn't get registers")); + + regcache_raw_supply (regcache, regno, &val); +} + +/* Store one register. */ + +static void +store_register (struct regcache *regcache, int tid, int regno) +{ + int val; + + if (cannot_store_register (regno)) + return; + + errno = 0; + regcache_raw_collect (regcache, regno, &val); + ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val); + if (errno != 0) + perror_with_name (_("Couldn't write registers")); +} + +/* Transfering the general-purpose registers between GDB, inferiors + and core files. */ + +/* Fill GDB's register array with the general-purpose register values + in *GREGSETP. */ + +void +supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp) +{ + elf_greg_t *regp = (elf_greg_t *) gregsetp; + int i; + + for (i = 0; i < 23; i++) + if (regmap[i] == -1) + regcache_raw_supply (regcache, i, NULL); + else + regcache_raw_supply (regcache, i, (char *) (regp + regmap[i])); +} + +/* Fill register REGNO (if it is a general-purpose register) in + *GREGSETPS with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_gregset (const struct regcache *regcache, elf_gregset_t *gregsetp, int regno) +{ + elf_greg_t *regp = (elf_greg_t *) gregsetp; + int i; + + for (i = 0; i < 23; i++) + if (regmap[i] != -1 && (regno == -1 || regno == i)) + regcache_raw_collect (regcache, i, (char *) (regp + regmap[i])); +} + +/* Transfering floating-point registers between GDB, inferiors and cores. */ + +/* Fill GDB's register array with the floating-point register values in + *FPREGSETP. */ + +void +supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp) +{ + int i; + long *regp = (long *)fpregsetp; + + for (i = 0; i < 16; i++) + regcache_raw_supply (regcache, 25 + i, (char *) (regp + i)); + regcache_raw_supply (regcache, FPUL_REGNUM, (char *) (regp + REG_FPUL - REG_FPREG0)); + regcache_raw_supply (regcache, FPSCR_REGNUM, (char *) (regp + REG_FPSCR - REG_FPREG0)); +} + +/* Fill register REGNO (if it is a floating-point register) in + *FPREGSETP with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_fpregset (const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno) +{ + int i; + long *regp = (long *)fpregsetp; + + for (i = 0; i < 16; i++) + if ((regno == -1) || (regno == i)) + regcache_raw_collect (regcache, 25 + i, (char *) (regp + i)); + if ((regno == -1) || regno == FPSCR_REGNUM) + regcache_raw_collect (regcache, FPSCR_REGNUM, (char *) (regp + REG_FPSCR - REG_FPREG0)); + if ((regno == -1) || regno == FPUL_REGNUM) + regcache_raw_collect (regcache, FPUL_REGNUM, (char *) (regp + REG_FPUL - REG_FPREG0)); +} + +/* Transferring arbitrary registers between GDB and inferior. */ + +/* Check if register REGNO in the child process is accessible. + If we are accessing registers directly via the U area, only the + general-purpose registers are available. + All registers should be accessible if we have GETREGS support. */ + +int +cannot_fetch_register (int regno) +{ + return (regno < 0 || regno >= sizeof regmap / sizeof regmap[0] || regmap[regno] == -1); +} + +int +cannot_store_register (int regno) +{ + return (regno < 0 || regno >= sizeof regmap / sizeof regmap[0] || regmap[regno] == -1); +} + +/* Fetch register values from the inferior. + If REGNO is negative, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +static void +sh_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) +{ + int i; + int tid; + + /* GNU/Linux LWP ID's are process ID's. */ + if ((tid = TIDGET (inferior_ptid)) == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ + + for (i = 0; i < SH_LINUX_NUM_REGS; i++) + if (regno == -1 || regno == i) + fetch_register (regcache, tid, i); +} +/* Store our register values back into the inferior. + If REGNO is negative, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +static void +sh_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) +{ + int i; + int tid; + + /* GNU/Linux LWP ID's are process ID's. */ + if ((tid = TIDGET (inferior_ptid)) == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ + + for (i = 0; i < SH_LINUX_NUM_REGS; i++) + if (regno == -1 || regno == i) + store_register (regcache, tid, i); +} + +void +_initialize_sh_linux_nat (void) +{ + struct target_ops *t; + + /* Fill in the generic GNU/Linux methods. */ + t = linux_target (); + + /* Add our register access methods. */ + t->to_fetch_registers = sh_linux_fetch_inferior_registers; + t->to_store_registers = sh_linux_store_inferior_registers; + + /* Register the target. */ + linux_nat_add_target (t); +} --- gdb-7.4.orig/gdb/sh-tdep.c +++ gdb-7.4/gdb/sh-tdep.c @@ -23,6 +23,9 @@ sac@cygnus.com. */ #include "defs.h" +#include "arch-utils.h" +#include "command.h" +#include "dummy-frame.h" #include "frame.h" #include "frame-base.h" #include "frame-unwind.h" @@ -39,6 +42,7 @@ #include "arch-utils.h" #include "floatformat.h" #include "regcache.h" +#include "regset.h" #include "doublest.h" #include "osabi.h" #include "reggroups.h" @@ -71,23 +75,6 @@ static const char *sh_active_calling_con static void (*sh_show_regs) (struct frame_info *); -#define SH_NUM_REGS 67 - -struct sh_frame_cache -{ - /* Base address. */ - CORE_ADDR base; - LONGEST sp_offset; - CORE_ADDR pc; - - /* Flag showing that a frame has been created in the prologue code. */ - int uses_fp; - - /* Saved registers. */ - CORE_ADDR saved_regs[SH_NUM_REGS]; - CORE_ADDR saved_sp; -}; - static int sh_is_renesas_calling_convention (struct type *func_type) { @@ -1042,7 +1029,7 @@ sh_treat_as_flt_p (struct type *type) return 0; /* Otherwise if the type of that member is float, the whole type is treated as float. */ - if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_FLT) + if (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0))) == TYPE_CODE_FLT) return 1; /* Otherwise it's not treated as float. */ return 0; @@ -1092,7 +1079,7 @@ sh_push_dummy_call_fpu (struct gdbarch * in four registers available. Loop thru args from first to last. */ for (argnum = 0; argnum < nargs; argnum++) { - type = value_type (args[argnum]); + type = check_typedef (value_type (args[argnum])); len = TYPE_LENGTH (type); val = sh_justify_value_in_reg (gdbarch, args[argnum], len); @@ -2510,7 +2497,7 @@ sh_dwarf2_frame_init_reg (struct gdbarch reg->how = DWARF2_FRAME_REG_UNDEFINED; } -static struct sh_frame_cache * +struct sh_frame_cache * sh_alloc_frame_cache (void) { struct sh_frame_cache *cache; @@ -2537,7 +2524,7 @@ sh_alloc_frame_cache (void) return cache; } -static struct sh_frame_cache * +struct sh_frame_cache * sh_frame_cache (struct frame_info *this_frame, void **this_cache) { struct gdbarch *gdbarch = get_frame_arch (this_frame); @@ -2595,9 +2582,9 @@ sh_frame_cache (struct frame_info *this_ return cache; } -static struct value * -sh_frame_prev_register (struct frame_info *this_frame, - void **this_cache, int regnum) +struct value * +sh_frame_prev_register (struct frame_info *this_frame, void **this_cache, + int regnum) { struct gdbarch *gdbarch = get_frame_arch (this_frame); struct sh_frame_cache *cache = sh_frame_cache (this_frame, this_cache); @@ -2611,7 +2598,7 @@ sh_frame_prev_register (struct frame_inf the current frame. Frob regnum so that we pull the value from the correct place. */ if (regnum == gdbarch_pc_regnum (gdbarch)) - regnum = PR_REGNUM; + regnum = PR_REGNUM; /* XXX: really? */ if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1) return frame_unwind_got_memory (this_frame, regnum, @@ -2855,8 +2842,8 @@ sh_regset_from_core_section (struct gdba static struct gdbarch * sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; + struct gdbarch *gdbarch; sh_show_regs = sh_generic_show_regs; switch (info.bfd_arch_info->mach) @@ -2919,6 +2906,18 @@ sh_gdbarch_init (struct gdbarch_info inf tdep = XZALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); + /* General-purpose registers. */ + tdep->gregset = NULL; + tdep->gregset_reg_offset = NULL; + tdep->gregset_num_regs = 23; + tdep->sizeof_gregset = 0; + + /* Floating-point registers. */ + tdep->fpregset = NULL; + tdep->sizeof_fpregset = 34*4; + + tdep->jb_pc_offset = -1; + set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); @@ -3064,10 +3063,11 @@ sh_gdbarch_init (struct gdbarch_info inf break; } + dwarf2_append_unwinders (gdbarch); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind); return gdbarch; --- /dev/null +++ gdb-7.4/gdb/testsuite/gdb.asm/sh-linux.inc @@ -0,0 +1,78 @@ +# You'll find a bunch of nop opcodes in the below macros. They are +# there to keep the code correctly aligned. Be careful to maintain +# them when changing the code. + + comment "subroutine declare" + .purgem gdbasm_declare + .macro gdbasm_declare name + .align 1 + .global \name +\name: + .endm + + comment "subroutine prologue" + .macro gdbasm_enter + mov.l r14,@-r15 + sts.l pr,@-r15 + mov r15,r14 + nop + .endm + + comment "subroutine epilogue" + .macro gdbasm_leave + mov r14,r15 + lds.l @r15+,pr + mov.l @r15+,r14 + rts + nop + nop + .endm + + comment "subroutine end" + .purgem gdbasm_end + .macro gdbasm_end name + .size \name, .-_foo1 + .align 1 + .endm + + comment "subroutine call" + .macro gdbasm_call subr + mov.l .Lconst\@,r1 + bra .Lafterconst\@ + nop + .align 2 +.Lconst\@: + .long \subr +.Lafterconst\@: + jsr @r1 + nop + .endm + + .macro gdbasm_several_nops + nop + nop + nop + nop + .endm + + comment "exit (0)" + .macro gdbasm_exit0 + sleep + nop + .endm + + comment "crt0 startup" + .macro gdbasm_startup + mov #0,r14 + .endm + + comment "Declare a data variable" + .purgem gdbasm_datavar + .macro gdbasm_datavar name value + .data + .align 2 + .type \name, @object + .size \name, 4 +\name: + .long \value + .endm --- gdb-7.4.orig/gdb/testsuite/gdb.asm/sh.inc +++ gdb-7.4/gdb/testsuite/gdb.asm/sh.inc @@ -40,9 +40,8 @@ mov.l .Lconst\@,r1 bra .Lafterconst\@ nop - nop -.Lconst\@: .align 2 +.Lconst\@: .long \subr .align 1 .Lafterconst\@: --- gdb-7.4.orig/gdb/testsuite/gdb.asm/asm-source.exp +++ gdb-7.4/gdb/testsuite/gdb.asm/asm-source.exp @@ -111,6 +111,11 @@ switch -glob -- [istarget] { append link-flags " -m elf32ppc" } } + "sh*-linux*" { + set asm-arch sh-linux + set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}" + set debug-flags "-gdwarf-2" + } "sh*-*-*" { set asm-arch sh set debug-flags "-gdwarf-2" --- gdb-7.4.orig/gdb/testsuite/gdb.base/sigall.c +++ gdb-7.4/gdb/testsuite/gdb.base/sigall.c @@ -1,9 +1,9 @@ #include #include -#ifdef __sh__ -#define signal(a,b) /* Signals not supported on this target - make them go away */ -#endif + + + /* Signal handlers, we set breakpoints in them to make sure that the signals really get delivered. */ --- gdb-7.4.orig/gdb/testsuite/gdb.base/signals.c +++ gdb-7.4/gdb/testsuite/gdb.base/signals.c @@ -3,10 +3,10 @@ #include #include -#ifdef __sh__ -#define signal(a,b) /* Signals not supported on this target - make them go away */ -#define alarm(a) /* Ditto for alarm() */ -#endif + + + + static int count = 0; --- gdb-7.4.orig/gdb/testsuite/gdb.base/annota1.c +++ gdb-7.4/gdb/testsuite/gdb.base/annota1.c @@ -1,9 +1,9 @@ #include #include -#ifdef __sh__ -#define signal(a,b) /* Signals not supported on this target - make them go away */ -#endif + + + #ifdef PROTOTYPES --- gdb-7.4.orig/gdb/testsuite/gdb.base/annota3.c +++ gdb-7.4/gdb/testsuite/gdb.base/annota3.c @@ -1,9 +1,9 @@ #include #include -#ifdef __sh__ -#define signal(a,b) /* Signals not supported on this target - make them go away */ -#endif + + + #ifdef PROTOTYPES --- /dev/null +++ gdb-7.4/gdb/config/sh/xm-linux.h @@ -0,0 +1,32 @@ +/* Native support for GNU/Linux, for GDB, the GNU debugger. + Copyright (C) 2000 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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef XM_LINUX_H +#define XM_LINUX_H + +#define HOST_BYTE_ORDER LITTLE_ENDIAN + +#define HAVE_TERMIOS + +#define NEED_POSIX_SETPGID + +/* Need R_OK etc, but USG isn't defined. */ +#include + +#endif /* #ifndef XM_LINUX_H */ --- /dev/null +++ gdb-7.4/gdb/config/sh/nm-linux.h @@ -0,0 +1,54 @@ +/* Native-dependent definitions for SuperH running Linux, for GDB. + Copyright 2004 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef NM_LINUX_H +#define NM_LINUX_H + +/* Get generic Linux native definitions. */ +#include "config/nm-linux.h" +/* Support for the user area. */ + +/* Return the size of the user struct. */ +extern int kernel_u_size (void); +#define KERNEL_U_SIZE kernel_u_size() + +/* This is the amount to substract from u.u_ar0 to get the offset in + the core file of the register values. */ +#define KERNEL_U_ADDR 0 + +#define U_REGS_OFFSET 0 + +extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum); +#define REGISTER_U_ADDR(addr, blockend, regnum) \ + (addr) = register_u_addr (blockend, regnum) + +/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ +#define FETCH_INFERIOR_REGISTERS + +/* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we + might fall back on the code `infptrace.c' (well a copy of that code + in `sh-linux-nat.c' for now) and we can access only the + general-purpose registers in that way. */ +extern int cannot_fetch_register (int regno); +extern int cannot_store_register (int regno); +#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno) +#define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno) + +#endif /* NM_LINUX_H */ --- /dev/null +++ gdb-7.4/gdb/config/sh/linux.mh @@ -0,0 +1,8 @@ +# Host: Renesas Super-H running GNU/Linux +NAT_FILE= nm-linux.h +NATDEPFILES= inf-ptrace.o fork-child.o corelow.o \ + sh-linux-nat.o \ + proc-service.o linux-thread-db.o gcore.o \ + linux-nat.o linux-fork.o + +LOADLIBES= -ldl -rdynamic debian/patches/ppc64le.diff0000644000000000000000000024114012275217614012735 0ustar gdb/ 2014-02-04 Ulrich Weigand  * gdbarch.sh (skip_entrypoint): New callback. * gdbarch.c, gdbarch.h: Regenerate. * symtab.c (skip_prologue_sal): Call gdbarch_skip_entrypoint. * infrun.c (fill_in_stop_func): Likewise. * ppc-linux-tdep.c: Include "elf/ppc64.h". (ppc_elfv2_elf_make_msymbol_special): New function. (ppc_elfv2_skip_entrypoint): Likewise. (ppc_linux_init_abi): Install them for ELFv2. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (ppc64_aggregate_candidate): New routine. (ppc64_elfv2_abi_homogeneous_aggregate): Likewise. (ppc64_sysv_abi_push_param): Handle ELFv2 homogeneous structs. (ppc64_sysv_abi_return_value): Likewise. Also, handle small structures returned in GPRs. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct offset to the stack parameter list for the ELFv2 ABI. 2014-02-04 Ulrich Weigand  * ppc-linux-tdep.c (ppc_linux_init_abi): Only call set_gdbarch_convert_from_func_ptr_addr and set_gdbarch_elf_make_msymbol_special for ELFv1. * ppc-sysv-tdep.c (ppc64_sysv_abi_push_param): Only handle function descriptors on ELFv1. (ppc64_sysv_abi_push_dummy_call): Likewise. On ELFv2, set up r12 at function entry. 2014-02-04 Ulrich Weigand  * ppc-tdep.h (enum powerpc_elf_abi): New data type. (struct gdbarch_tdep): New member elf_abi. * rs6000-tdep.c: Include "elf/ppc64.h". (rs6000_gdbarch_init): Detect ELF ABI version. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct order within a register pair holding a DFP 128-bit value on little-endian. (ppc64_sysv_abi_return_value_base): Likewise. * rs6000-tdep.c (dfp_pseudo_register_read): Likewise. (dfp_pseudo_register_write): Likewise. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct offset on little-endian when passing _Decimal32. (ppc64_sysv_abi_return_value_base): Likewise for return values. 2014-02-04 Ulrich Weigand  * rs6000-tdep.c (efpr_pseudo_register_read): Use correct offset of the overlapped FP register within the VSX register on little- endian platforms. (efpr_pseudo_register_write): Likewise. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct offset on little-endian when passing small structures. 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment. (struct ppc64_sysv_argpos): New data structure. (ppc64_sysv_abi_push_float): Remove. (ppc64_sysv_abi_push_val): New function. (ppc64_sysv_abi_push_integer): Likewise. (ppc64_sysv_abi_push_freg): Likewise. (ppc64_sysv_abi_push_vreg): Likewise. (ppc64_sysv_abi_push_param): Likewise. (ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines. (ppc64_sysv_abi_return_value_base): New function. (ppc64_sysv_abi_return_value): Refactor to use it. 2014-02-04 Ulrich Weigand  * NEWS: Document new target powerpc64le-*-linux*. gdb/testsuite/ 2014-02-04 Ulrich Weigand * gdb.base/sigbpt.exp: Do not use "*" when setting breakpoint on a function. * gdb.base/step-bt.c: Call hello via function pointer to make sure its first instruction is executed on powerpc64le-linux. 2014-02-04 Ulrich Weigand * gdb.arch/powerpc-d128-regs.exp: Enable on powerpc64*-*. 2014-02-04 Ulrich Weigand * gdb.arch/vsx-regs.exp: Check target endianness. Provide variants of the test patterns for use on little-endian systems. 2014-02-04 Ulrich Weigand * gdb.arch/altivec-regs.exp: Use gdb_test_multiple for endian test. (decimal_vector): Fix for little-endian. Index: b/gdb/gdbarch.c =================================================================== --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -229,6 +229,7 @@ gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p; gdbarch_skip_prologue_ftype *skip_prologue; gdbarch_skip_main_prologue_ftype *skip_main_prologue; + gdbarch_skip_entrypoint_ftype *skip_entrypoint; gdbarch_inner_than_ftype *inner_than; gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc; @@ -402,6 +403,7 @@ default_return_in_first_hidden_param_p, /* return_in_first_hidden_param_p */ 0, /* skip_prologue */ 0, /* skip_main_prologue */ + 0, /* skip_entrypoint */ 0, /* inner_than */ 0, /* breakpoint_from_pc */ default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */ @@ -705,6 +707,7 @@ if (gdbarch->skip_prologue == 0) fprintf_unfiltered (log, "\n\tskip_prologue"); /* Skip verify of skip_main_prologue, has predicate. */ + /* Skip verify of skip_entrypoint, has predicate. */ if (gdbarch->inner_than == 0) fprintf_unfiltered (log, "\n\tinner_than"); if (gdbarch->breakpoint_from_pc == 0) @@ -1332,6 +1335,12 @@ "gdbarch_dump: single_step_through_delay = <%s>\n", host_address_to_string (gdbarch->single_step_through_delay)); fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n", + gdbarch_skip_entrypoint_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: skip_entrypoint = <%s>\n", + host_address_to_string (gdbarch->skip_entrypoint)); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n", gdbarch_skip_main_prologue_p (gdbarch)); fprintf_unfiltered (file, @@ -2682,6 +2691,30 @@ } int +gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->skip_entrypoint != NULL; +} + +CORE_ADDR +gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->skip_entrypoint != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_entrypoint called\n"); + return gdbarch->skip_entrypoint (gdbarch, ip); +} + +void +set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, + gdbarch_skip_entrypoint_ftype skip_entrypoint) +{ + gdbarch->skip_entrypoint = skip_entrypoint; +} + +int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) { gdb_assert (gdbarch != NULL); Index: b/gdb/gdbarch.h =================================================================== --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -486,6 +486,24 @@ extern CORE_ADDR gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); extern void set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, gdbarch_skip_main_prologue_ftype *skip_main_prologue); +/* On some platforms, a single function may provide multiple entry points, + e.g. one that is used for function-pointer calls and a different one + that is used for direct function calls. + In order to ensure that breakpoints set on the function will trigger + no matter via which entry point the function is entered, a platform + may provide the skip_entrypoint callback. It is called with IP set + to the main entry point of a function (as determined by the symbol table), + and should return the address of the innermost entry point, where the + actual breakpoint needs to be set. Note that skip_entrypoint is used + by GDB common code even when debugging optimized code, where skip_prologue + is not used. */ + +extern int gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch); + +typedef CORE_ADDR (gdbarch_skip_entrypoint_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip); +extern CORE_ADDR gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip); +extern void set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype *skip_entrypoint); + typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); Index: b/gdb/gdbarch.sh =================================================================== --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -530,6 +530,19 @@ m:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0 M:CORE_ADDR:skip_main_prologue:CORE_ADDR ip:ip +# On some platforms, a single function may provide multiple entry points, +# e.g. one that is used for function-pointer calls and a different one +# that is used for direct function calls. +# In order to ensure that breakpoints set on the function will trigger +# no matter via which entry point the function is entered, a platform +# may provide the skip_entrypoint callback. It is called with IP set +# to the main entry point of a function (as determined by the symbol table), +# and should return the address of the innermost entry point, where the +# actual breakpoint needs to be set. Note that skip_entrypoint is used +# by GDB common code even when debugging optimized code, where skip_prologue +# is not used. +M:CORE_ADDR:skip_entrypoint:CORE_ADDR ip:ip + f:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0 m:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0: # Return the adjusted address and kind to use for Z0/Z1 packets. Index: b/gdb/infrun.c =================================================================== --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3158,6 +3158,10 @@ ecs->stop_func_start += gdbarch_deprecated_function_start_offset (gdbarch); + if (gdbarch_skip_entrypoint_p (gdbarch)) + ecs->stop_func_start = gdbarch_skip_entrypoint (gdbarch, + ecs->stop_func_start); + ecs->stop_func_filled_in = 1; } } Index: b/gdb/ppc-linux-tdep.c =================================================================== --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -44,6 +44,7 @@ #include "observer.h" #include "auxv.h" #include "elf/common.h" +#include "elf/ppc64.h" #include "exceptions.h" #include "arch-utils.h" #include "spu-tdep.h" @@ -876,6 +877,55 @@ } } + +/* Implementation of `gdbarch_elf_make_msymbol_special', as defined in + gdbarch.h. This implementation is used for the ELFv2 ABI only. */ + +static void +ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) +{ + elf_symbol_type *elf_sym = (elf_symbol_type *)sym; + + /* If the symbol is marked as having a local entry point, set a target + flag in the msymbol. We currently only support local entry point + offsets of 8 bytes, which is the only entry point offset ever used + by current compilers. If/when other offsets are ever used, we will + have to use additional target flag bits to store them. */ + switch (PPC64_LOCAL_ENTRY_OFFSET (elf_sym->internal_elf_sym.st_other)) + { + default: + break; + case 8: + MSYMBOL_TARGET_FLAG_1 (msym) = 1; + break; + } +} + +/* Implementation of `gdbarch_skip_entrypoint', as defined in + gdbarch.h. This implementation is used for the ELFv2 ABI only. */ + +static CORE_ADDR +ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + struct bound_minimal_symbol fun; + int local_entry_offset = 0; + + fun = lookup_minimal_symbol_by_pc (pc); + if (fun.minsym == NULL) + return pc; + + /* See ppc_elfv2_elf_make_msymbol_special for how local entry point + offset values are encoded. */ + if (MSYMBOL_TARGET_FLAG_1 (fun.minsym)) + local_entry_offset = 8; + + if (SYMBOL_VALUE_ADDRESS (fun.minsym) <= pc + && pc < SYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset) + return SYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset; + + return pc; +} + /* Implementation of `gdbarch_stap_is_single_operand', as defined in gdbarch.h. */ @@ -1339,13 +1389,23 @@ if (tdep->wordsize == 8) { - /* Handle PPC GNU/Linux 64-bit function pointers (which are really - function descriptors). */ - set_gdbarch_convert_from_func_ptr_addr - (gdbarch, ppc64_convert_from_func_ptr_addr); + if (tdep->elf_abi == POWERPC_ELF_V1) + { + /* Handle PPC GNU/Linux 64-bit function pointers (which are really + function descriptors). */ + set_gdbarch_convert_from_func_ptr_addr + (gdbarch, ppc64_convert_from_func_ptr_addr); + + set_gdbarch_elf_make_msymbol_special + (gdbarch, ppc64_elf_make_msymbol_special); + } + else + { + set_gdbarch_elf_make_msymbol_special + (gdbarch, ppc_elfv2_elf_make_msymbol_special); - set_gdbarch_elf_make_msymbol_special (gdbarch, - ppc64_elf_make_msymbol_special); + set_gdbarch_skip_entrypoint (gdbarch, ppc_elfv2_skip_entrypoint); + } /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); Index: b/gdb/ppc-sysv-tdep.c =================================================================== --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -609,8 +609,7 @@ return sp; } -/* Handle the return-value conventions for Decimal Floating Point values - in both ppc32 and ppc64, which are the same. */ +/* Handle the return-value conventions for Decimal Floating Point values. */ static int get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, @@ -1102,80 +1101,471 @@ return 1; } -/* Push a float in either registers, or in the stack. Using the ppc 64 bit - SysV ABI. +/* Walk down the type tree of TYPE counting consecutive base elements. + If *FIELD_TYPE is NULL, then set it to the first valid floating point + or vector type. If a non-floating point or vector type is found, or + if a floating point or vector type that doesn't match a non-NULL + *FIELD_TYPE is found, then return -1, otherwise return the count in the + sub-tree. */ + +static LONGEST +ppc64_aggregate_candidate (struct type *type, + struct type **field_type) +{ + type = check_typedef (type); - This implements a dumbed down version of the ABI. It always writes - values to memory, GPR and FPR, even when not necessary. Doing this - greatly simplifies the logic. */ + switch (TYPE_CODE (type)) + { + case TYPE_CODE_FLT: + case TYPE_CODE_DECFLOAT: + if (!*field_type) + *field_type = type; + if (TYPE_CODE (*field_type) == TYPE_CODE (type) + && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) + return 1; + break; + + case TYPE_CODE_COMPLEX: + type = TYPE_TARGET_TYPE (type); + if (TYPE_CODE (type) == TYPE_CODE_FLT + || TYPE_CODE (type) == TYPE_CODE_DECFLOAT) + { + if (!*field_type) + *field_type = type; + if (TYPE_CODE (*field_type) == TYPE_CODE (type) + && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) + return 2; + } + break; + + case TYPE_CODE_ARRAY: + if (TYPE_VECTOR (type)) + { + if (!*field_type) + *field_type = type; + if (TYPE_CODE (*field_type) == TYPE_CODE (type) + && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) + return 1; + } + else + { + LONGEST count, low_bound, high_bound; + + count = ppc64_aggregate_candidate + (TYPE_TARGET_TYPE (type), field_type); + if (count == -1) + return -1; + + if (!get_array_bounds (type, &low_bound, &high_bound)) + return -1; + count *= high_bound - low_bound; + + /* There must be no padding. */ + if (count == 0) + return TYPE_LENGTH (type) == 0 ? 0 : -1; + else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type)) + return -1; + + return count; + } + break; + + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + { + LONGEST count = 0; + int i; + + for (i = 0; i < TYPE_NFIELDS (type); i++) + { + LONGEST sub_count; + + if (field_is_static (&TYPE_FIELD (type, i))) + continue; + + sub_count = ppc64_aggregate_candidate + (TYPE_FIELD_TYPE (type, i), field_type); + if (sub_count == -1) + return -1; + + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + count += sub_count; + else + count = max (count, sub_count); + } + + /* There must be no padding. */ + if (count == 0) + return TYPE_LENGTH (type) == 0 ? 0 : -1; + else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type)) + return -1; + + return count; + } + break; + + default: + break; + } + + return -1; +} + +/* If an argument of type TYPE is a homogeneous float or vector aggregate + that shall be passed in FP/vector registers according to the ELFv2 ABI, + return the homogeneous element type in *ELT_TYPE and the number of + elements in *N_ELTS, and return non-zero. Otherwise, return zero. */ + +static int +ppc64_elfv2_abi_homogeneous_aggregate (struct type *type, + struct type **elt_type, int *n_elts) +{ + /* Complex types at the top level are treated separately. However, + complex types can be elements of homogeneous aggregates. */ + if (TYPE_CODE (type) == TYPE_CODE_STRUCT + || TYPE_CODE (type) == TYPE_CODE_UNION + || (TYPE_CODE (type) == TYPE_CODE_ARRAY && !TYPE_VECTOR (type))) + { + struct type *field_type = NULL; + LONGEST field_count = ppc64_aggregate_candidate (type, &field_type); + + if (field_count > 0) + { + int n_regs = ((TYPE_CODE (field_type) == TYPE_CODE_FLT + || TYPE_CODE (field_type) == TYPE_CODE_DECFLOAT)? + (TYPE_LENGTH (field_type) + 7) >> 3 : 1); + + /* The ELFv2 ABI allows homogeneous aggregates to occupy + up to 8 registers. */ + if (field_count * n_regs <= 8) + { + if (elt_type) + *elt_type = field_type; + if (n_elts) + *n_elts = (int) field_count; + /* Note that field_count is LONGEST since it may hold the size + of an array, while *n_elts is int since its value is bounded + by the number of registers used for argument passing. The + cast cannot overflow due to the bounds checking above. */ + return 1; + } + } + } + + return 0; +} + +/* Structure holding the next argument position. */ +struct ppc64_sysv_argpos + { + /* Register cache holding argument registers. If this is NULL, + we only simulate argument processing without actually updating + any registers or memory. */ + struct regcache *regcache; + /* Next available general-purpose argument register. */ + int greg; + /* Next available floating-point argument register. */ + int freg; + /* Next available vector argument register. */ + int vreg; + /* The address, at which the next general purpose parameter + (integer, struct, float, vector, ...) should be saved. */ + CORE_ADDR gparam; + /* The address, at which the next by-reference parameter + (non-Altivec vector, variably-sized type) should be saved. */ + CORE_ADDR refparam; + }; + +/* VAL is a value of length LEN. Store it into the argument area on the + stack and load it into the corresponding general-purpose registers + required by the ABI, and update ARGPOS. + + If ALIGN is nonzero, it specifies the minimum alignment required + for the on-stack copy of the argument. */ static void -ppc64_sysv_abi_push_float (struct gdbarch *gdbarch, struct regcache *regcache, - struct gdbarch_tdep *tdep, struct type *type, - const bfd_byte *val, int freg, int greg, - CORE_ADDR gparam) +ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, + const bfd_byte *val, int len, int align, + struct ppc64_sysv_argpos *argpos) { - gdb_byte regval[MAX_REGISTER_SIZE]; - const gdb_byte *p; + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + int offset = 0; - if (TYPE_LENGTH (type) <= 8) + /* Enforce alignment of stack location, if requested. */ + if (align > tdep->wordsize) { - /* Version 1.7 of the 64-bit PowerPC ELF ABI says: + CORE_ADDR aligned_gparam = align_up (argpos->gparam, align); + + argpos->greg += (aligned_gparam - argpos->gparam) / tdep->wordsize; + argpos->gparam = aligned_gparam; + } - "Single precision floating point values are mapped to - the first word in a single doubleword." + /* The ABI (version 1.9) specifies that values smaller than one + doubleword are right-aligned and those larger are left-aligned. + GCC versions before 3.4 implemented this incorrectly; see + . */ + if (len < tdep->wordsize + && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = tdep->wordsize - len; - And version 1.9 says: + if (argpos->regcache) + write_memory (argpos->gparam + offset, val, len); + argpos->gparam = align_up (argpos->gparam + len, tdep->wordsize); - "Single precision floating point values are mapped to - the second word in a single doubleword." + while (len >= tdep->wordsize) + { + if (argpos->regcache && argpos->greg <= 10) + regcache_cooked_write (argpos->regcache, + tdep->ppc_gp0_regnum + argpos->greg, val); + argpos->greg++; + len -= tdep->wordsize; + val += tdep->wordsize; + } - GDB then writes single precision floating point values - at both words in a doubleword, to support both ABIs. */ - if (TYPE_LENGTH (type) == 4) + if (len > 0) + { + if (argpos->regcache && argpos->greg <= 10) + regcache_cooked_write_part (argpos->regcache, + tdep->ppc_gp0_regnum + argpos->greg, + offset, len, val); + argpos->greg++; + } +} + +/* The same as ppc64_sysv_abi_push_val, but using a single-word integer + value VAL as argument. */ + +static void +ppc64_sysv_abi_push_integer (struct gdbarch *gdbarch, ULONGEST val, + struct ppc64_sysv_argpos *argpos) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + gdb_byte buf[MAX_REGISTER_SIZE]; + + if (argpos->regcache) + store_unsigned_integer (buf, tdep->wordsize, byte_order, val); + ppc64_sysv_abi_push_val (gdbarch, buf, tdep->wordsize, 0, argpos); +} + +/* VAL is a value of TYPE, a (binary or decimal) floating-point type. + Load it into a floating-point register if required by the ABI, + and update ARGPOS. */ + +static void +ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, + struct type *type, const bfd_byte *val, + struct ppc64_sysv_argpos *argpos) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + if (tdep->soft_float) + return; + + if (TYPE_LENGTH (type) <= 8 + && TYPE_CODE (type) == TYPE_CODE_FLT) + { + /* Floats and doubles go in f1 .. f13. 32-bit floats are converted + to double first. */ + if (argpos->regcache && argpos->freg <= 13) { - memcpy (regval, val, 4); - memcpy (regval + 4, val, 4); - p = regval; + int regnum = tdep->ppc_fp0_regnum + argpos->freg; + struct type *regtype = register_type (gdbarch, regnum); + gdb_byte regval[MAX_REGISTER_SIZE]; + + convert_typed_floating (val, type, regval, regtype); + regcache_cooked_write (argpos->regcache, regnum, regval); } - else - p = val; - /* Write value in the stack's parameter save area. */ - write_memory (gparam, p, 8); + argpos->freg++; + } + else if (TYPE_LENGTH (type) <= 8 + && TYPE_CODE (type) == TYPE_CODE_DECFLOAT) + { + /* Floats and doubles go in f1 .. f13. 32-bit decimal floats are + placed in the least significant word. */ + if (argpos->regcache && argpos->freg <= 13) + { + int regnum = tdep->ppc_fp0_regnum + argpos->freg; + int offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (type); + + regcache_cooked_write_part (argpos->regcache, regnum, + offset, TYPE_LENGTH (type), val); + } - /* Floats and Doubles go in f1 .. f13. They also consume a left aligned - GREG, and can end up in memory. */ - if (freg <= 13) + argpos->freg++; + } + else if (TYPE_LENGTH (type) == 16 + && TYPE_CODE (type) == TYPE_CODE_FLT + && (gdbarch_long_double_format (gdbarch) + == floatformats_ibm_long_double)) + { + /* IBM long double stored in two consecutive FPRs. */ + if (argpos->regcache && argpos->freg <= 13) { - struct type *regtype; + int regnum = tdep->ppc_fp0_regnum + argpos->freg; - regtype = register_type (gdbarch, tdep->ppc_fp0_regnum + freg); - convert_typed_floating (val, type, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + freg, regval); + regcache_cooked_write (argpos->regcache, regnum, val); + if (argpos->freg <= 12) + regcache_cooked_write (argpos->regcache, regnum + 1, val + 8); + } + + argpos->freg += 2; + } + else if (TYPE_LENGTH (type) == 16 + && TYPE_CODE (type) == TYPE_CODE_DECFLOAT) + { + /* 128-bit decimal floating-point values are stored in and even/odd + pair of FPRs, with the even FPR holding the most significant half. */ + argpos->freg += argpos->freg & 1; + + if (argpos->regcache && argpos->freg <= 12) + { + int regnum = tdep->ppc_fp0_regnum + argpos->freg; + int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0; + int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; + + regcache_cooked_write (argpos->regcache, regnum, val + hipart); + regcache_cooked_write (argpos->regcache, regnum + 1, val + lopart); } - if (greg <= 10) - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + greg, regval); + + argpos->freg += 2; + } +} + +/* VAL is a value of AltiVec vector type. Load it into a vector register + if required by the ABI, and update ARGPOS. */ + +static void +ppc64_sysv_abi_push_vreg (struct gdbarch *gdbarch, const bfd_byte *val, + struct ppc64_sysv_argpos *argpos) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (argpos->regcache && argpos->vreg <= 13) + regcache_cooked_write (argpos->regcache, + tdep->ppc_vr0_regnum + argpos->vreg, val); + + argpos->vreg++; +} + +/* VAL is a value of TYPE. Load it into memory and/or registers + as required by the ABI, and update ARGPOS. */ + +static void +ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, + struct type *type, const bfd_byte *val, + struct ppc64_sysv_argpos *argpos) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (TYPE_CODE (type) == TYPE_CODE_FLT + || TYPE_CODE (type) == TYPE_CODE_DECFLOAT) + { + /* Floating-point scalars are passed in floating-point registers. */ + ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); + ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos); + } + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type) + && tdep->vector_abi == POWERPC_VEC_ALTIVEC + && TYPE_LENGTH (type) == 16) + { + /* AltiVec vectors are passed aligned, and in vector registers. */ + ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 16, argpos); + ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); + } + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type) + && TYPE_LENGTH (type) >= 16) + { + /* Non-Altivec vectors are passed by reference. */ + + /* Copy value onto the stack ... */ + CORE_ADDR addr = align_up (argpos->refparam, 16); + if (argpos->regcache) + write_memory (addr, val, TYPE_LENGTH (type)); + argpos->refparam = align_up (addr + TYPE_LENGTH (type), tdep->wordsize); + + /* ... and pass a pointer to the copy as parameter. */ + ppc64_sysv_abi_push_integer (gdbarch, addr, argpos); + } + else if ((TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_ENUM + || TYPE_CODE (type) == TYPE_CODE_BOOL + || TYPE_CODE (type) == TYPE_CODE_CHAR + || TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF) + && TYPE_LENGTH (type) <= tdep->wordsize) + { + ULONGEST word = 0; + + if (argpos->regcache) + { + /* Sign extend the value, then store it unsigned. */ + word = unpack_long (type, val); + + /* Convert any function code addresses into descriptors. */ + if (tdep->elf_abi == POWERPC_ELF_V1 + && (TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF)) + { + struct type *target_type + = check_typedef (TYPE_TARGET_TYPE (type)); + + if (TYPE_CODE (target_type) == TYPE_CODE_FUNC + || TYPE_CODE (target_type) == TYPE_CODE_METHOD) + { + CORE_ADDR desc = word; + + convert_code_addr_to_desc_addr (word, &desc); + word = desc; + } + } + } + + ppc64_sysv_abi_push_integer (gdbarch, word, argpos); } else { - /* IBM long double stored in two doublewords of the - parameter save area and corresponding registers. */ - if (!tdep->soft_float && freg <= 13) - { - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + freg, val); - if (freg <= 12) - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + freg + 1, - val + 8); - } - if (greg <= 10) - { - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + greg, val); - if (greg <= 9) - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + greg + 1, - val + 8); + ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); + + /* The ABI (version 1.9) specifies that structs containing a + single floating-point value, at any level of nesting of + single-member structs, are passed in floating-point registers. */ + if (TYPE_CODE (type) == TYPE_CODE_STRUCT + && TYPE_NFIELDS (type) == 1) + { + while (TYPE_CODE (type) == TYPE_CODE_STRUCT + && TYPE_NFIELDS (type) == 1) + type = check_typedef (TYPE_FIELD_TYPE (type, 0)); + + if (TYPE_CODE (type) == TYPE_CODE_FLT) + ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos); + } + + /* In the ELFv2 ABI, homogeneous floating-point or vector + aggregates are passed in a series of registers. */ + if (tdep->elf_abi == POWERPC_ELF_V2) + { + struct type *eltype; + int i, nelt; + + if (ppc64_elfv2_abi_homogeneous_aggregate (type, &eltype, &nelt)) + for (i = 0; i < nelt; i++) + { + const gdb_byte *elval = val + i * TYPE_LENGTH (eltype); + + if (TYPE_CODE (eltype) == TYPE_CODE_FLT + || TYPE_CODE (eltype) == TYPE_CODE_DECFLOAT) + ppc64_sysv_abi_push_freg (gdbarch, eltype, elval, argpos); + else if (TYPE_CODE (eltype) == TYPE_CODE_ARRAY + && TYPE_VECTOR (eltype) + && tdep->vector_abi == POWERPC_VEC_ALTIVEC + && TYPE_LENGTH (eltype) == 16) + ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); + } } - write_memory (gparam, val, TYPE_LENGTH (type)); } } @@ -1237,20 +1627,11 @@ for (write_pass = 0; write_pass < 2; write_pass++) { int argno; - /* Next available floating point register for float and double - arguments. */ - int freg = 1; - /* Next available general register for non-vector (but possibly - float) arguments. */ - int greg = 3; - /* Next available vector register for vector arguments. */ - int vreg = 2; - /* The address, at which the next general purpose parameter - (integer, struct, float, vector, ...) should be saved. */ - CORE_ADDR gparam; - /* The address, at which the next by-reference parameter - (non-Altivec vector, variably-sized type) should be saved. */ - CORE_ADDR refparam; + + struct ppc64_sysv_argpos argpos; + argpos.greg = 3; + argpos.freg = 1; + argpos.vreg = 2; if (!write_pass) { @@ -1258,19 +1639,25 @@ offsets (start address zero) than addresses. That way they accumulate the total stack space each region requires. */ - gparam = 0; - refparam = 0; + argpos.regcache = NULL; + argpos.gparam = 0; + argpos.refparam = 0; } else { /* Decrement the stack pointer making space for the Altivec and general on-stack parameters. Set refparam and gparam to their corresponding regions. */ - refparam = align_down (sp - refparam_size, 16); - gparam = align_down (refparam - gparam_size, 16); - /* Add in space for the TOC, link editor double word, - compiler double word, LR save area, CR save area. */ - sp = align_down (gparam - 48, 16); + argpos.regcache = regcache; + argpos.refparam = align_down (sp - refparam_size, 16); + argpos.gparam = align_down (argpos.refparam - gparam_size, 16); + /* Add in space for the TOC, link editor double word (v1 only), + compiler double word (v1 only), LR save area, CR save area, + and backchain. */ + if (tdep->elf_abi == POWERPC_ELF_V1) + sp = align_down (argpos.gparam - 48, 16); + else + sp = align_down (argpos.gparam - 32, 16); } /* If the function is returning a `struct', then there is an @@ -1279,14 +1666,7 @@ should advance one word and start from r4 register to copy parameters. This also consumes one on-stack parameter slot. */ if (struct_return) - { - if (write_pass) - regcache_cooked_write_signed (regcache, - tdep->ppc_gp0_regnum + greg, - struct_addr); - greg++; - gparam = align_up (gparam + tdep->wordsize, tdep->wordsize); - } + ppc64_sysv_abi_push_integer (gdbarch, struct_addr, &argpos); for (argno = 0; argno < nargs; argno++) { @@ -1294,432 +1674,54 @@ struct type *type = check_typedef (value_type (arg)); const bfd_byte *val = value_contents (arg); - if (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) <= 8) - { - if (write_pass) - ppc64_sysv_abi_push_float (gdbarch, regcache, tdep, type, - val, freg, greg, gparam); - - freg++; - greg++; - /* Always consume parameter stack space. */ - gparam = align_up (gparam + 8, tdep->wordsize); - } - else if (TYPE_CODE (type) == TYPE_CODE_FLT - && TYPE_LENGTH (type) == 16 - && (gdbarch_long_double_format (gdbarch) - == floatformats_ibm_long_double)) - { - if (write_pass) - ppc64_sysv_abi_push_float (gdbarch, regcache, tdep, type, - val, freg, greg, gparam); - freg += 2; - greg += 2; - gparam = align_up (gparam + TYPE_LENGTH (type), tdep->wordsize); - } - else if (TYPE_CODE (type) == TYPE_CODE_COMPLEX - && (TYPE_LENGTH (type) == 8 || TYPE_LENGTH (type) == 16)) - { - int i; - - for (i = 0; i < 2; i++) - { - if (write_pass) - { - struct type *target_type; - - target_type = check_typedef (TYPE_TARGET_TYPE (type)); - ppc64_sysv_abi_push_float (gdbarch, regcache, tdep, - target_type, val + i * - TYPE_LENGTH (target_type), - freg, greg, gparam); - } - freg++; - greg++; - /* Always consume parameter stack space. */ - gparam = align_up (gparam + 8, tdep->wordsize); - } - } - else if (TYPE_CODE (type) == TYPE_CODE_COMPLEX - && TYPE_LENGTH (type) == 32 - && (gdbarch_long_double_format (gdbarch) - == floatformats_ibm_long_double)) - { - int i; - - for (i = 0; i < 2; i++) - { - struct type *target_type; - - target_type = check_typedef (TYPE_TARGET_TYPE (type)); - if (write_pass) - ppc64_sysv_abi_push_float (gdbarch, regcache, tdep, - target_type, val + i * - TYPE_LENGTH (target_type), - freg, greg, gparam); - freg += 2; - greg += 2; - gparam = align_up (gparam + TYPE_LENGTH (target_type), - tdep->wordsize); - } - } - else if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT - && TYPE_LENGTH (type) <= 8) - { - /* 32-bit and 64-bit decimal floats go in f1 .. f13. They can - end up in memory. */ - if (write_pass) - { - gdb_byte regval[MAX_REGISTER_SIZE]; - const gdb_byte *p; - - /* 32-bit decimal floats are right aligned in the - doubleword. */ - if (TYPE_LENGTH (type) == 4) - { - memcpy (regval + 4, val, 4); - p = regval; - } - else - p = val; - - /* Write value in the stack's parameter save area. */ - write_memory (gparam, p, 8); - - if (freg <= 13) - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, p); - } - - freg++; - greg++; - /* Always consume parameter stack space. */ - gparam = align_up (gparam + 8, tdep->wordsize); - } - else if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && - TYPE_LENGTH (type) == 16) + if (TYPE_CODE (type) == TYPE_CODE_COMPLEX) { - /* 128-bit decimal floats go in f2 .. f12, always in even/odd - pairs. They can end up in memory, using two doublewords. */ - if (write_pass) - { - if (freg <= 12) - { - /* Make sure freg is even. */ - freg += freg & 1; - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, val); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg + 1, val + 8); - } - - write_memory (gparam, val, TYPE_LENGTH (type)); - } + /* Complex types are passed as if two independent scalars. */ + struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - freg += 2; - greg += 2; - gparam = align_up (gparam + TYPE_LENGTH (type), tdep->wordsize); + ppc64_sysv_abi_push_param (gdbarch, eltype, val, &argpos); + ppc64_sysv_abi_push_param (gdbarch, eltype, + val + TYPE_LENGTH (eltype), &argpos); } - else if (TYPE_LENGTH (type) < 16 - && TYPE_CODE (type) == TYPE_CODE_ARRAY - && TYPE_VECTOR (type) + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && opencl_abi) { /* OpenCL vectors shorter than 16 bytes are passed as if - a series of independent scalars. */ - struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + a series of independent scalars; OpenCL vectors 16 bytes + or longer are passed as if a series of AltiVec vectors. */ + struct type *eltype; + int i, nelt; + + if (TYPE_LENGTH (type) < 16) + eltype = check_typedef (TYPE_TARGET_TYPE (type)); + else + eltype = register_type (gdbarch, tdep->ppc_vr0_regnum); + nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { const gdb_byte *elval = val + i * TYPE_LENGTH (eltype); - if (TYPE_CODE (eltype) == TYPE_CODE_FLT) - { - if (write_pass) - { - gdb_byte regval[MAX_REGISTER_SIZE]; - const gdb_byte *p; - - if (TYPE_LENGTH (eltype) == 4) - { - memcpy (regval, elval, 4); - memcpy (regval + 4, elval, 4); - p = regval; - } - else - p = elval; - - write_memory (gparam, p, 8); - - if (freg <= 13) - { - int regnum = tdep->ppc_fp0_regnum + freg; - struct type *regtype - = register_type (gdbarch, regnum); - - convert_typed_floating (elval, eltype, - regval, regtype); - regcache_cooked_write (regcache, regnum, regval); - } - - if (greg <= 10) - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg, - regval); - } - - freg++; - greg++; - gparam = align_up (gparam + 8, tdep->wordsize); - } - else - { - if (write_pass) - { - ULONGEST word = unpack_long (eltype, elval); - if (greg <= 10) - regcache_cooked_write_unsigned - (regcache, tdep->ppc_gp0_regnum + greg, word); - - write_memory_unsigned_integer - (gparam, tdep->wordsize, byte_order, word); - } - - greg++; - gparam = align_up (gparam + TYPE_LENGTH (eltype), - tdep->wordsize); - } - } - } - else if (TYPE_LENGTH (type) >= 16 - && TYPE_CODE (type) == TYPE_CODE_ARRAY - && TYPE_VECTOR (type) - && opencl_abi) - { - /* OpenCL vectors 16 bytes or longer are passed as if - a series of AltiVec vectors. */ - int i; - - for (i = 0; i < TYPE_LENGTH (type) / 16; i++) - { - const gdb_byte *elval = val + i * 16; - - gparam = align_up (gparam, 16); - greg += greg & 1; - - if (write_pass) - { - if (vreg <= 13) - regcache_cooked_write (regcache, - tdep->ppc_vr0_regnum + vreg, - elval); - - write_memory (gparam, elval, 16); - } - - greg += 2; - vreg++; - gparam += 16; - } - } - else if (TYPE_LENGTH (type) == 16 && TYPE_VECTOR (type) - && TYPE_CODE (type) == TYPE_CODE_ARRAY - && tdep->vector_abi == POWERPC_VEC_ALTIVEC) - { - /* In the Altivec ABI, vectors go in the vector registers - v2 .. v13, as well as the parameter area -- always at - 16-byte aligned addresses. */ - - gparam = align_up (gparam, 16); - greg += greg & 1; - - if (write_pass) - { - if (vreg <= 13) - regcache_cooked_write (regcache, - tdep->ppc_vr0_regnum + vreg, val); - - write_memory (gparam, val, TYPE_LENGTH (type)); - } - - greg += 2; - vreg++; - gparam += 16; - } - else if (TYPE_LENGTH (type) >= 16 && TYPE_VECTOR (type) - && TYPE_CODE (type) == TYPE_CODE_ARRAY) - { - /* Non-Altivec vectors are passed by reference. */ - - /* Copy value onto the stack ... */ - refparam = align_up (refparam, 16); - if (write_pass) - write_memory (refparam, val, TYPE_LENGTH (type)); - - /* ... and pass a pointer to the copy as parameter. */ - if (write_pass) - { - if (greg <= 10) - regcache_cooked_write_unsigned (regcache, - tdep->ppc_gp0_regnum + - greg, refparam); - write_memory_unsigned_integer (gparam, tdep->wordsize, - byte_order, refparam); + ppc64_sysv_abi_push_param (gdbarch, eltype, elval, &argpos); } - greg++; - gparam = align_up (gparam + tdep->wordsize, tdep->wordsize); - refparam = align_up (refparam + TYPE_LENGTH (type), tdep->wordsize); - } - else if ((TYPE_CODE (type) == TYPE_CODE_INT - || TYPE_CODE (type) == TYPE_CODE_ENUM - || TYPE_CODE (type) == TYPE_CODE_BOOL - || TYPE_CODE (type) == TYPE_CODE_CHAR - || TYPE_CODE (type) == TYPE_CODE_PTR - || TYPE_CODE (type) == TYPE_CODE_REF) - && TYPE_LENGTH (type) <= 8) - { - /* Scalars and Pointers get sign[un]extended and go in - gpr3 .. gpr10. They can also end up in memory. */ - if (write_pass) - { - /* Sign extend the value, then store it unsigned. */ - ULONGEST word = unpack_long (type, val); - /* Convert any function code addresses into - descriptors. */ - if (TYPE_CODE (type) == TYPE_CODE_PTR - || TYPE_CODE (type) == TYPE_CODE_REF) - { - struct type *target_type; - target_type = check_typedef (TYPE_TARGET_TYPE (type)); - - if (TYPE_CODE (target_type) == TYPE_CODE_FUNC - || TYPE_CODE (target_type) == TYPE_CODE_METHOD) - { - CORE_ADDR desc = word; - convert_code_addr_to_desc_addr (word, &desc); - word = desc; - } - } - if (greg <= 10) - regcache_cooked_write_unsigned (regcache, - tdep->ppc_gp0_regnum + - greg, word); - write_memory_unsigned_integer (gparam, tdep->wordsize, - byte_order, word); - } - greg++; - gparam = align_up (gparam + TYPE_LENGTH (type), tdep->wordsize); } else { - int byte; - for (byte = 0; byte < TYPE_LENGTH (type); - byte += tdep->wordsize) - { - if (write_pass && greg <= 10) - { - gdb_byte regval[MAX_REGISTER_SIZE]; - int len = TYPE_LENGTH (type) - byte; - if (len > tdep->wordsize) - len = tdep->wordsize; - memset (regval, 0, sizeof regval); - /* The ABI (version 1.9) specifies that values - smaller than one doubleword are right-aligned - and those larger are left-aligned. GCC - versions before 3.4 implemented this - incorrectly; see - . */ - if (byte == 0) - memcpy (regval + tdep->wordsize - len, - val + byte, len); - else - memcpy (regval, val + byte, len); - regcache_cooked_write (regcache, greg, regval); - } - greg++; - } - if (write_pass) - { - /* WARNING: cagney/2003-09-21: Strictly speaking, this - isn't necessary, unfortunately, GCC appears to get - "struct convention" parameter passing wrong putting - odd sized structures in memory instead of in a - register. Work around this by always writing the - value to memory. Fortunately, doing this - simplifies the code. */ - int len = TYPE_LENGTH (type); - if (len < tdep->wordsize) - write_memory (gparam + tdep->wordsize - len, val, len); - else - write_memory (gparam, val, len); - } - if (freg <= 13 - && TYPE_CODE (type) == TYPE_CODE_STRUCT - && TYPE_NFIELDS (type) == 1 - && TYPE_LENGTH (type) <= 16) - { - /* The ABI (version 1.9) specifies that structs - containing a single floating-point value, at any - level of nesting of single-member structs, are - passed in floating-point registers. */ - while (TYPE_CODE (type) == TYPE_CODE_STRUCT - && TYPE_NFIELDS (type) == 1) - type = check_typedef (TYPE_FIELD_TYPE (type, 0)); - if (TYPE_CODE (type) == TYPE_CODE_FLT) - { - if (TYPE_LENGTH (type) <= 8) - { - if (write_pass) - { - gdb_byte regval[MAX_REGISTER_SIZE]; - struct type *regtype - = register_type (gdbarch, - tdep->ppc_fp0_regnum); - convert_typed_floating (val, type, regval, - regtype); - regcache_cooked_write (regcache, - (tdep->ppc_fp0_regnum - + freg), - regval); - } - freg++; - } - else if (TYPE_LENGTH (type) == 16 - && (gdbarch_long_double_format (gdbarch) - == floatformats_ibm_long_double)) - { - if (write_pass) - { - regcache_cooked_write (regcache, - (tdep->ppc_fp0_regnum - + freg), - val); - if (freg <= 12) - regcache_cooked_write (regcache, - (tdep->ppc_fp0_regnum - + freg + 1), - val + 8); - } - freg += 2; - } - } - } - /* Always consume parameter stack space. */ - gparam = align_up (gparam + TYPE_LENGTH (type), tdep->wordsize); + /* All other types are passed as single arguments. */ + ppc64_sysv_abi_push_param (gdbarch, type, val, &argpos); } } if (!write_pass) { /* Save the true region sizes ready for the second pass. */ - refparam_size = refparam; + refparam_size = argpos.refparam; /* Make certain that the general parameter save area is at least the minimum 8 registers (or doublewords) in size. */ - if (greg < 8) + if (argpos.greg < 8) gparam_size = 8 * tdep->wordsize; else - gparam_size = gparam; + gparam_size = argpos.gparam; } } @@ -1733,28 +1735,179 @@ breakpoint. */ regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr); - /* Use the func_addr to find the descriptor, and use that to find - the TOC. If we're calling via a function pointer, the pointer - itself identifies the descriptor. */ - { - struct type *ftype = check_typedef (value_type (function)); - CORE_ADDR desc_addr = value_as_address (function); + /* In the ELFv1 ABI, use the func_addr to find the descriptor, and use + that to find the TOC. If we're calling via a function pointer, + the pointer itself identifies the descriptor. */ + if (tdep->elf_abi == POWERPC_ELF_V1) + { + struct type *ftype = check_typedef (value_type (function)); + CORE_ADDR desc_addr = value_as_address (function); - if (TYPE_CODE (ftype) == TYPE_CODE_PTR - || convert_code_addr_to_desc_addr (func_addr, &desc_addr)) - { - /* The TOC is the second double word in the descriptor. */ - CORE_ADDR toc = - read_memory_unsigned_integer (desc_addr + tdep->wordsize, - tdep->wordsize, byte_order); - regcache_cooked_write_unsigned (regcache, - tdep->ppc_gp0_regnum + 2, toc); - } - } + if (TYPE_CODE (ftype) == TYPE_CODE_PTR + || convert_code_addr_to_desc_addr (func_addr, &desc_addr)) + { + /* The TOC is the second double word in the descriptor. */ + CORE_ADDR toc = + read_memory_unsigned_integer (desc_addr + tdep->wordsize, + tdep->wordsize, byte_order); + + regcache_cooked_write_unsigned (regcache, + tdep->ppc_gp0_regnum + 2, toc); + } + } + + /* In the ELFv2 ABI, we need to pass the target address in r12 since + we may be calling a global entry point. */ + if (tdep->elf_abi == POWERPC_ELF_V2) + regcache_cooked_write_unsigned (regcache, + tdep->ppc_gp0_regnum + 12, func_addr); return sp; } +/* Subroutine of ppc64_sysv_abi_return_value that handles "base" types: + integer, floating-point, and AltiVec vector types. + + This routine also handles components of aggregate return types; + INDEX describes which part of the aggregate is to be handled. + + Returns true if VALTYPE is some such base type that could be handled, + false otherwise. */ +static int +ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, + struct regcache *regcache, gdb_byte *readbuf, + const gdb_byte *writebuf, int index) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* Integers live in GPRs starting at r3. */ + if ((TYPE_CODE (valtype) == TYPE_CODE_INT + || TYPE_CODE (valtype) == TYPE_CODE_ENUM + || TYPE_CODE (valtype) == TYPE_CODE_CHAR + || TYPE_CODE (valtype) == TYPE_CODE_BOOL) + && TYPE_LENGTH (valtype) <= 8) + { + int regnum = tdep->ppc_gp0_regnum + 3 + index; + + if (writebuf != NULL) + { + /* Be careful to sign extend the value. */ + regcache_cooked_write_unsigned (regcache, regnum, + unpack_long (valtype, writebuf)); + } + if (readbuf != NULL) + { + /* Extract the integer from GPR. Since this is truncating the + value, there isn't a sign extension problem. */ + ULONGEST regval; + + regcache_cooked_read_unsigned (regcache, regnum, ®val); + store_unsigned_integer (readbuf, TYPE_LENGTH (valtype), + gdbarch_byte_order (gdbarch), regval); + } + return 1; + } + + /* Floats and doubles go in f1 .. f13. 32-bit floats are converted + to double first. */ + if (TYPE_LENGTH (valtype) <= 8 + && TYPE_CODE (valtype) == TYPE_CODE_FLT) + { + int regnum = tdep->ppc_fp0_regnum + 1 + index; + struct type *regtype = register_type (gdbarch, regnum); + gdb_byte regval[MAX_REGISTER_SIZE]; + + if (writebuf != NULL) + { + convert_typed_floating (writebuf, valtype, regval, regtype); + regcache_cooked_write (regcache, regnum, regval); + } + if (readbuf != NULL) + { + regcache_cooked_read (regcache, regnum, regval); + convert_typed_floating (regval, regtype, readbuf, valtype); + } + return 1; + } + + /* Floats and doubles go in f1 .. f13. 32-bit decimal floats are + placed in the least significant word. */ + if (TYPE_LENGTH (valtype) <= 8 + && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) + { + int regnum = tdep->ppc_fp0_regnum + 1 + index; + int offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (valtype); + + if (writebuf != NULL) + regcache_cooked_write_part (regcache, regnum, + offset, TYPE_LENGTH (valtype), writebuf); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, regnum, + offset, TYPE_LENGTH (valtype), readbuf); + return 1; + } + + /* IBM long double stored in two consecutive FPRs. */ + if (TYPE_LENGTH (valtype) == 16 + && TYPE_CODE (valtype) == TYPE_CODE_FLT + && (gdbarch_long_double_format (gdbarch) + == floatformats_ibm_long_double)) + { + int regnum = tdep->ppc_fp0_regnum + 1 + 2 * index; + + if (writebuf != NULL) + { + regcache_cooked_write (regcache, regnum, writebuf); + regcache_cooked_write (regcache, regnum + 1, writebuf + 8); + } + if (readbuf != NULL) + { + regcache_cooked_read (regcache, regnum, readbuf); + regcache_cooked_read (regcache, regnum + 1, readbuf + 8); + } + return 1; + } + + /* 128-bit decimal floating-point values are stored in an even/odd + pair of FPRs, with the even FPR holding the most significant half. */ + if (TYPE_LENGTH (valtype) == 16 + && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) + { + int regnum = tdep->ppc_fp0_regnum + 2 + 2 * index; + int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0; + int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; + + if (writebuf != NULL) + { + regcache_cooked_write (regcache, regnum, writebuf + hipart); + regcache_cooked_write (regcache, regnum + 1, writebuf + lopart); + } + if (readbuf != NULL) + { + regcache_cooked_read (regcache, regnum, readbuf + hipart); + regcache_cooked_read (regcache, regnum + 1, readbuf + lopart); + } + return 1; + } + + /* AltiVec vectors are returned in VRs starting at v2. */ + if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype) + && tdep->vector_abi == POWERPC_VEC_ALTIVEC) + { + int regnum = tdep->ppc_vr0_regnum + 2 + index; + + if (writebuf != NULL) + regcache_cooked_write (regcache, regnum, writebuf); + if (readbuf != NULL) + regcache_cooked_read (regcache, regnum, readbuf); + return 1; + } + + return 0; +} /* The 64 bit ABI return value convention. @@ -1772,254 +1925,163 @@ gdb_byte *readbuf, const gdb_byte *writebuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = function ? value_type (function) : NULL; int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0; + struct type *eltype; + int nelt, i, ok; /* This function exists to support a calling convention that requires floating-point registers. It shouldn't be used on processors that lack them. */ gdb_assert (ppc_floating_point_unit_p (gdbarch)); - /* Floats and doubles in F1. */ - if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8) + /* Complex types are returned as if two independent scalars. */ + if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX) { - gdb_byte regval[MAX_REGISTER_SIZE]; - struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum); - if (writebuf != NULL) - { - convert_typed_floating (writebuf, valtype, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval); - } - if (readbuf != NULL) + eltype = check_typedef (TYPE_TARGET_TYPE (valtype)); + + for (i = 0; i < 2; i++) { - regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval); - convert_typed_floating (regval, regtype, readbuf, valtype); + ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache, + readbuf, writebuf, i); + gdb_assert (ok); + + if (readbuf) + readbuf += TYPE_LENGTH (eltype); + if (writebuf) + writebuf += TYPE_LENGTH (eltype); } return RETURN_VALUE_REGISTER_CONVENTION; } - if (TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) - return get_decimal_float_return_value (gdbarch, valtype, regcache, readbuf, - writebuf); - /* Integers in r3. */ - if ((TYPE_CODE (valtype) == TYPE_CODE_INT - || TYPE_CODE (valtype) == TYPE_CODE_ENUM - || TYPE_CODE (valtype) == TYPE_CODE_CHAR - || TYPE_CODE (valtype) == TYPE_CODE_BOOL) - && TYPE_LENGTH (valtype) <= 8) + + /* OpenCL vectors shorter than 16 bytes are returned as if + a series of independent scalars; OpenCL vectors 16 bytes + or longer are returned as if a series of AltiVec vectors. */ + if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype) + && opencl_abi) { - if (writebuf != NULL) - { - /* Be careful to sign extend the value. */ - regcache_cooked_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3, - unpack_long (valtype, writebuf)); - } - if (readbuf != NULL) + if (TYPE_LENGTH (valtype) < 16) + eltype = check_typedef (TYPE_TARGET_TYPE (valtype)); + else + eltype = register_type (gdbarch, tdep->ppc_vr0_regnum); + + nelt = TYPE_LENGTH (valtype) / TYPE_LENGTH (eltype); + for (i = 0; i < nelt; i++) { - /* Extract the integer from r3. Since this is truncating the - value, there isn't a sign extension problem. */ - ULONGEST regval; - regcache_cooked_read_unsigned (regcache, tdep->ppc_gp0_regnum + 3, - ®val); - store_unsigned_integer (readbuf, TYPE_LENGTH (valtype), byte_order, - regval); + ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache, + readbuf, writebuf, i); + gdb_assert (ok); + + if (readbuf) + readbuf += TYPE_LENGTH (eltype); + if (writebuf) + writebuf += TYPE_LENGTH (eltype); } return RETURN_VALUE_REGISTER_CONVENTION; } + /* All pointers live in r3. */ if (TYPE_CODE (valtype) == TYPE_CODE_PTR || TYPE_CODE (valtype) == TYPE_CODE_REF) { - /* All pointers live in r3. */ + int regnum = tdep->ppc_gp0_regnum + 3; + if (writebuf != NULL) - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf); + regcache_cooked_write (regcache, regnum, writebuf); if (readbuf != NULL) - regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf); + regcache_cooked_read (regcache, regnum, readbuf); return RETURN_VALUE_REGISTER_CONVENTION; } - /* OpenCL vectors < 16 bytes are returned as distinct - scalars in f1..f2 or r3..r10. */ + + /* Small character arrays are returned, right justified, in r3. */ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY - && TYPE_VECTOR (valtype) - && TYPE_LENGTH (valtype) < 16 - && opencl_abi) + && TYPE_LENGTH (valtype) <= 8 + && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT + && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) { - struct type *eltype = check_typedef (TYPE_TARGET_TYPE (valtype)); - int i, nelt = TYPE_LENGTH (valtype) / TYPE_LENGTH (eltype); + int regnum = tdep->ppc_gp0_regnum + 3; + int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); + + if (writebuf != NULL) + regcache_cooked_write_part (regcache, regnum, + offset, TYPE_LENGTH (valtype), writebuf); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, regnum, + offset, TYPE_LENGTH (valtype), readbuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + /* In the ELFv2 ABI, homogeneous floating-point or vector + aggregates are returned in registers. */ + if (tdep->elf_abi == POWERPC_ELF_V2 + && ppc64_elfv2_abi_homogeneous_aggregate (valtype, &eltype, &nelt)) + { for (i = 0; i < nelt; i++) { - int offset = i * TYPE_LENGTH (eltype); - - if (TYPE_CODE (eltype) == TYPE_CODE_FLT) - { - int regnum = tdep->ppc_fp0_regnum + 1 + i; - gdb_byte regval[MAX_REGISTER_SIZE]; - struct type *regtype = register_type (gdbarch, regnum); - - if (writebuf != NULL) - { - convert_typed_floating (writebuf + offset, eltype, - regval, regtype); - regcache_cooked_write (regcache, regnum, regval); - } - if (readbuf != NULL) - { - regcache_cooked_read (regcache, regnum, regval); - convert_typed_floating (regval, regtype, - readbuf + offset, eltype); - } - } - else - { - int regnum = tdep->ppc_gp0_regnum + 3 + i; - ULONGEST regval; - - if (writebuf != NULL) - { - regval = unpack_long (eltype, writebuf + offset); - regcache_cooked_write_unsigned (regcache, regnum, regval); - } - if (readbuf != NULL) - { - regcache_cooked_read_unsigned (regcache, regnum, ®val); - store_unsigned_integer (readbuf + offset, - TYPE_LENGTH (eltype), byte_order, - regval); - } - } + ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache, + readbuf, writebuf, i); + gdb_assert (ok); + + if (readbuf) + readbuf += TYPE_LENGTH (eltype); + if (writebuf) + writebuf += TYPE_LENGTH (eltype); } return RETURN_VALUE_REGISTER_CONVENTION; } - /* OpenCL vectors >= 16 bytes are returned in v2..v9. */ - if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY - && TYPE_VECTOR (valtype) - && TYPE_LENGTH (valtype) >= 16 - && opencl_abi) + + /* In the ELFv2 ABI, aggregate types of up to 16 bytes are + returned in registers r3:r4. */ + if (tdep->elf_abi == POWERPC_ELF_V2 + && TYPE_LENGTH (valtype) <= 16 + && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT + || TYPE_CODE (valtype) == TYPE_CODE_UNION + || (TYPE_CODE (valtype) == TYPE_CODE_ARRAY + && !TYPE_VECTOR (valtype)))) { - int n_regs = TYPE_LENGTH (valtype) / 16; + int n_regs = ((TYPE_LENGTH (valtype) + tdep->wordsize - 1) + / tdep->wordsize); int i; for (i = 0; i < n_regs; i++) { - int offset = i * 16; - int regnum = tdep->ppc_vr0_regnum + 2 + i; + gdb_byte regval[MAX_REGISTER_SIZE]; + int regnum = tdep->ppc_gp0_regnum + 3 + i; + int offset = i * tdep->wordsize; + int len = TYPE_LENGTH (valtype) - offset; - if (writebuf != NULL) - regcache_cooked_write (regcache, regnum, writebuf + offset); - if (readbuf != NULL) - regcache_cooked_read (regcache, regnum, readbuf + offset); - } + if (len > tdep->wordsize) + len = tdep->wordsize; - return RETURN_VALUE_REGISTER_CONVENTION; - } - /* Array type has more than one use. */ - if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY) - { - /* Small character arrays are returned, right justified, in r3. */ - if (TYPE_LENGTH (valtype) <= 8 - && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT - && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) - { - int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) - - TYPE_LENGTH (valtype)); - if (writebuf != NULL) - regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), writebuf); - if (readbuf != NULL) - regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), readbuf); - return RETURN_VALUE_REGISTER_CONVENTION; - } - /* A VMX vector is returned in v2. */ - if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY - && TYPE_VECTOR (valtype) - && tdep->vector_abi == POWERPC_VEC_ALTIVEC) - { - if (readbuf) - regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf); - if (writebuf) - regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, - writebuf); - return RETURN_VALUE_REGISTER_CONVENTION; - } - } - /* Big floating point values get stored in adjacent floating - point registers, starting with F1. */ - if (TYPE_CODE (valtype) == TYPE_CODE_FLT - && (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32)) - { - if (writebuf || readbuf != NULL) - { - int i; - for (i = 0; i < TYPE_LENGTH (valtype) / 8; i++) - { - if (writebuf != NULL) - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1 + i, - (const bfd_byte *) writebuf + i * 8); - if (readbuf != NULL) - regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i, - (bfd_byte *) readbuf + i * 8); - } - } - return RETURN_VALUE_REGISTER_CONVENTION; - } - /* Complex values get returned in f1:f2, need to convert. */ - if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX - && (TYPE_LENGTH (valtype) == 8 || TYPE_LENGTH (valtype) == 16)) - { - if (regcache != NULL) - { - int i; - for (i = 0; i < 2; i++) + if (writebuf != NULL) { - gdb_byte regval[MAX_REGISTER_SIZE]; - struct type *regtype = - register_type (gdbarch, tdep->ppc_fp0_regnum); - struct type *target_type; - target_type = check_typedef (TYPE_TARGET_TYPE (valtype)); - if (writebuf != NULL) - { - convert_typed_floating ((const bfd_byte *) writebuf + - i * TYPE_LENGTH (target_type), - target_type, regval, regtype); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + 1 + i, - regval); - } - if (readbuf != NULL) - { - regcache_cooked_read (regcache, - tdep->ppc_fp0_regnum + 1 + i, - regval); - convert_typed_floating (regval, regtype, - (bfd_byte *) readbuf + - i * TYPE_LENGTH (target_type), - target_type); - } + memset (regval, 0, sizeof regval); + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG + && offset == 0) + memcpy (regval + tdep->wordsize - len, writebuf, len); + else + memcpy (regval, writebuf + offset, len); + regcache_cooked_write (regcache, regnum, regval); } - } - return RETURN_VALUE_REGISTER_CONVENTION; - } - /* Big complex values get stored in f1:f4. */ - if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX && TYPE_LENGTH (valtype) == 32) - { - if (regcache != NULL) - { - int i; - for (i = 0; i < 4; i++) + if (readbuf != NULL) { - if (writebuf != NULL) - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1 + i, - (const bfd_byte *) writebuf + i * 8); - if (readbuf != NULL) - regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i, - (bfd_byte *) readbuf + i * 8); + regcache_cooked_read (regcache, regnum, regval); + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG + && offset == 0) + memcpy (readbuf, regval + tdep->wordsize - len, len); + else + memcpy (readbuf + offset, regval, len); } } return RETURN_VALUE_REGISTER_CONVENTION; } + + /* Handle plain base types. */ + if (ppc64_sysv_abi_return_value_base (gdbarch, valtype, regcache, + readbuf, writebuf, 0)) + return RETURN_VALUE_REGISTER_CONVENTION; + return RETURN_VALUE_STRUCT_CONVENTION; } Index: b/gdb/ppc-tdep.h =================================================================== --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -182,6 +182,15 @@ /* Private data that this module attaches to struct gdbarch. */ +/* ELF ABI version used by the inferior. */ +enum powerpc_elf_abi +{ + POWERPC_ELF_AUTO, + POWERPC_ELF_V1, + POWERPC_ELF_V2, + POWERPC_ELF_LAST +}; + /* Vector ABI used by the inferior. */ enum powerpc_vector_abi { @@ -197,6 +206,8 @@ int wordsize; /* Size in bytes of fixed-point word. */ int soft_float; /* Avoid FP registers for arguments? */ + enum powerpc_elf_abi elf_abi; /* ELF ABI version. */ + /* How to pass vector arguments. Never set to AUTO or LAST. */ enum powerpc_vector_abi vector_abi; Index: b/gdb/rs6000-tdep.c =================================================================== --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -48,6 +48,7 @@ #include "elf-bfd.h" #include "elf/ppc.h" +#include "elf/ppc64.h" #include "solib-svr4.h" #include "ppc-tdep.h" @@ -2672,10 +2673,10 @@ else { status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum + - 2 * reg_index + 1, buffer + 8); + 2 * reg_index + 1, buffer); if (status == REG_VALID) status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum + - 2 * reg_index, buffer); + 2 * reg_index, buffer + 8); } return status; @@ -2701,9 +2702,9 @@ else { regcache_raw_write (regcache, tdep->ppc_fp0_regnum + - 2 * reg_index + 1, buffer + 8); + 2 * reg_index + 1, buffer); regcache_raw_write (regcache, tdep->ppc_fp0_regnum + - 2 * reg_index, buffer); + 2 * reg_index, buffer + 8); } } @@ -2779,10 +2780,12 @@ { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int reg_index = reg_nr - tdep->ppc_efpr0_regnum; + int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; /* Read the portion that overlaps the VMX register. */ - return regcache_raw_read_part (regcache, tdep->ppc_vr0_regnum + reg_index, 0, - register_size (gdbarch, reg_nr), buffer); + return regcache_raw_read_part (regcache, tdep->ppc_vr0_regnum + reg_index, + offset, register_size (gdbarch, reg_nr), + buffer); } /* Write method for POWER7 Extended FP pseudo-registers. */ @@ -2792,10 +2795,12 @@ { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int reg_index = reg_nr - tdep->ppc_efpr0_regnum; + int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; /* Write the portion that overlaps the VMX register. */ - regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index, 0, - register_size (gdbarch, reg_nr), buffer); + regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index, + offset, register_size (gdbarch, reg_nr), + buffer); } static enum register_status @@ -3550,6 +3555,7 @@ enum auto_boolean soft_float_flag = powerpc_soft_float_global; int soft_float; enum powerpc_vector_abi vector_abi = powerpc_vector_abi_global; + enum powerpc_elf_abi elf_abi = POWERPC_ELF_AUTO; int have_fpu = 1, have_spe = 0, have_mq = 0, have_altivec = 0, have_dfp = 0, have_vsx = 0; int tdesc_wordsize = -1; @@ -3856,6 +3862,21 @@ } #ifdef HAVE_ELF + if (from_elf_exec) + { + switch (elf_elfheader (info.abfd)->e_flags & EF_PPC64_ABI) + { + case 1: + elf_abi = POWERPC_ELF_V1; + break; + case 2: + elf_abi = POWERPC_ELF_V2; + break; + default: + break; + } + } + if (soft_float_flag == AUTO_BOOLEAN_AUTO && from_elf_exec) { switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, @@ -3892,6 +3913,21 @@ } #endif + /* At this point, the only supported ELF-based 64-bit little-endian + operating system is GNU/Linux, and this uses the ELFv2 ABI by + default. All other supported ELF-based operating systems use the + ELFv1 ABI by default. Therefore, if the ABI marker is missing, + e.g. because we run a legacy binary, or have attached to a process + and have not found any associated binary file, set the default + according to this heuristic. */ + if (elf_abi == POWERPC_ELF_AUTO) + { + if (wordsize == 8 && info.byte_order == BFD_ENDIAN_LITTLE) + elf_abi = POWERPC_ELF_V2; + else + elf_abi = POWERPC_ELF_V1; + } + if (soft_float_flag == AUTO_BOOLEAN_TRUE) soft_float = 1; else if (soft_float_flag == AUTO_BOOLEAN_FALSE) @@ -3934,6 +3970,8 @@ meaningful, because 64-bit CPUs can run in 32-bit mode. So, perform separate word size check. */ tdep = gdbarch_tdep (arches->gdbarch); + if (tdep && tdep->elf_abi != elf_abi) + continue; if (tdep && tdep->soft_float != soft_float) continue; if (tdep && tdep->vector_abi != vector_abi) @@ -3956,6 +3994,7 @@ tdep = XCALLOC (1, struct gdbarch_tdep); tdep->wordsize = wordsize; + tdep->elf_abi = elf_abi; tdep->soft_float = soft_float; tdep->vector_abi = vector_abi; Index: b/gdb/symtab.c =================================================================== --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2934,6 +2934,8 @@ /* Skip "first line" of function (which is actually its prologue). */ pc += gdbarch_deprecated_function_start_offset (gdbarch); + if (gdbarch_skip_entrypoint_p (gdbarch)) + pc = gdbarch_skip_entrypoint (gdbarch, pc); if (skip) pc = gdbarch_skip_prologue (gdbarch, pc); Index: b/gdb/testsuite/gdb.arch/altivec-regs.exp =================================================================== --- a/gdb/testsuite/gdb.arch/altivec-regs.exp +++ b/gdb/testsuite/gdb.arch/altivec-regs.exp @@ -79,17 +79,16 @@ gdb_test "next" "" "" -send_gdb "show endian\n" set endianness "" -gdb_expect { +set msg "detect endianness" +gdb_test_multiple "show endian" "$msg" { -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" { - pass "endianness" - set endianness $expect_out(2,string) + pass "$msg" + set endianness $expect_out(2,string) } -re ".*$gdb_prompt $" { - fail "couldn't get endianness" + fail "$msg" } - timeout { fail "(timeout) endianness" } } # And then read the AltiVec registers back, to see that @@ -118,7 +117,7 @@ if {$endianness == "big"} { set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .0, 1, 0, 1, 0, 1, 0, 1., v16_int8 = .0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1.." } else { - set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.." + set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.." } for {set i 0} {$i < 32} {incr i 1} { Index: b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp =================================================================== --- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp +++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp @@ -20,7 +20,7 @@ # Testcase for ppc decimal128 pseudo-registers. -if ![istarget "powerpc64-*"] then { +if ![istarget "powerpc64*-*"] then { verbose "Skipping powerpc Decimal128 pseudo-registers testcase." return } Index: b/gdb/testsuite/gdb.arch/vsx-regs.exp =================================================================== --- a/gdb/testsuite/gdb.arch/vsx-regs.exp +++ b/gdb/testsuite/gdb.arch/vsx-regs.exp @@ -58,19 +58,45 @@ gdb_suppress_tests } +set endianness "" +set msg "detect endianness" +gdb_test_multiple "show endian" "$msg" { + -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" { + pass "$msg" + set endianness $expect_out(2,string) + } + -re ".*$gdb_prompt $" { + fail "$msg" + } +} + # Data sets used throughout the test -set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." +if {$endianness == "big"} { + set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." + + set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." + + set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." + set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." + set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." + set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." +} else { + set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x0, 0x1., v4_float = .0x0, 0x0, 0xf99999a0, 0x1., v4_int32 = .0x0, 0x0, 0xcccccccc, 0x3ff4cccc., v8_int16 = .0x0, 0x0, 0x0, 0x0, 0xcccc, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." -set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." + set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x0, 0x0, 0xf99999a0, 0x1., v4_int32 = .0x1, 0x1, 0xcccccccc, 0x3ff4cccc., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0xcccc, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." -set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." + set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." + + set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." + + set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." + + set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." +} set float_register ".raw 0xdeadbeefdeadbeef." Index: b/gdb/testsuite/gdb.base/sigbpt.exp =================================================================== --- a/gdb/testsuite/gdb.base/sigbpt.exp +++ b/gdb/testsuite/gdb.base/sigbpt.exp @@ -76,7 +76,7 @@ set bowler_addrs bowler set segv_addr none gdb_test {display/i $pc} -gdb_test "advance *bowler" "bowler.*" "advance to the bowler" +gdb_test "advance bowler" "bowler.*" "advance to the bowler" set test "stepping to fault" set signame "SIGSEGV" gdb_test_multiple "stepi" "$test" { Index: b/gdb/testsuite/gdb.base/step-bt.c =================================================================== --- a/gdb/testsuite/gdb.base/step-bt.c +++ b/gdb/testsuite/gdb.base/step-bt.c @@ -23,10 +23,19 @@ printf ("Hello world.\n"); } +/* The test case uses "break *hello" to make sure to step at the very + first instruction of the function. This causes a problem running + the test on powerpc64le-linux, since the first instruction belongs + to the global entry point prologue, which is skipped when doing a + local direct function call. To make sure that first instruction is + indeed being executed and the breakpoint hits, we make sure to call + the routine via an indirect call. */ +void (*ptr) (void) = hello; + int main (void) { - hello (); + ptr (); return 0; } debian/patches/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch0000644000000000000000000001257212275217555022271 0ustar Bug-Debian: http://bugs.debian.org/581707 Bug-Redhat: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337 Author: Jan Kratochvil Origin: vendor, http://pkgs.fedoraproject.org/cgit/gdb.git/tree/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch?id=e6e9cf3987dc51070b7b58db9967209f23a8c3d3 2008-02-24 Jan Kratochvil Port to GDB-6.8pre. currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you will get: (gdb) p errno [some error] * with -ggdb2 and less "errno" in fact does not exist anywhere as it was compiled to "(*__errno_location ())" and the macro definition is not present. Unfortunately gdb will find the TLS symbol and it will try to access it but as the program has been compiled without -lpthread the TLS base register (%gs on i386) is not setup and it will result in: Cannot access memory at address 0x8 Attached suggestion patch how to deal with the most common "errno" symbol for the most common under-ggdb3 compiled programs. Original patch hooked into target_translate_tls_address. But its inferior call invalidates `struct frame *' in the callers - RH BZ 690908. 2007-11-03 Jan Kratochvil * ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C. glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location Index: b/gdb/printcmd.c =================================================================== --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -972,6 +972,8 @@ if (exp && *exp) { + if (strcmp (exp, "errno") == 0) + exp = "*((int *(*) (void)) __errno_location) ()"; expr = parse_expression (exp); make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); Index: b/gdb/testsuite/gdb.dwarf2/dw2-errno.c =================================================================== --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2005, 2007 Free Software Foundation, Inc. + + 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 . + + Please email any bugs, comments, and/or additions to this file to: + bug-gdb@prep.ai.mit.edu */ + +#include + +int main() +{ + errno = 42; + + return 0; /* breakpoint */ +} Index: b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp =================================================================== --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp @@ -0,0 +1,60 @@ +# Copyright 2007 Free Software Foundation, Inc. + +# 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 . + +set testfile dw2-errno +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +proc prep {} { + global srcdir subdir binfile + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + + runto_main + + gdb_breakpoint [gdb_get_line_number "breakpoint"] + gdb_continue_to_breakpoint "breakpoint" +} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { + untested "Couldn't compile test program" + return -1 +} +prep +gdb_test "print errno" ".* = 42" "errno with macros=N threads=N" + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { + untested "Couldn't compile test program" + return -1 +} +prep +gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N" + +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { + return -1 +} +prep +gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y" + +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { + return -1 +} +prep +gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y" + +# TODO: Test the error on resolving ERRNO with only libc loaded. +# Just how to find the current libc filename? debian/patches/python-config.patch0000644000000000000000000001470312275217575014444 0ustar Index: b/gdb/configure.ac =================================================================== --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -853,29 +853,31 @@ esac esac + python_config= if test "${python_prog}" != missing; then + AC_CHECK_TOOL(python_config,[${python_prog}-config],[${python_prog} ${srcdir}/python/python-config.py]) # We have a python program to use, but it may be too old. # Don't flag an error for --with-python=auto (the default). have_python_config=yes - python_includes=`${python_prog} ${srcdir}/python/python-config.py --includes` + python_includes=`${python_config} --includes` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --includes) + AC_ERROR(failure running ${python-config} --includes) fi fi - python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags` + python_libs=`${python_config} --ldflags` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --ldflags) + AC_ERROR(failure running ${python-config} --ldflags) fi fi - python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix` + python_prefix=`${python_config} --exec-prefix` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --exec-prefix) + AC_ERROR(failure running ${python-config} --exec-prefix) fi fi else Index: b/gdb/configure =================================================================== --- a/gdb/configure +++ b/gdb/configure @@ -661,6 +661,7 @@ PYTHON_LIBS PYTHON_CPPFLAGS PYTHON_CFLAGS +python_config python_prog_path LTLIBEXPAT LIBEXPAT @@ -8247,29 +8248,122 @@ esac esac + python_config= if test "${python_prog}" != missing; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}${python_prog}-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}${python_prog}-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_python_config+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$python_config"; then + ac_cv_prog_python_config="$python_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_python_config="${ac_tool_prefix}${python_prog}-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +python_config=$ac_cv_prog_python_config +if test -n "$python_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_config" >&5 +$as_echo "$python_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_python_config"; then + ac_ct_python_config=$python_config + # Extract the first word of "${python_prog}-config", so it can be a program name with args. +set dummy ${python_prog}-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_python_config+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_python_config"; then + ac_cv_prog_ac_ct_python_config="$ac_ct_python_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_python_config="${python_prog}-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_python_config=$ac_cv_prog_ac_ct_python_config +if test -n "$ac_ct_python_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_python_config" >&5 +$as_echo "$ac_ct_python_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_python_config" = x; then + python_config="${python_prog} ${srcdir}/python/python-config.py" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + python_config=$ac_ct_python_config + fi +else + python_config="$ac_cv_prog_python_config" +fi + # We have a python program to use, but it may be too old. # Don't flag an error for --with-python=auto (the default). have_python_config=yes - python_includes=`${python_prog} ${srcdir}/python/python-config.py --includes` + python_includes=`${python_config} --includes` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - as_fn_error "failure running python-config --includes" "$LINENO" 5 + as_fn_error "failure running ${python-config} --includes" "$LINENO" 5 fi fi - python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags` + python_libs=`${python_config} --ldflags` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - as_fn_error "failure running python-config --ldflags" "$LINENO" 5 + as_fn_error "failure running ${python-config} --ldflags" "$LINENO" 5 fi fi - python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix` + python_prefix=`${python_config} --exec-prefix` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - as_fn_error "failure running python-config --exec-prefix" "$LINENO" 5 + as_fn_error "failure running ${python-config} --exec-prefix" "$LINENO" 5 fi fi else debian/patches/series0000644000000000000000000000040012275437454012041 0ustar gdb-fortran-main.patch #linuxthreads_signal_handling.patch solve_PATH_MAX_issue.patch gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch # Ubuntu/Linaro gdb-strings.patch #ptrace-error-verbosity.patch python-config.patch #elf-auxv-diff ppc64le.diff debian/patches/gdb-strings.patch0000644000000000000000000000074712275217561014101 0ustar Index: b/gdb/remote.c =================================================================== --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8675,7 +8675,7 @@ do_cleanups (old_chain); } if (mismatched > 0) - warning (_("One or more sections of the remote executable does not match\n\ + warning (_("One or more sections of the remote executable do not match\n\ the loaded file\n")); if (args && !matched) printf_filtered (_("No loaded section named '%s'.\n"), args); debian/README.Debian0000644000000000000000000000112012165767700011234 0ustar GDB is a complex program. There is an excellent Info manual (`info gdb'), which is available in the separate gdb-doc package. gdb-doc is not part of Debian main; it is available in the non-free distribution (because it is covered by the GNU Free Documentation License). GDB's documentation is also available online. Documentation from the most recent release branch may be found at: http://sourceware.org/gdb/onlinedocs/gdb.html There are also a number of books and tutorials devoted to GDB. One particularly useful guide is Peter Jay Salzman's, at: http://www.dirac.org/linux/gdb/ debian/control0000644000000000000000000001155312253041374010577 0ustar Source: gdb Maintainer: Ubuntu Core developers XSBC-Original-Maintainer: Héctor Orón Martínez Uploaders: Luca Bruno , Samuel Bronson Section: devel Priority: optional Standards-Version: 3.9.4 Build-Depends: # Packaging deps cdbs (>= 0.4.17), debhelper (>= 7.0.50), lsb-release, bzip2, # Other tool deps autoconf, libtool, gettext, bison, dejagnu, flex | flex-old, procps, g++-multilib [i386 powerpc s390 sparc], gcj-jdk | gcj, gobjc, mig [hurd-any], # TeX[info] deps texinfo (>= 4.7-2.2), texlive-base, # Libdev deps libexpat1-dev, lib64expat1-dev [i386 powerpc s390 sparc], libncurses5-dev, lib64ncurses5-dev [i386 powerpc s390 sparc], libreadline-dev, lib64readline6-dev [i386 powerpc s390 sparc], zlib1g-dev, libbz2-dev, liblzma-dev, libpython3-dev, libkvm-dev [kfreebsd-any], libunwind7-dev [ia64], Vcs-Git: git://anonscm.debian.org/crosstoolchain/gdb.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=crosstoolchain/gdb.git Homepage: http://www.gnu.org/s/gdb/ Package: gdb Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, ${shlibs:Depends}, libpython3-stdlib Recommends: libc-dbg, python3 Suggests: gdb-doc, gdbserver [amd64 armel armhf arm64 i386 ia64 m32r m68k mips mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x x32] Description: GNU Debugger GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. Package: gdb-minimal Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: gdb Description: GNU Debugger (minimal version) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a minimal version of GDB with optional features disabled. Package: gdb64 Architecture: i386 powerpc s390 sparc Replaces: gdb-multiarch (<< 7.6-1) Depends: gdb (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: GNU Debugger (64-bit) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a version of GDB compiled for a 64-bit variant of its architecture. Package: gdb-multiarch Architecture: any Depends: gdb (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: GNU Debugger (with support for multiple architectures) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains a version of GDB which supports multiple target architectures. Package: gdbserver Architecture: amd64 armel armhf arm64 i386 ia64 m32r m68k mips mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x x32 Depends: ${misc:Depends}, ${shlibs:Depends} Replaces: gdb (<< 7.0.1-1) Description: GNU Debugger (remote server) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains gdbserver. Install this to debug remotely from another system where GDB is installed. Package: gdb-source Architecture: all Depends: ${misc:Depends} Description: GNU Debugger (source) GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains the sources and patches which are needed to build GDB. debian/gdbtui0000755000000000000000000000017612165767700010411 0ustar #!/bin/sh prog=$(basename $0 tui) dir=$(dirname $0) if [ "$dir" != "." ]; then prog=$dir/$prog fi exec $prog --tui "$@" debian/rules0000755000000000000000000002471112275453460010263 0ustar #!/usr/bin/make -f ALL_BUILDDIR := $(shell pwd)/build DEB_BUILDDIR := $(ALL_BUILDDIR)/objdir DEB_DH_INSTALL_SOURCEDIR := $(shell pwd)/debian/tmp #DEB_DH_STRIP_ARGS := --dbg-package=gdb-dbg # Override CDBS's default CFLAGS, which also includes -Wall; gdb # does not handle -Wunused well with -Werror, but defaults to # -Werror. DEB_WARNING_FLAGS := # This implements the .deb package creation using debhelper. include /usr/share/cdbs/1/rules/debhelper.mk # This implements building using a configure script and Makefile. include /usr/share/cdbs/1/class/autotools.mk # The top-level configure script fails to pass these down properly ... export CPPFLAGS export LDFLAGS # Always install into debian/tmp, even if we are only building one package. DEB_DESTDIR := $(shell pwd)/debian/tmp install = /usr/bin/install -p # Rather paranoid than sorry. Make the shell exit with an error if an # untested command fails. SHELL += -e DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) # Cross configuration support. Check for an environment variable # $GDB_TARGET, or a file debian/target. ifndef GDB_TARGET DEBIAN_TARGET_FILE := $(strip $(shell cat debian/target 2>/dev/null)) ifneq ($(DEBIAN_TARGET_FILE),) GDB_TARGET := $(DEBIAN_TARGET_FILE) endif endif DEB_TARGET_ARCH := $(shell dpkg-architecture -f \ -a$(GDB_TARGET) -qDEB_HOST_ARCH 2>/dev/null) DEB_TARGET_GNU_TYPE := $(shell dpkg-architecture -f \ -a$(DEB_TARGET_ARCH) -qDEB_HOST_GNU_TYPE 2>/dev/null) DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE) ifneq ($(GDB_TARGET),) DEB_CONFIGURE_GDB_DATADIR := "\$${prefix}/share/gdb-$(DEB_TARGET_GNU_TYPE)" DEB_CONFIGURE_PATH_ARGS += --with-gdb-datadir=$(DEB_CONFIGURE_GDB_DATADIR) endif ifeq ($(DEB_TARGET_ARCH),) $(error GDB_TARGET value "$(GDB_TARGET)" is not a valid Debian architecture) endif ifdef GDB_TARGET DEB_CROSS = yes # TP: Target Prefix. Used primarily as a prefix for cross tool # names (e.g. powerpc-linux-gcc). # TS: Target Suffix. Used primarily at the end of cross compiler # package names (e.g. gcc-powerpc). TP = $(DEB_TARGET_ALIAS)- TS = -$(DEB_TARGET_ALIAS) CROSS_FORCE = FORCE else ifneq (,$(filter $(DEB_HOST_ARCH),i386 powerpc sparc s390)) build64 = yes CC64 = gcc -m64 CFLAGS64 = $(CFLAGS) BUILDDIR64 = $(ALL_BUILDDIR)/objdir64 ifeq ($(DEB_HOST_ARCH),i386) HOST64 = x86_64-linux-gnu endif ifeq ($(DEB_HOST_ARCH),powerpc) HOST64 = powerpc64-linux-gnu endif ifeq ($(DEB_HOST_ARCH),sparc) HOST64 = sparc64-linux-gnu endif ifeq ($(DEB_HOST_ARCH),s390) HOST64 = s390x-linux-gnu endif endif endif distribution := $(shell lsb_release -is) deb_version := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}') BUILDDIRMULTIARCH = $(ALL_BUILDDIR)/objdir-multiarch run_tests := yes ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) run_tests := no endif ifeq (,$(findstring linux, $(DEB_HOST_GNU_SYSTEM))) run_tests := no endif ifeq ($(DEB_HOST_GNU_CPU),ia64) arch_config_args := --with-libunwind-ia64 endif ifdef GDB_TARGET run_tests := no arch_config_args += --program-prefix=$(TP) \ --target=$(DEB_TARGET_ALIAS) --with-sysroot=/usr/$(DEB_TARGET_ALIAS) else # To avoid file conflicts, only enable the global gdbinit file for native # debuggers. arch_config_args += --with-system-gdbinit=/etc/gdb/gdbinit endif INSTALL = $(install) export INSTALL # We pass srcdir explicitly to avoid an extra '/.' at the end of it. That # causes a harmless, but ugly, testsuite failure in maint.exp. EXTRA_FLAGS := --disable-gdbtk --disable-shared \ --disable-werror \ --with-pkgversion='$(distribution) $(deb_version)' \ --srcdir=$(shell pwd) --with-system-readline --with-expat \ $(arch_config_args) --build=$(DEB_BUILD_GNU_TYPE) # Debian does not include 64-bit Python packages, so --with-python # is here rather than in EXTRA_FLAGS. DEB_CONFIGURE_EXTRA_FLAGS := --host=$(DEB_HOST_GNU_TYPE) $(EXTRA_FLAGS) \ --enable-tui --with-python=python3 # 64-bit flags DEB_CONFIGURE_FLAGS_64 := --host=$(HOST64) $(EXTRA_FLAGS) \ --enable-tui # multiarch targets; this is taken from the binutils-multiarch package but # doesn't seem like a terribly nice list; see # <20110117211551.GA7216@bee.dooz.org> for discussion -- locally updated #MULTIARCH_TARGETS := \ # alpha-linux-gnu \ # arm-linux-gnu \ # arm-linux-gnueabi \ # arm-linux-gnueabihf \ # hppa-linux-gnu \ # i686-linux-gnu \ # ia64-linux-gnu \ # m68k-linux-gnu \ # m68k-rtems \ # mips-linux-gnu \ # mipsel-linux-gnu \ # mips64-linux-gnu \ # mips64el-linux-gnu \ # powerpc-linux-gnu \ # powerpcspe-linux-gnu \ # ppc64-linux-gnu \ # s390-linux-gnu \ # s390x-linux-gnu \ # sh-linux-gnu \ # sh64-linux-gnu \ # sparc-linux-gnu \ # sparc64-linux-gnu \ # x86_64-linux-gnu \ # m32r-linux-gnu \ # spu # --enable-targets=`set -- $(MULTIARCH_TARGETS); IFS=,; echo "$$*"` MULTIARCH_TARGETS := all # multiarch flags DEB_CONFIGURE_FLAGS_MULTIARCH := $(DEB_CONFIGURE_EXTRA_FLAGS) \ --enable-64-bit-bfd \ --enable-targets=$(MULTIARCH_TARGETS) \ --disable-werror \ --disable-sim # Minimal flags DEB_CONFIGURE_FLAGS_MIN := --host=$(DEB_HOST_GNU_TYPE) $(EXTRA_FLAGS) \ --disable-tui --without-python # Support parallel= in DEB_BUILD_OPTIONS (see #209008) COMMA = , ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif DEB_MAKE_BUILD_TARGET = $(NJOBS) all BUILDDIRSOURCE := $(ALL_BUILDDIR)/gdb BUILDDIRMIN := $(ALL_BUILDDIR)/gdb-minimal # This should probably be common-post-build-arch, but that runs during # install, under fakeroot, in CDBS 0.4.21. build/gdb$(TS):: check-stamp $(MAKE) -C $(DEB_BUILDDIR) info $(MAKE) -C $(DEB_BUILDDIR)/gdb/doc refcard.dvi refcard.ps build/gdb64:: build64-stamp build64-stamp: mkdir -p $(BUILDDIR64) cd $(BUILDDIR64) && CC="$(CC64)" CFLAGS="$(CFLAGS64)" AR=ar \ $(shell pwd)/configure $(DEB_CONFIGURE_FLAGS_64) cd $(BUILDDIR64) && $(DEB_MAKE_ENVVARS) $(MAKE) $(NJOBS) touch $@ build/gdb-multiarch:: build-multiarch-stamp build-multiarch-stamp: mkdir -p $(BUILDDIRMULTIARCH) cd $(BUILDDIRMULTIARCH) && CFLAGS="$(CFLAGS)" \ $(shell pwd)/configure $(DEB_CONFIGURE_FLAGS_MULTIARCH) cd $(BUILDDIRMULTIARCH) && $(DEB_MAKE_ENVVARS) $(MAKE) $(NJOBS) touch $@ build/gdb-minimal:: build-minimal-stamp build-minimal-stamp: mkdir -p $(BUILDDIRMIN) cd $(BUILDDIRMIN) && CFLAGS="$(CFLAGS)" \ $(shell pwd)/configure $(DEB_CONFIGURE_FLAGS_MIN) cd $(BUILDDIRMIN) && $(DEB_MAKE_ENVVARS) $(MAKE) $(NJOBS) touch $@ check-stamp: ifeq ($(run_tests),yes) -ulimit -c unlimited || true; \ $(MAKE) $(NJOBS) -C $(DEB_BUILDDIR)/gdb check endif touch $@ clean:: rm -f check-stamp build64-stamp build-multiarch-stamp rm -rf $(ALL_BUILDDIR) if test -f gdb/version.in.backup; then \ mv -f gdb/version.in.backup gdb/version.in; \ fi # # For snapshots this is appropriate; careful of release tarballs # # which include .gmo files. # find -type f -name '*.gmo' | xargs rm -f # Prevent gratuitous rebuilds of the BFD documentation, since it # updates the copy in the source directory. find bfd -name bfd.info\* | xargs --no-run-if-empty touch binary-post-install/gdb$(TS) :: if [ -x debian/tmp/usr/bin/run ]; then \ mv debian/tmp/usr/bin/run \ debian/gdb$(TS)/usr/bin/$(DEB_TARGET_ALIAS)-run; \ mv debian/tmp/usr/share/man/man1/run.1 \ debian/gdb$(TS)/usr/share/man/man1/$(DEB_TARGET_ALIAS)-run.1; \ fi ifeq ($(run_tests),yes) install -d debian/gdb$(TS)/usr/share/doc/gdb install -m 644 $(DEB_BUILDDIR)/gdb/testsuite/gdb.sum \ debian/gdb$(TS)/usr/share/doc/gdb/check.log endif ifneq ($(DEB_CROSS),yes) # Gcore is only useful for native GDB. $(INSTALL) -m 755 -o root -g root \ debian/tmp/usr/bin/gcore debian/gdb$(TS)/usr/bin/$(TP)gcore # Only ship a global gdbinit for the native GDB. install -d debian/gdb$(TS)/etc/gdb install -m 644 debian/gdbinit debian/gdb$(TS)/etc/gdb/ endif rm -f debian/gdb$(TS)/usr/bin/$(TP)gdbtui install -m 755 debian/gdbtui debian/gdb$(TS)/usr/bin/$(TP)gdbtui binary-post-install/gdb64 :: install -d debian/gdb64/usr/bin install -s -m 755 $(BUILDDIR64)/gdb/gdb debian/gdb64/usr/bin/gdb64 dh_link -pgdb64 usr/share/man/man1/gdb.1.gz usr/share/man/man1/gdb64.1.gz rm -rf debian/gdb64/usr/share/doc/gdb64 ln -s gdb debian/gdb64/usr/share/doc/gdb64 binary-post-install/gdb-multiarch :: install -d debian/gdb-multiarch/usr/bin install -s -m 755 $(BUILDDIRMULTIARCH)/gdb/gdb debian/gdb-multiarch/usr/bin/gdb-multiarch dh_link -pgdb-multiarch usr/share/man/man1/gdb.1.gz usr/share/man/man1/gdb-multiarch.1.gz rm -rf debian/gdb-multiarch/usr/share/doc/gdb-multiarch ln -s gdb debian/gdb-multiarch/usr/share/doc/gdb-multiarch binary-post-install/gdb-minimal :: install -d debian/gdb-minimal/usr/bin $(INSTALL) -m 755 -o root -g root \ $(BUILDDIRMIN)/gdb/gdb debian/gdb-minimal/usr/bin/gdb $(INSTALL) -m 755 -o root -g root \ debian/tmp/usr/bin/gcore debian/gdb-minimal/usr/bin/gcore # Only ship a global gdbinit for the native GDB. install -d debian/gdb-minimal/etc/gdb install -m 644 debian/gdbinit debian/gdb-minimal/etc/gdb/ binary-post-install/gdb-source :: install -d debian/gdb-source/usr/src mkdir -p $(BUILDDIRSOURCE) tar --exclude build --exclude .git -cf - . \ | (cd $(BUILDDIRSOURCE) && tar -xf -) cd $(BUILDDIRSOURCE) && debian/rules clean cd $(dir $(BUILDDIRSOURCE)) \ && tar -cjf $(shell pwd)/debian/gdb-source/usr/src/gdb.tar.bz2 \ $(notdir $(BUILDDIRSOURCE)) debian/control:: debian/control.in $(CROSS_FORCE) cat debian/control.in \ | sed "s/@TS@/$(TS)/g" \ > debian/control ifeq ($(DEB_CROSS),yes) sed -i "/Package: gdb64/,\$$ d" -i "/Package: gdb-multiarch/,\$$ d" debian/control sed "s+/gdb+/$(TP)gdb+g; s+usr/share/$(TP)gdb+usr/share/gdb$(TS)+g" \ debian/gdb.install > debian/gdb$(TS).install endif # The default changelog is the top level one, which is useless. DEB_INSTALL_CHANGELOGS_ALL = DEB_INSTALL_DOCS_gdb$(TS) = gdb/NEWS gdb/README gdb/doc/refcard.tex \ $(DEB_BUILDDIR)/gdb/doc/refcard.dvi \ $(DEB_BUILDDIR)/gdb/doc/refcard.ps DEB_INSTALL_CHANGELOGS_gdb$(TS) = gdb/ChangeLog ifneq ($(DEB_CROSS),yes) DEB_INSTALL_MANPAGES_gdb$(TS) = debian/gcore.1 endif DEB_INSTALL_DOCS_gdbserver = gdb/gdbserver/README DEB_INSTALL_CHANGELOGS_gdbserver = gdb/gdbserver/ChangeLog DEB_INSTALL_DOCS_gdb-minimal = $(DEB_INSTALL_DOCS_gdb$(TS)) DEB_INSTALL_CHANGELOGS_gdb-minimal = -XChangeLog .PHONY: FORCE FORCE: debian/source/0000755000000000000000000000000012165767700010501 5ustar debian/source/format0000644000000000000000000000001412165767700011707 0ustar 3.0 (quilt) debian/source/lintian-overrides0000644000000000000000000000027312165767700014064 0ustar # We do not use the included readline. gdb source: outdated-autotools-helper-file readline/support/config.guess * gdb source: outdated-autotools-helper-file readline/support/config.sub * debian/README.source0000644000000000000000000000055412165767700011364 0ustar Debian and the FSF have different positions on the GFDL. Consequently, the GDB release tarball includes GFDL documents which must go in the Debian non-free section. To produce the necessary tarballs, download an official GDB release as .tar.bz2 from the FSF. Run debian/sanitize-gdb.sh on it. That will produce a gdb .orig.tar.bz2 and a gdb-doc .orig.tar.bz2. debian/gbp.conf0000644000000000000000000000003712165767700010620 0ustar [DEFAULT] debian-branch=master debian/gdb-source.postinst0000755000000000000000000000042612165767700013045 0ustar #!/bin/sh set -e # Replace documentation directory with symlink if [ -d /usr/share/doc/gdb-source ] && [ ! -L /usr/share/doc/gdb-source ]; then if rmdir /usr/share/doc/gdb-source 2>/dev/null; then ln -sf gdb /usr/share/doc/gdb-source fi fi #DEBHELPER# exit 0 debian/gdbinit0000644000000000000000000000004712165767700010545 0ustar # System-wide GDB initialization file. debian/gdbserver.install0000644000000000000000000000006112165767700012551 0ustar usr/bin/gdbserver usr/share/man/man1/gdbserver.1 debian/watch0000644000000000000000000000042712165767700010235 0ustar # Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # See uscan(1) for format # Compulsory line, this is a version 3 file version=3 http://ftp.gnu.org/gnu/gdb/gdb-(.*)\.tar\.bz2