diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-01-23 23:29:42 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-01-23 23:29:42 +0000 |
commit | ddad17953630b0c78b5bee8eaf072956fa80fe2c (patch) | |
tree | a165574e94d6fbea04f925d6d1296c4187e7d20f /sys-devel | |
parent | Stable on hppa (bug #108262). (diff) | |
download | gentoo-2-ddad17953630b0c78b5bee8eaf072956fa80fe2c.tar.gz gentoo-2-ddad17953630b0c78b5bee8eaf072956fa80fe2c.tar.bz2 gentoo-2-ddad17953630b0c78b5bee8eaf072956fa80fe2c.zip |
Add patch from Fedora to fix #120091 by Ed Catmur.
(Portage version: 2.1_pre3-r1)
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/gdb/ChangeLog | 8 | ||||
-rw-r--r-- | sys-devel/gdb/files/digest-gdb-6.4-r2 | 2 | ||||
-rw-r--r-- | sys-devel/gdb/files/gdb-6.3-partial-die-20050503.patch | 175 | ||||
-rw-r--r-- | sys-devel/gdb/gdb-6.4-r2.ebuild | 115 |
4 files changed, 299 insertions, 1 deletions
diff --git a/sys-devel/gdb/ChangeLog b/sys-devel/gdb/ChangeLog index f2fd34cc1638..3ac1b4f2e5c7 100644 --- a/sys-devel/gdb/ChangeLog +++ b/sys-devel/gdb/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/gdb # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/ChangeLog,v 1.83 2006/01/16 15:19:32 solar Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/ChangeLog,v 1.84 2006/01/23 23:29:42 vapier Exp $ + +*gdb-6.4-r2 (23 Jan 2006) + + 23 Jan 2006; Mike Frysinger <vapier@gentoo.org> + +files/gdb-6.3-partial-die-20050503.patch, +gdb-6.4-r2.ebuild: + Add patch from Fedora to fix #120091 by Ed Catmur. 16 Jan 2006; <solar@gentoo.org> files/gdb-6.4-scanmem.patch: - scanmem patch updates from the PaX Team. Fixed compilation warnings and diff --git a/sys-devel/gdb/files/digest-gdb-6.4-r2 b/sys-devel/gdb/files/digest-gdb-6.4-r2 new file mode 100644 index 000000000000..701f64eee627 --- /dev/null +++ b/sys-devel/gdb/files/digest-gdb-6.4-r2 @@ -0,0 +1,2 @@ +MD5 f62c14ba0316bc88e1b4b32a4e901ffb gdb-6.4.tar.bz2 13917226 +MD5 35e70c29e393433b3847527d808f59c2 gdb_init.txt.bz2 6247 diff --git a/sys-devel/gdb/files/gdb-6.3-partial-die-20050503.patch b/sys-devel/gdb/files/gdb-6.3-partial-die-20050503.patch new file mode 100644 index 000000000000..0ece139785e2 --- /dev/null +++ b/sys-devel/gdb/files/gdb-6.3-partial-die-20050503.patch @@ -0,0 +1,175 @@ +http://bugs.gentoo.org/120091 + +2005-04-07 Daniel Jacobowitz <dan@codesourcery.com> + + * dwarf2read.c (struct dwarf2_per_cu_data): Reduce length to + 30 bits. Add load_all_dies flag. + (load_partial_dies): Load all DIEs if per_cu->load_all_dies is set. + Load DW_TAG_member by default. Remove internal_error call. + (find_partial_die): Reload the compilation unit if we can not find + a DIE in the cache. Call internal_error here if we still can not + find the DIE. + +--- gdb-6.3/gdb/dwarf2read.c.fix 2005-05-03 13:39:18.000000000 -0400 ++++ gdb-6.3/gdb/dwarf2read.c 2005-05-03 13:45:54.000000000 -0400 +@@ -362,16 +362,22 @@ struct dwarf2_cu + + struct dwarf2_per_cu_data + { +- /* The start offset and length of this compilation unit. 2**31-1 ++ /* The start offset and length of this compilation unit. 2**30-1 + bytes should suffice to store the length of any compilation unit + - if it doesn't, GDB will fall over anyway. */ + unsigned long offset; +- unsigned long length : 31; ++ unsigned long length : 30; + + /* Flag indicating this compilation unit will be read in before + any of the current compilation units are processed. */ + unsigned long queued : 1; + ++ /* This flag will be set if we need to load absolutely all DIEs ++ for this compilation unit, instead of just the ones we think ++ are interesting. It gets set if we look for a DIE in the ++ hash table and don't find it. */ ++ unsigned int load_all_dies : 1; ++ + /* Set iff currently read in. */ + struct dwarf2_cu *cu; + +@@ -5122,12 +5128,16 @@ load_partial_dies (bfd *abfd, char *info + struct partial_die_info *parent_die, *last_die, *first_die = NULL; + struct abbrev_info *abbrev; + unsigned int bytes_read; ++ unsigned int load_all = 0; + + int nesting_level = 1; + + parent_die = NULL; + last_die = NULL; + ++ if (cu->per_cu && cu->per_cu->load_all_dies) ++ load_all = 1; ++ + cu->partial_dies + = htab_create_alloc_ex (cu->header.length / 12, + partial_die_hash, +@@ -5163,12 +5173,17 @@ load_partial_dies (bfd *abfd, char *info + continue; + } + +- /* Check whether this DIE is interesting enough to save. */ +- if (!is_type_tag_for_partial (abbrev->tag) ++ /* Check whether this DIE is interesting enough to save. Normally ++ we would not be interested in members here, but there may be ++ later variables referencing them via DW_AT_specification (for ++ static members). */ ++ if (!load_all ++ && !is_type_tag_for_partial (abbrev->tag) + && abbrev->tag != DW_TAG_enumerator + && abbrev->tag != DW_TAG_subprogram + && abbrev->tag != DW_TAG_variable +- && abbrev->tag != DW_TAG_namespace) ++ && abbrev->tag != DW_TAG_namespace ++ && abbrev->tag != DW_TAG_member) + { + /* Otherwise we skip to the next sibling, if any. */ + info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu); +@@ -5268,9 +5283,11 @@ load_partial_dies (bfd *abfd, char *info + + Adding more things than necessary to the hash table is harmless + except for the performance cost. Adding too few will result in +- internal errors in find_partial_die. */ ++ wasted time in find_partial_die, when we reread the compilation ++ unit with load_all_dies set. */ + +- if (abbrev->tag == DW_TAG_subprogram ++ if (load_all ++ || abbrev->tag == DW_TAG_subprogram + || abbrev->tag == DW_TAG_variable + || abbrev->tag == DW_TAG_namespace + || part_die->is_declaration) +@@ -5290,7 +5307,8 @@ load_partial_dies (bfd *abfd, char *info + languages we have to, both so that we can get at method physnames + to infer fully qualified class names, and for DW_AT_specification. */ + if (last_die->has_children +- && (last_die->tag == DW_TAG_namespace ++ && (load_all ++ || last_die->tag == DW_TAG_namespace + || last_die->tag == DW_TAG_enumeration_type + || (cu->language != language_c + && (last_die->tag == DW_TAG_class_type +@@ -5442,10 +5460,6 @@ find_partial_die_in_comp_unit (unsigned + part_die.offset = offset; + lookup_die = htab_find_with_hash (cu->partial_dies, &part_die, offset); + +- if (lookup_die == NULL) +- internal_error (__FILE__, __LINE__, +- _("could not find partial DIE in cache\n")); +- + return lookup_die; + } + +@@ -5454,11 +5468,16 @@ find_partial_die_in_comp_unit (unsigned + static struct partial_die_info * + find_partial_die (unsigned long offset, struct dwarf2_cu *cu) + { +- struct dwarf2_per_cu_data *per_cu; ++ struct dwarf2_per_cu_data *per_cu = NULL; ++ struct partial_die_info *pd = NULL; + + if (offset >= cu->header.offset + && offset < cu->header.offset + cu->header.length) +- return find_partial_die_in_comp_unit (offset, cu); ++ { ++ pd = find_partial_die_in_comp_unit (offset, cu); ++ if (pd != NULL) ++ return pd; ++ } + + per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile); + +@@ -5470,7 +5489,42 @@ find_partial_die (unsigned long offset, + } + + per_cu->cu->last_used = 0; +- return find_partial_die_in_comp_unit (offset, per_cu->cu); ++ pd = find_partial_die_in_comp_unit (offset, per_cu->cu); ++ ++ if (pd == NULL && per_cu->load_all_dies == 0) ++ { ++ struct cleanup *back_to; ++ struct partial_die_info comp_unit_die; ++ struct abbrev_info *abbrev; ++ unsigned int bytes_read; ++ char *info_ptr; ++ ++ per_cu->load_all_dies = 1; ++ ++ /* Re-read the DIEs. */ ++ back_to = make_cleanup (null_cleanup, 0); ++ if (per_cu->cu->dwarf2_abbrevs == NULL) ++ { ++ dwarf2_read_abbrevs (per_cu->cu->objfile->obfd, per_cu->cu); ++ back_to = make_cleanup (dwarf2_free_abbrev_table, per_cu->cu); ++ } ++ info_ptr = per_cu->cu->header.first_die_ptr; ++ abbrev = peek_die_abbrev (info_ptr, &bytes_read, per_cu->cu); ++ info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read, ++ per_cu->cu->objfile->obfd, info_ptr, ++ per_cu->cu); ++ if (comp_unit_die.has_children) ++ load_partial_dies (per_cu->cu->objfile->obfd, info_ptr, 0, per_cu->cu); ++ do_cleanups (back_to); ++ ++ pd = find_partial_die_in_comp_unit (offset, per_cu->cu); ++ } ++ ++ if (pd == NULL) ++ internal_error (__FILE__, __LINE__, ++ "could not find partial DIE 0x%lx in cache [from module %s]\n", ++ offset, bfd_get_filename (cu->objfile->obfd)); ++ return pd; + } + + /* Adjust PART_DIE before generating a symbol for it. This function diff --git a/sys-devel/gdb/gdb-6.4-r2.ebuild b/sys-devel/gdb/gdb-6.4-r2.ebuild new file mode 100644 index 000000000000..0eed4f905067 --- /dev/null +++ b/sys-devel/gdb/gdb-6.4-r2.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-6.4-r2.ebuild,v 1.1 2006/01/23 23:29:42 vapier Exp $ + +inherit flag-o-matic eutils + +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +#DEB_VER=6 +DESCRIPTION="GNU debugger" +HOMEPAGE="http://sources.redhat.com/gdb/" +SRC_URI="http://ftp.gnu.org/gnu/gdb/${P}.tar.bz2 + ftp://sources.redhat.com/pub/gdb/releases/${P}.tar.bz2 + mirror://gentoo/gdb_init.txt.bz2" + +LICENSE="GPL-2 LGPL-2" +[[ ${CTARGET} != ${CHOST} ]] \ + && SLOT="${CTARGET}" \ + || SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="nls test vanilla" + +RDEPEND=">=sys-libs/ncurses-5.2-r2" +DEPEND="${RDEPEND} + test? ( dev-util/dejagnu ) + nls? ( sys-devel/gettext )" + +src_unpack() { + unpack ${A} + cd "${S}" + mv "${WORKDIR}"/gdb_init.txt . || die + + if ! use vanilla ; then + if [[ -n ${DEB_VER} ]] ; then + epatch "${WORKDIR}"/gdb_${PV}-${DEB_VER}.diff + for f in $(<debian/patches/series) ; do + EPATCH_SINGLE_MSG="Applying Debian's ${f}" \ + epatch debian/patches/${f} + done + fi + epatch "${FILESDIR}"/gdb-6.4-uclibc.patch + epatch "${FILESDIR}"/gdb-6.4-relative-paths.patch + #epatch "${FILESDIR}"/gdb-6.x-crash.patch + epatch "${FILESDIR}"/gdb-6.2.1-pass-libdir.patch + epatch "${FILESDIR}"/gdb-6.4-scanmem.patch + epatch "${FILESDIR}"/gdb-6.3-gdbinit-stat.patch + epatch "${FILESDIR}"/bfd-malloc-wrap.patch #91398 + epatch "${FILESDIR}"/gdb-6.3-partial-die-20050503.patch #120091 + + epatch "${FILESDIR}"/gdb-6.2.1-200-uclibc-readline-conf.patch + epatch "${FILESDIR}"/gdb-6.2.1-400-mips-coredump.patch + epatch "${FILESDIR}"/gdb-6.2.1-libiberty-pic.patch + fi + + strip-linguas -u bfd/po opcodes/po +} + +src_compile() { + replace-flags -O? -O2 + econf \ + --disable-werror \ + $(use_enable nls) \ + || die + emake -j1 || die +} + +src_test() { + make check || ewarn "tests failed" +} + +src_install() { + make \ + prefix="${D}"/usr \ + mandir="${D}"/usr/share/man \ + infodir="${D}"/usr/share/info \ + libdir="${D}"/nukeme includedir="${D}"/nukeme \ + install || die "install" + # The includes and libs are in binutils already + rm -r "${D}"/nukeme + + # Don't install docs when building a cross-gdb + if [[ ${CTARGET} != ${CHOST} ]] ; then + rm -r "${D}"/usr/share + return 0 + fi + + dodoc README + docinto gdb + dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \ + gdb/NEWS gdb/ChangeLog* gdb/TODO + docinto sim + dodoc sim/ChangeLog sim/MAINTAINERS sim/README-HACKING + docinto mmalloc + dodoc mmalloc/MAINTAINERS mmalloc/ChangeLog mmalloc/TODO + + if use x86 ; then + dodir /etc/skel/ + cp "${S}"/gdb_init.txt "${D}"/etc/skel/.gdbinit \ + || die "install ${D}/etc/skel/.gdbinit" + fi + + if ! has noinfo ${FEATURES} ; then + make \ + infodir="${D}"/usr/share/info \ + install-info \ + || die "install doc info" + # Remove shared info pages + rm -f "${D}"/usr/share/info/{annotate,bfd,configure,standards}.info* + fi +} |