From owner-freebsd-stable Thu Sep 26 4:56:54 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C54C437B401; Thu, 26 Sep 2002 04:56:50 -0700 (PDT) Received: from amsfep14-int.chello.nl (nl-ams-slo-l4-02-pip-5.chellonetwork.com [213.46.243.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34E7443E6E; Thu, 26 Sep 2002 04:56:49 -0700 (PDT) (envelope-from hansot@iae.nl) Received: from iae.nl ([213.46.9.162]) by amsfep14-int.chello.nl (InterMail vM.5.01.03.06 201-253-122-118-106-20010523) with ESMTP id <20020926115643.LBLQ1429.amsfep14-int.chello.nl@iae.nl>; Thu, 26 Sep 2002 13:56:43 +0200 Message-ID: <3D92F5FB.F6A6C73B@iae.nl> Date: Thu, 26 Sep 2002 13:56:43 +0200 From: Hans Ottevanger X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.7-RC i386) X-Accept-Language: en MIME-Version: 1.0 To: qa@freebsd.org Cc: stable@freebsd.org Subject: gdb: Deprecated bfd_read called (4.7-RC1 and STABLE) [patch] Content-Type: multipart/mixed; boundary="------------7C76AF5560C583C4D92A7342" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------7C76AF5560C583C4D92A7342 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi folks, On both 4.7-RC1 and STABLE (cvsup'ed at about 8 AM GMT today) I get the following "warnings" when starting gdb : $ gdb a.out GNU gdb 4.18 (FreeBSD) Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 2627 in elfstab_build_psymtabs Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 933 in fill_symbuf (gdb) Once started, gdb functions as usual. These annoying messages are most likely caused by the recent import of new binutils. It was also reported to -stable by Aurelien Nephtali on 3 Sep 2002. An obvious solution is to replace all calls to "bfd_read" in "/usr/src/contrib/gdb/gdb/dbxread.c" with the appropriate call to "bfd_bread". I have done this, and it works (see attached patch). Probably the same should be done for the files "coffread.c", "dwarfread.c" and "dwarf2read.c". I have no way to test that however, and consequently have not done that. I hope this solution still makes it into 4.7-RELEASE. The warnings look quite silly, and it is easy to patch. Kind regards, Hans --------------7C76AF5560C583C4D92A7342 Content-Type: text/plain; charset=us-ascii; name="dbxread.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dbxread.c.diff" Index: dbxread.c =================================================================== RCS file: /home/ncvs/src/contrib/gdb/gdb/dbxread.c,v retrieving revision 1.2.2.1 diff -u -d -r1.2.2.1 dbxread.c --- dbxread.c 20 Jul 2000 03:18:28 -0000 1.2.2.1 +++ dbxread.c 26 Sep 2002 10:06:43 -0000 @@ -694,7 +694,7 @@ perror_with_name (name); memset ((PTR) size_temp, 0, sizeof (size_temp)); - val = bfd_read ((PTR) size_temp, sizeof (size_temp), 1, sym_bfd); + val = bfd_bread ((PTR) size_temp, sizeof (size_temp), sym_bfd); if (val < 0) { perror_with_name (name); @@ -733,7 +733,7 @@ val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET); if (val < 0) perror_with_name (name); - val = bfd_read (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), 1, + val = bfd_bread (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), sym_bfd); if (val != DBX_STRINGTAB_SIZE (objfile)) perror_with_name (name); @@ -930,7 +930,7 @@ count = sizeof (symbuf); } - nbytes = bfd_read ((PTR)symbuf, count, 1, sym_bfd); + nbytes = bfd_bread ((PTR)symbuf, count, sym_bfd); if (nbytes < 0) perror_with_name (bfd_get_filename (sym_bfd)); else if (nbytes == 0) @@ -2518,7 +2518,7 @@ val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET); if (val < 0) perror_with_name (name); - val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, 1, sym_bfd); + val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd); if (val != stabstrsize) perror_with_name (name); @@ -2624,7 +2624,7 @@ val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET); if (val < 0) perror_with_name (name); - val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, 1, sym_bfd); + val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd); if (val != stabstrsize) perror_with_name (name); --------------7C76AF5560C583C4D92A7342-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message