Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Sep 2002 13:56:43 +0200
From:      Hans Ottevanger <hansot@iae.nl>
To:        qa@freebsd.org
Cc:        stable@freebsd.org
Subject:   gdb: Deprecated bfd_read called (4.7-RC1 and STABLE) [patch]
Message-ID:  <3D92F5FB.F6A6C73B@iae.nl>

next in thread | raw e-mail | index | archive | help
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-qa" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D92F5FB.F6A6C73B>