[commit] update gdb.base/so-impl-ld.exp to use new shared library infrastructure

Paul Gilliam pgilliam@us.ibm.com
Fri Apr 29 20:48:00 GMT 2005


On Wednesday 27 April 2005 08:51, Daniel Jacobowitz wrote:
> On Tue, Apr 19, 2005 at 04:31:03PM -0800, Paul Gilliam wrote:
> > 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.
> 
> This is OK.
> 

Here is the patch I committed.  It is a little bit different in that I fixed a typo and did not mention in the ChangeLog that I updated the copyright notice.

-=# Paul #=-


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

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

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	29 Apr 2005 20:31:40 -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,59 ----
      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 [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
  
*************** gdb_expect {
*** 120,126 ****
  #
  send_gdb "step\n"
  gdb_expect {
!   -re "solib_main .arg=10000. at.*${libfile}1.c:17.*$gdb_prompt $"\
            {pass "step into solib call"}
    -re "$gdb_prompt $"\
            {fail "step into solib call"}
--- 81,87 ----
  #
  send_gdb "step\n"
  gdb_expect {
!   -re "solib_main .arg=10000. at.*${libfile}.c:17.*$gdb_prompt $"\
            {pass "step into solib call"}
    -re "$gdb_prompt $"\
            {fail "step into solib call"}



More information about the Gdb-patches mailing list