From 98381fdfd83c53b21ab7c8957419b3af9fa163d6 Mon Sep 17 00:00:00 2001 From: Ned Ludd Date: Thu, 22 Jun 2006 00:38:44 +0000 Subject: [PATCH] - bump scanmem patch Package-Manager: portage-3387-svn --- sys-devel/gdb/ChangeLog | 8 +- sys-devel/gdb/files/digest-gdb-6.5-r1 | 6 + sys-devel/gdb/files/gdb-6.5-scanmem.patch | 227 ++++++++++++++++++++++ sys-devel/gdb/gdb-6.1.ebuild | 4 +- sys-devel/gdb/gdb-6.2.1.ebuild | 4 +- sys-devel/gdb/gdb-6.3-r4.ebuild | 4 +- sys-devel/gdb/gdb-6.4-r1.ebuild | 4 +- sys-devel/gdb/gdb-6.5-r1.ebuild | 98 ++++++++++ 8 files changed, 346 insertions(+), 9 deletions(-) create mode 100644 sys-devel/gdb/files/digest-gdb-6.5-r1 create mode 100644 sys-devel/gdb/files/gdb-6.5-scanmem.patch create mode 100644 sys-devel/gdb/gdb-6.5-r1.ebuild diff --git a/sys-devel/gdb/ChangeLog b/sys-devel/gdb/ChangeLog index 574a9332cd23..97127935b8b4 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.92 2006/06/21 17:38:13 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/ChangeLog,v 1.93 2006/06/22 00:38:43 solar Exp $ + +*gdb-6.5-r1 (21 Jun 2006) + + 21 Jun 2006; +files/gdb-6.5-scanmem.patch, + +gdb-6.5-r1.ebuild: + - bump scanmem patch *gdb-6.5 (21 Jun 2006) diff --git a/sys-devel/gdb/files/digest-gdb-6.5-r1 b/sys-devel/gdb/files/digest-gdb-6.5-r1 new file mode 100644 index 000000000000..02eca76cd6e7 --- /dev/null +++ b/sys-devel/gdb/files/digest-gdb-6.5-r1 @@ -0,0 +1,6 @@ +MD5 af6c8335230d7604aee0803b1df14f54 gdb-6.5.tar.bz2 14303558 +RMD160 ec5138a833d0f67b3e27fde653f1a80dec79b99f gdb-6.5.tar.bz2 14303558 +SHA256 0011318d9720781d486c835e88b915f90f2c10e7101d648b64dd4739218d3faf gdb-6.5.tar.bz2 14303558 +MD5 35e70c29e393433b3847527d808f59c2 gdb_init.txt.bz2 6247 +RMD160 877e32656cd77f0083cc2506795979884671b7d4 gdb_init.txt.bz2 6247 +SHA256 dbd88def6a317eba947a7c37af471d9deb447c4a9906322c1afccd6537f1c724 gdb_init.txt.bz2 6247 diff --git a/sys-devel/gdb/files/gdb-6.5-scanmem.patch b/sys-devel/gdb/files/gdb-6.5-scanmem.patch new file mode 100644 index 000000000000..c42a36fa1796 --- /dev/null +++ b/sys-devel/gdb/files/gdb-6.5-scanmem.patch @@ -0,0 +1,227 @@ +--- gdb/printcmd.c 2005-02-24 14:51:34.000000000 +0100 ++++ gdb/printcmd.c 2005-12-11 01:38:27.000000000 +0100 +@@ -942,6 +942,187 @@ print_command (char *exp, int from_tty) + print_command_1 (exp, 0, 1); + } + ++int partial_memory_read (CORE_ADDR memaddr, char *myaddr, int len, int *errnoptr); ++ ++static void ++scanmem_command(char *exp, int from_tty) ++{ ++ struct expression *expr; ++ struct value *val; ++ struct format_data fmt; ++ CORE_ADDR addr; ++ unsigned char *data; ++ unsigned char *size; ++ unsigned char *pattern; ++ unsigned char typ; ++ unsigned int typc; ++ unsigned char my_buf[4]; ++ unsigned int nfetch; ++ unsigned int len = 10; ++ unsigned int memsize; ++ unsigned int i; ++ int typi; ++ int errcode; ++ struct type *type; ++ char *str_num = NULL; ++ char *string_to_seek = NULL; ++ char *tmp = strdup(exp); ++ char *c; ++ ++ if (!exp && !*exp) ++ return; ++ ++ c = tmp; ++ if (*c == ' ') ++ while (*c && *c == ' ') ++ c++; ++ ++ while (*c && *c != ' ') ++ c++; ++ ++ *c = '\0'; ++ c++; ++ ++ while (*c && *c == ' ') ++ c++; ++ ++ size = c; ++ ++ while (*c && *c != ' ') ++ c++; ++ ++ *c = '\0'; ++ c++; ++ ++ while (*c && *c == ' ') ++ c++; ++ ++ typ = *c; ++ c++; ++ ++ *c = '\0'; ++ c++; ++ ++ while (*c && *c == ' ') ++ c++; ++ pattern = c; ++ ++ printf_filtered(">>addr %s: size %s: type:%c pattern:%s<< \n", tmp, size, typ, pattern); ++ ++ expr = parse_expression(tmp); ++ val = evaluate_expression(expr); ++ ++ if (TYPE_CODE(value_type(val)) == TYPE_CODE_REF) ++ val = value_ind(val); ++ ++ if (TYPE_CODE(value_type(val)) == TYPE_CODE_FUNC && VALUE_LVAL(val) == lval_memory) ++ addr = VALUE_ADDRESS(val); ++ else ++ addr = value_as_address(val); ++ ++ len = atoi(size); ++ data = xmalloc(len); ++ nfetch = partial_memory_read(addr, data, len, &errcode); ++ ++ if (nfetch != len) ++ printf_filtered("we can read only %i bytes\n", nfetch); ++ ++ switch (typ) { ++ case 's': ++ memsize = strlen(pattern); ++ if (nfetch < memsize) { ++ printf_filtered("we read only %i bytes and we seek for a pattern of %i bytes\n", ++ nfetch, memsize); ++ break; ++ } ++ for (i = 0; i <= (nfetch - memsize); i++, addr++) { ++ if (memcmp(data + i, pattern, memsize) == 0) { ++ printf_filtered("pattern match at "); ++ deprecated_print_address_numeric(addr, 1, gdb_stdout); ++ printf_filtered("\n"); ++ } ++ } ++ break; ++ ++ case 'i': ++ memsize = sizeof(int); ++ typi = atoi(pattern); ++ ++ if (nfetch < memsize) { ++ printf_filtered("we read only %i bytes and we seek for a pattern of %i bytes\n", ++ nfetch, memsize); ++ break; ++ } ++ for (i = 0; i <= (nfetch - memsize); i++, addr++) { ++ int *pint; ++ pint = (unsigned int *) (data + i); ++ if (*pint == typi) { ++ printf_filtered("pattern match at "); ++ deprecated_print_address_numeric(addr, 1, gdb_stdout); ++ printf_filtered("\n"); ++ } ++ } ++ break; ++ ++ case 'a': ++ memsize = sizeof(unsigned long); ++ if (sscanf(pattern, "0x%x", &i) == 0) { ++ printf_filtered("cant convert to hexa %s\n", pattern); ++ break; ++ } ++ my_buf[0] = (unsigned char) ((i & 0x000000FF)); ++ my_buf[1] = (unsigned char) ((i & 0x0000FF00) >> 8); ++ my_buf[2] = (unsigned char) ((i & 0x00FF0000) >> 16); ++ my_buf[3] = (unsigned char) ((i & 0xFF000000) >> 24); ++ if (nfetch < memsize) { ++ printf_filtered("we read only %i bytes and we seek for a pattern of %i bytes\n", ++ nfetch, memsize); ++ break; ++ } ++ for (i = 0; i <= (nfetch - memsize); i++, addr++) { ++ if (memcmp(data + i, my_buf, memsize) == 0) { ++ printf_filtered("pattern match at "); ++ deprecated_print_address_numeric(addr, 1, gdb_stdout); ++ printf_filtered("\n"); ++ } ++ } ++ break; ++ ++ case 'b': ++ case 'c': ++ memsize = sizeof(char); ++ if (typ == 'c') ++ typc = *pattern; ++ else { ++ if (strncmp("0x", pattern, 2) == 0) ++ sscanf(pattern, "0x%02x", &typc); ++ else ++ typc = (unsigned char)atoi(pattern); ++ } ++ printf_filtered(">>>%0x2\n", typc); ++ if (nfetch < memsize) { ++ printf_filtered("we read only %i bytes and we seek for a pattern of %i bytes\n", ++ nfetch, memsize); ++ break; ++ } ++ for (i = 0; i <= (nfetch - memsize); i++, addr++) { ++ if (data[i] == typc) { ++ printf_filtered("pattern match at "); ++ deprecated_print_address_numeric(addr, 1, gdb_stdout); ++ printf_filtered("\n"); ++ } ++ } ++ break; ++ ++ default: ++ printf_filtered("'%c' is not a valid type\n", typ); ++ break; ++ } ++ free(data); ++ free(tmp); ++ return; ++} ++ + /* Same as print, except in epoch, it gets its own window */ + static void + inspect_command (char *exp, int from_tty) +@@ -2138,6 +2319,16 @@ EXP may be preceded with /FMT, where FMT + but no count or size letter (see \"x\" command).")); + set_cmd_completer (c, location_completer); + add_com_alias ("p", "print", class_vars, 1); ++ c = add_com ("scanmem", class_vars, scanmem_command, _("\ ++scanmem \n\ ++example: scanmem $esp 100 a 0x8048434\n\ ++ scan for this addr on the stack\n\n\ ++ scanmem 0x08048434 100 s fsck\n\ ++ seek for a string\n\ ++ scanmem 0x8048434 100 b 0x75\n\ ++ scan for the char 0x75\n\ ++ a = address c = char b = byte i = int s = string")); /* antilove@zolo.freelsd.net */ ++ set_cmd_completer (c, location_completer); + + c = add_com ("inspect", class_vars, inspect_command, _("\ + Same as \"print\" command, except that if you are running in the epoch\n\ +--- gdb/valprint.c 2006-06-21 19:38:30.000000000 -0400 ++++ gdb/valprint.c 2006-06-21 19:42:13.000000000 -0400 +@@ -39,7 +39,7 @@ + + /* Prototypes for local functions */ + +-static int partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr, ++int partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr, + int len, int *errnoptr); + + static void show_print (char *, int); +@@ -1058,7 +1058,7 @@ + /* FIXME: cagney/1999-10-14: Only used by val_print_string. Can this + function be eliminated. */ + +-static int ++int + partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int *errnoptr) + { + int nread; /* Number of bytes actually read. */ diff --git a/sys-devel/gdb/gdb-6.1.ebuild b/sys-devel/gdb/gdb-6.1.ebuild index 6731389b0a15..f74357f57d71 100644 --- a/sys-devel/gdb/gdb-6.1.ebuild +++ b/sys-devel/gdb/gdb-6.1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# 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.1.ebuild,v 1.13 2005/01/11 21:14:19 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-6.1.ebuild,v 1.14 2006/06/22 00:38:43 solar Exp $ inherit flag-o-matic eutils diff --git a/sys-devel/gdb/gdb-6.2.1.ebuild b/sys-devel/gdb/gdb-6.2.1.ebuild index f2d4ff593c9a..4914f2cefab7 100644 --- a/sys-devel/gdb/gdb-6.2.1.ebuild +++ b/sys-devel/gdb/gdb-6.2.1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# 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.2.1.ebuild,v 1.7 2005/01/11 21:14:19 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-6.2.1.ebuild,v 1.8 2006/06/22 00:38:43 solar Exp $ inherit flag-o-matic eutils diff --git a/sys-devel/gdb/gdb-6.3-r4.ebuild b/sys-devel/gdb/gdb-6.3-r4.ebuild index e752f630f38c..15cf215eb2b1 100644 --- a/sys-devel/gdb/gdb-6.3-r4.ebuild +++ b/sys-devel/gdb/gdb-6.3-r4.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# 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.3-r4.ebuild,v 1.4 2005/10/21 02:12:43 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-6.3-r4.ebuild,v 1.5 2006/06/22 00:38:43 solar Exp $ inherit flag-o-matic eutils diff --git a/sys-devel/gdb/gdb-6.4-r1.ebuild b/sys-devel/gdb/gdb-6.4-r1.ebuild index 430254c08ee3..0db2a7e5de7e 100644 --- a/sys-devel/gdb/gdb-6.4-r1.ebuild +++ b/sys-devel/gdb/gdb-6.4-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# 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-r1.ebuild,v 1.1 2005/12/09 04:48:35 solar Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-6.4-r1.ebuild,v 1.2 2006/06/22 00:38:43 solar Exp $ inherit flag-o-matic eutils diff --git a/sys-devel/gdb/gdb-6.5-r1.ebuild b/sys-devel/gdb/gdb-6.5-r1.ebuild new file mode 100644 index 000000000000..b750ff4f6dfd --- /dev/null +++ b/sys-devel/gdb/gdb-6.5-r1.ebuild @@ -0,0 +1,98 @@ +# 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.5-r1.ebuild,v 1.1 2006/06/22 00:38:44 solar 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=1 +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 ~x86-fbsd" +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 $(