This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb/461: gdb.base/relocate.exp fails with gcc 2.96-rh


The following reply was made to PR gdb/461; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: mec@shout.net
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/461: gdb.base/relocate.exp fails with gcc 2.96-rh
Date: Fri, 5 Apr 2002 10:36:47 -0500

 On Fri, Apr 05, 2002 at 03:26:07PM -0000, mec@shout.net wrote:
 > 
 > >Number:         461
 > >Category:       gdb
 > >Synopsis:       gdb.base/relocate.exp fails with gcc 2.96-rh
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Apr 05 07:28:00 PST 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     mec@shout.net
 > >Release:        gdb cvs 2002-04-04
 > >Organization:
 > >Environment:
 > target=native, host=i686-pc-linux-gnu%rh-7.2, gdb=HEAD%20020404, gcc=vendor, goption=-gdwarf-2
 > target=native, host=i686-pc-linux-gnu%rh-7.2, gdb=HEAD%20020404, gcc=vendor, goption=-gstabs+
 > >Description:
 > gdb.base/relocate.exp is a new test script (since 2002-03-31).  It pops a FAIL when I use the vendor gcc compiler.
 > 
 >   print &function_bar^M
 >   $6 = (int (*)()) 0xc <global_bar>^M
 >   (gdb) FAIL: gdb.base/relocate.exp: get address of function_bar (unknown output)
 > 
 > The bug is that gdb prints "global_bar" (a data symbol) instead of "function_bar" (a text symbol).
 > 
 > This happens with both -gdwarf-2 and -gstabs+.
 > 
 > This test works with:
 > 
 >   gcc 2.95.3 + binutils 2.11.2
 >   gcc 3.0.4 + binutils 2.11.2
 >   gcc gcc-3_1-branch%20020404 + binutils HEAD%20020404
 >   gcc HEAD%20020404 + binutils HEAD%20020404
 > 
 > This test fails with:
 > 
 >   gcc vendor + binutils vendor
 > 
 > The bug is likely to be sensitive to the version of binutils used.
 > 
 > My test suite trees are available at:
 > 
 >  ftp://ftp.shout.net/pub/users/mec/gdb/2002-04-04,native,i686-pc-linux-gnu%rh-7.2,HEAD,vendor,g-dwarf-2.tar.gz
 >  ftp://ftp.shout.net/pub/users/mec/gdb/2002-04-04,native,i686-pc-linux-gnu%rh-7.2,HEAD,vendor,g-stabs+.tar.gz
 >  ftp://ftp.shout.net/pub/users/mec/gdb/2002-04-04,HEAD,testsuite-src.tar.gz
 >   
 > >How-To-Repeat:
 > Run the gdb.base/relocate.exp with vendor gcc on red hat linux 7.2
 
 Try this patch.
 
 Index: relocate.exp
 ===================================================================
 RCS file: /cvs/src/src/gdb/testsuite/gdb.base/relocate.exp,v
 retrieving revision 1.1
 diff -u -p -r1.1 relocate.exp
 --- relocate.exp	2002/04/05 02:45:48	1.1
 +++ relocate.exp	2002/04/05 15:36:04
 @@ -66,10 +66,10 @@ gdb_start
  gdb_reinitialize_dir $srcdir/$subdir
  
  # Load the object file.
 -gdb_test "add-symbol-file ${binfile} 0" \
 +gdb_test "add-symbol-file ${binfile} 0x1000" \
  	"Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
 -	"add-symbol-file ${testfile}.o 0" \
 -	"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x0\[\r\n\]+\\(y or n\\) " \
 +	"add-symbol-file ${testfile}.o 0x1000" \
 +	"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x1000\[\r\n\]+\\(y or n\\) " \
  	"y"
  
  # Print the addresses of static variables.
 
 
 -- 
 Daniel Jacobowitz                           Carnegie Mellon University
 MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]