This is the mail archive of the gdb-patches@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: [patch] update gdb.base/so-impl-ld.exp to use new shared library infrastructure


On Thursday 14 April 2005 12:32, Daniel Jacobowitz wrote:
> I just noticed that all of your patches I approved this afternoon
> add new calls to gdb_suppress_entire_file; on first reading I thought
> they were just moving that bit around.  Please don't add new calls to
> that function.  Call "untested" with a message and then return -1
> instead.
> 
> On Thu, Apr 14, 2005 at 08:55:01AM -0800, Paul Gilliam wrote:
> > - # This test is presently only valid on HP-UX, since it requires
> > - # that we use HP-UX-specific compiler & linker options to build
> > - # the testcase.
> > - # Actually this test works on solaris, and linux too.
> > -  
> > - if {! ([istarget "hppa*-*-*hpux*"]
> > -        || [istarget "sparc-sun-solaris*"]
> > -        || [istarget "*-*-linux-gnu*"]) } {
> > - 	 return
> > - }
> 
> Specifically, this means the test was previously quiet on platforms
> which couldn't build shared libraries.  Now it's going to be very
> noisy.
> 
> > ! if {$hp_cc_compiler} {
> > !     set additional_flags "additional_flags=-Ae"
> > ! } else {
> > !     set additional_flags ""
> > ! }
> 
> The shared library helpers don't subsume this bit.
> 
Here is the revised patch:

2005-04-19  Paul Gilliam  <pgilliam@us.ibm.com>

	* gdb.base/so-impl-ld.exp: Use new shared library infrastructure
        and update copyright.

Index: gdb.base/so-impl-ld.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/so-impl-ld.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 so-impl-ld.exp
*** gdb.base/so-impl-ld.exp	5 Dec 2003 01:53:46 -0000	1.6
--- gdb.base/so-impl-ld.exp	20 Apr 2005 00:00:08 -0000
***************
*** 1,4 ****
! # Copyright 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,5 ----
! # Copyright 1997, 1998, 1999, 2000, 2001, 2003, 2005
! # Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
***************
*** 12,21 ****
  # 
  # You should have received a copy of the GNU General Public License
  # along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
! 
! # Please email any bugs, comments, and/or additions to this file to:
! # bug-gdb@prep.ai.mit.edu
  
  if $tracelevel then {
  	strace $tracelevel
--- 13,19 ----
  # 
  # You should have received a copy of the GNU General Public License
  # along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
  if $tracelevel then {
  	strace $tracelevel
*************** if ![isnative] then {
*** 29,98 ****
      return
  }
  
- # This test is presently only valid on HP-UX, since it requires
- # that we use HP-UX-specific compiler & linker options to build
- # the testcase.
- # Actually this test works on solaris, and linux too.
-  
- if {! ([istarget "hppa*-*-*hpux*"]
-        || [istarget "sparc-sun-solaris*"]
-        || [istarget "*-*-linux-gnu*"]) } {
- 	 return
- }
- 
- set libfile "solib"
  set testfile "so-impl-ld"
! set srcfile ${testfile}.c
! set binfile ${objdir}/${subdir}/${testfile}
! 
! if [get_compiler_info ${binfile}] {
!     return -1
! }
! 
! # Build the shared libraries this test case needs.
! #
! #cd ${subdir}
! #remote_exec build "$CC -g +z -c ${libfile}1.c -o ${libfile}1.o"
  
  
! if { [test_compiler_info gcc-*-*] } then {
!     set additional_flags "additional_flags=-fpic"
! } else {
!     if [istarget "hppa*-hp-hpux*"] then {
! 	set additional_flags "additional_flags=+z"
!     } else {
! 	# don't know that the compiler is, hope for the best...
! 	set additional_flags ""
!     }
! }
! 
! if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${libfile}1.o" object [list debug $additional_flags]] != ""} {
!     perror "Couldn't compile ${libfile}1.c"
      return -1
  }
  
! if [istarget "hppa*-hp-hpux*"] then {
!     remote_exec build "ld -b ${libfile}1.o -o ${objdir}/${subdir}/${libfile}1.sl"
! } else {
!     set additional_flags "additional_flags=-shared"
!     gdb_compile "${libfile}1.o" "${objdir}/${subdir}/${libfile}1.sl" executable [list debug $additional_flags]
! }
! 
! # Build the test case
! #remote_exec build "$CC -Aa -g ${srcfile} ${libfile}1.sl -o ${binfile}"
! 
! 
! if {$hp_cc_compiler} {
!     set additional_flags "additional_flags=-Ae"
! } else {
!     set additional_flags ""
  }
  
! if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}/${libfile}1.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
!     perror "Couldn't build ${binfile}"
      return -1
  }
- #cd ..
  
  # Start with a fresh gdb
  
--- 27,55 ----
      return
  }
  
  set testfile "so-impl-ld"
! set libfile "solib1"
! set srcfile $srcdir/$subdir/$testfile.c
! set libsrc  $srcdir/$subdir/$libfile.c
! set binfile $objdir/$subdir/$testfile
! set lib_sl  $objdir/$subdir/$libfile.sl
  
+ set lib_opts  debug
+ set exec_opts [list debug shlib=$lib_sl]
  
! if [get_compiler_info ${binfile}] {
      return -1
  }
  
! if [test_compiler_info "hpcc-*"] {
!     lappend exec_opts "additional_flags=-Ae"
  }
  
! if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
!      || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
!     untested "Couldn't compile $libsrc or $srcfile."
      return -1
  }
  
  # Start with a fresh gdb
  


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