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/shlib-call.exp to use new shared library infrastructure


On Thursday 14 April 2005 12:12, Daniel Jacobowitz wrote:
> On Tue, Apr 12, 2005 at 12:33:12PM -0800, Paul Gilliam wrote:
> > 2005-04-12  Paul Gilliam  <pgilliam@us.ibm.com>
> > 
> > 	* gdb.base/shlib-call.exp: Change to use new shared library infrastructure and update
> > 	copyright date.
> 
> OK, and thanks.
> 
> > ! if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
> > ! ||   [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
> > ! ||   [gdb_compile ${srcfile} ${binfile} executable $exec_opts] != ""} {
> > !     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> >   }
> 
> Mind fixing the indentation?  Just like in C, the || should be
> indented to go along with the braces.
> 
> if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
>      || [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
>      || [gdb_compile ${srcfile} ${binfile} executable $exec_opts] != ""} {
> 
OK, here is the revised patch:

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

	* gdb.base/shlib-call.exp: Change to use new shared library 
        infrastructure and update copyright date.

Index: gdb.base/shlib-call.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shlib-call.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 shlib-call.exp
*** gdb.base/shlib-call.exp	7 Jun 2004 15:24:44 -0000	1.9
--- gdb.base/shlib-call.exp	19 Apr 2005 23:59:25 -0000
***************
*** 1,4 ****
! #   Copyright 1997, 1998, 1999, 2000, 2004 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,4 ----
! #   Copyright 1997, 1998, 1999, 2000, 2004, 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
*************** if ![isnative] then {
*** 45,122 ****
  }
  
  set testfile "shmain"
! set libfile "shr"
! set srcfile ${testfile}.c
! set binfile ${objdir}/${subdir}/${testfile}
  
- # build the first test case
  if [get_compiler_info ${binfile}] {
      return -1
  }
  
! if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != "" } {
!      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
! 
! 
! # Build the shared libraries this test case needs.
! #
! 
! if {$gcc_compiled == 0} {
!     if [istarget "hppa*-hp-hpux*"] then {
! 	set additional_flags "additional_flags=+z"
!     } elseif { [istarget "mips-sgi-irix*"] } {
! 	# Disable SGI compiler's implicit -Dsgi
! 	set additional_flags "additional_flags=-Usgi"
!     } else {
! 	# don't know what the compiler is...
! 	set additional_flags ""
!     }
! } else {
!     if { ([istarget "powerpc*-*-aix*"]
!        || [istarget "rs6000*-*-aix*"]) } {
! 	set additional_flags ""
!     } else {
! 	set additional_flags "additional_flags=-fpic"
!     }
! }
! 
! if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${objdir}/${subdir}/${libfile}1.o" object [list debug $additional_flags]] != ""} {
!      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
! 
! if {[gdb_compile "${srcdir}/${subdir}/${libfile}2.c" "${objdir}/${subdir}/${libfile}2.o" object [list debug $additional_flags]] != ""} {
!      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
! 
! if [istarget "hppa*-*-hpux*"] {
!     remote_exec build "ld -b ${objdir}/${subdir}/${libfile}1.o -o ${objdir}/${subdir}/${libfile}1.sl"
!     remote_exec build "ld -b ${objdir}/${subdir}/${libfile}2.o -o ${objdir}/${subdir}/${libfile}2.sl"
! } else {
!     set additional_flags "additional_flags=-shared"
!     if {[gdb_compile "${objdir}/${subdir}/${libfile}1.o" "${objdir}/${subdir}/${libfile}1.sl" executable [list debug $additional_flags]] != ""} {
! 	gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
!     }
!     if {[gdb_compile "${objdir}/${subdir}/${libfile}2.o" "${objdir}/${subdir}/${libfile}2.sl" executable [list debug $additional_flags]] != ""} {
! 	gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
!     }
! }
! 
! if { ($gcc_compiled 
!       &&  ([istarget "powerpc*-*-aix*"]
! 	|| [istarget "rs6000*-*-aix*"] )) } {
!     set additional_flags "additional_flags=-L${objdir}/${subdir}"
! } elseif { [istarget "mips-sgi-irix*"] } {
!     set additional_flags "additional_flags=-rpath ${objdir}/${subdir}"
! } else {
!     set additional_flags ""
! }
! if {[gdb_compile "${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}1.sl ${objdir}/${subdir}/${libfile}2.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
!      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
- 
- 
  # Start with a fresh gdb.
  
  gdb_exit
--- 45,73 ----
  }
  
  set testfile "shmain"
! set libfile1 "shr1"
! set libfile2 "shr2"
! set srcfile  ${srcdir}/${subdir}/${testfile}.c
! set lib1src  ${srcdir}/${subdir}/${libfile1}.c
! set lib2src  ${srcdir}/${subdir}/${libfile2}.c
! set lib1     ${objdir}/${subdir}/${libfile1}.sl
! set lib2     ${objdir}/${subdir}/${libfile2}.sl
! set binfile  ${objdir}/${subdir}/${testfile}
! 
! set lib_opts "debug"
! set exec_opts [list debug shlib=${lib1} shlib=${lib2}]
  
  if [get_compiler_info ${binfile}] {
      return -1
  }
  
! if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
!      || [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
!      || [gdb_compile ${srcfile} ${binfile} executable $exec_opts] != ""} {
!     untested "Could not compile $lib1, $lib2, or $srcfile."
!     return -1
  }
  
  # Start with a fresh gdb.
  
  gdb_exit


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