From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18545 invoked by alias); 30 Apr 2005 09:06:57 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18447 invoked from network); 30 Apr 2005 09:06:37 -0000 Received: from unknown (HELO ausmtp01.au.ibm.com) (202.81.18.186) by sourceware.org with SMTP; 30 Apr 2005 09:06:37 -0000 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp01.au.ibm.com (8.12.10/8.12.10) with ESMTP id j3U98o4q357842 for ; Sat, 30 Apr 2005 19:08:53 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0112e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j3U99Fjc117184 for ; Sat, 30 Apr 2005 19:09:15 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id j3U96U9f007570 for ; Sat, 30 Apr 2005 19:06:30 +1000 Received: from [127.0.0.1] ([9.181.134.65]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id j3U96QDI007521; Sat, 30 Apr 2005 19:06:28 +1000 Message-ID: <42734A7E.1030208@cn.ibm.com> Date: Sat, 30 Apr 2005 09:06:00 -0000 From: Wu Zhou User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: pgilliam@us.ibm.com CC: gdb-patches@sources.redhat.com, Daniel Jacobowitz Subject: Re: [patch] update gdb.base/shreloc.exp to use new shared library infrastructure References: <200504131013.36814.pgilliam@us.ibm.com> <200504191731.06753.pgilliam@us.ibm.com> <20050427155733.GB8399@nevyn.them.org> <200504291617.53756.pgilliam@us.ibm.com> In-Reply-To: <200504291617.53756.pgilliam@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-04/txt/msg00444.txt.bz2 Hi, Paul and Daniel I made some little modification to the comments on the xlc-specific options and also added a short text in changelog to explain why they are necessary. I wish that I could make myself understood. But if there are any errors or confusion, please feel free to let me know. Thanks. Here goes the revised patch: 2005-04-29 Paul Gilliam Wu Zhou * gdb.base/shreloc.exp: Change to use new shared library infrastructure and allow use of IBM's xlc compiler. * gdb.base/shreloc.exp: Add IBM's xlc specific option "-qdbxextra" to keep unused static variables(static_var_1 & static_var_2), and option "-qstatsym" to add them into msymtab Index: gdb.base/shreloc.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shreloc.exp,v retrieving revision 1.2 diff -c -3 -p -r1.2 shreloc.exp *** gdb.base/shreloc.exp 11 Nov 2003 17:58:28 -0000 1.2 --- gdb.base/shreloc.exp 30 Apr 2005 02:55:15 -0000 *************** *** 1,4 **** ! # Copyright (C) 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,4 ---- ! # Copyright (C) 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 *************** *** 15,23 **** # 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 - # Tests for shared object file relocation. If two shared objects have # the same load address (actually, overlapping load spaces), one of # them gets relocated at load-time. Check that gdb gets the right --- 15,20 ---- *************** set prms_id 0 *** 40,71 **** set bug_id 0 set workdir ${objdir}/${subdir} ! foreach module [list "shreloc" "shreloc1" "shreloc2"] { ! if {[gdb_compile "${srcdir}/${subdir}/${module}.c" "${workdir}/${module}.o" object {debug}] != ""} { ! untested "Couldn't compile ${module}.c" ! return -1 ! } } ! set additional_flags "additional_flags=-shared" if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { ! set additional_flags "${additional_flags} -Wl,--image-base,0x04000000" } ! foreach module [list "shreloc1" "shreloc2"] { ! if {[gdb_compile "${workdir}/${module}.o" "${workdir}/${module}.dll" executable [list debug $additional_flags]] != ""} { ! untested "Couldn't link ${module}.dll" ! return -1 ! } } ! if {[gdb_compile [list "${workdir}/shreloc.o" "${workdir}/shreloc1.dll" "${workdir}/shreloc2.dll"] "${workdir}/shreloc" executable debug] != ""} { ! untested "Couldn't link shreloc executable" return -1 } gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir --- 37,91 ---- set bug_id 0 set workdir ${objdir}/${subdir} + set testfile "shreloc" + set libfile1 "shreloc1" + set libfile2 "shreloc2" + set srcfile $srcdir/$subdir/$testfile.c + set lib1src $srcdir/$subdir/$libfile1.c + set lib2src $srcdir/$subdir/$libfile2.c + set binfile $objdir/$subdir/$testfile + set lib1_sl $objdir/$subdir/$libfile1.sl + set lib2_sl $objdir/$subdir/$libfile2.sl ! if [get_compiler_info ${binfile}] { ! return -1 } ! set lib_opts "debug" ! set exec_opts [list debug shlib=$lib1_sl shlib=$lib2_sl] if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { ! lappend lib_opts "additional_flags=-Wl,--image-base,0x04000000" } ! if [test_compiler_info "xlc-*"] { ! ! # static variable static_var_1 & static_var_2 are not used anywhere, IBM's ! # xlc compiler optimizes them out by default, "-qdbxextra" adds them back ! ! lappend lib_opts "additional_flags=-qdbxextra" ! ! # IBM's xlc compiler doesn't add static variables to the symtab by default, ! # so there is no static_var_1 & static_var_2 in the output of "maint print ! # msymbols ${msymfile}", "-qstatsym" causes them to be added. ! ! lappend lib_opts "additional_flags=-qstatsym" ! } ! if { [gdb_compile_shlib $lib1src $lib1_sl $lib_opts] != ""} { ! untested "Could not build $lib1_sl." ! return -1 ! } elseif { [gdb_compile_shlib $lib2src $lib2_sl $lib_opts] != ""} { ! untested "Could not build $lib1_s2." ! return -1 ! } elseif { [gdb_compile $srcfile $binfile executable $exec_opts] != ""} { ! untested "Could not build $binfile." return -1 } + # Start with a fresh gdb. + gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir ===================end of the patch======================= Paul Gilliam wrote: >On Wednesday 27 April 2005 08:57, Daniel Jacobowitz wrote: > > >>On Tue, Apr 19, 2005 at 04:31:06PM -0800, Paul Gilliam wrote: >> >> >>>On Thursday 14 April 2005 12:23, Daniel Jacobowitz wrote: >>> >>> >>>>On Wed, Apr 13, 2005 at 09:13:36AM -0800, Paul Gilliam wrote: >>>> >>>> >>>>>This patch updates gdb.base/shreloc.exp to use the new shared library infrastructure in >>>>>lib/gdb.exp. All the stuff that has been cut from shlib-call.exp is now part of 'gdb-compile' >>>>>or 'gdb-compile-shlib' (new) in lib/gdb.exp. >>>>> >>>>>This patch depends on the shared infrastructure patch: >>>>> http://sources.redhat.com/ml/gdb-patches/2005-04/msg00096.html >>>>> >>>>> >>>>Waitasec... >>>> >>>> >>>> >>>>>! set additional_flags "additional_flags=-shared" >>>>>! >>>>>! if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { >>>>>! set additional_flags "${additional_flags} -Wl,--image-base,0x04000000" >>>>> } >>>>> >>>>> >>>>The common bits don't have support for cygwin/mingw32 DLLs. So just >>>>removing this isn't right. >>>> >>>> >>>> >>>>>! set lib_opts [list debug additional_flags=-qstatsym additional_flags=-qdbxextra] >>>>> >>>>> >>>>Remind me what this option means? >>>> >>>> >>>> >>>> >>>Here is the next rev of the patch: >>> >>>2005-04-19 Paul Gilliam >>> >>> * gdb.base/shreloc.exp: Change to use new shared library infrastructure >>> and update copyright date. >>> >>> >>The changelog doesn't mention the xlc changes; it should. The xlc >>changes need comments explaining both what the options do, and (the bit >>I haven't seen yet) why they are necessary for this test case. You >>still removed the cygwin bits. >> >> >> >> > >Here is the latest version of this patch. I think I got what you are asking for except for comments explaining why >the xlc options are necessary for this test case. > >My team-mate, Wu Zhou (who now has his own copyright assignment on-file with the FSF) could shed some light on this. > >-=# Paul #=- > >2005-04-29 Paul Gilliam > > * gdb.base/shreloc.exp: Change to use new shared library > infrastructure and allow use of IBM's xlc compiler. > >Index: gdb.base/shreloc.exp >=================================================================== >RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shreloc.exp,v >retrieving revision 1.2 >diff -c -3 -p -r1.2 shreloc.exp >*** gdb.base/shreloc.exp 11 Nov 2003 17:58:28 -0000 1.2 >--- gdb.base/shreloc.exp 29 Apr 2005 22:55:44 -0000 >*************** >*** 1,4 **** >! # Copyright (C) 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,4 ---- >! # Copyright (C) 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 >*************** >*** 15,23 **** > # 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 >- > # Tests for shared object file relocation. If two shared objects have > # the same load address (actually, overlapping load spaces), one of > # them gets relocated at load-time. Check that gdb gets the right >--- 15,20 ---- >*************** set prms_id 0 >*** 40,71 **** > set bug_id 0 > > set workdir ${objdir}/${subdir} > >! foreach module [list "shreloc" "shreloc1" "shreloc2"] { >! if {[gdb_compile "${srcdir}/${subdir}/${module}.c" "${workdir}/${module}.o" object {debug}] != ""} { >! untested "Couldn't compile ${module}.c" >! return -1 >! } > } > >! set additional_flags "additional_flags=-shared" > > if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { >! set additional_flags "${additional_flags} -Wl,--image-base,0x04000000" > } > >! foreach module [list "shreloc1" "shreloc2"] { >! if {[gdb_compile "${workdir}/${module}.o" "${workdir}/${module}.dll" executable [list debug $additional_flags]] != ""} { >! untested "Couldn't link ${module}.dll" >! return -1 >! } > } > >! if {[gdb_compile [list "${workdir}/shreloc.o" "${workdir}/shreloc1.dll" "${workdir}/shreloc2.dll"] "${workdir}/shreloc" executable debug] != ""} { >! untested "Couldn't link shreloc executable" > return -1 > } > > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir >--- 37,89 ---- > set bug_id 0 > > set workdir ${objdir}/${subdir} >+ set testfile "shreloc" >+ set libfile1 "shreloc1" >+ set libfile2 "shreloc2" >+ set srcfile $srcdir/$subdir/$testfile.c >+ set lib1src $srcdir/$subdir/$libfile1.c >+ set lib2src $srcdir/$subdir/$libfile2.c >+ set binfile $objdir/$subdir/$testfile >+ set lib1_sl $objdir/$subdir/$libfile1.sl >+ set lib2_sl $objdir/$subdir/$libfile2.sl > >! if [get_compiler_info ${binfile}] { >! return -1 > } > >! set lib_opts "debug" >! set exec_opts [list debug shlib=$lib1_sl shlib=$lib2_sl] > > if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { >! lappend lib_opts "additional_flags=-Wl,--image-base,0x04000000" > } > >! if [test_compiler_info "xlc-*"] { >! >! # IBM's xlc compiler doesn't add static variables to the symtab by default; >! # "-qstatsym" causes them to be added. >! >! lappend lib_opts "additional_flags=-qstatsym" >! >! # IBM's xlc compiler will optimize un-used varialbes out of the symtab. >! # "-qdbxextra" disable this default behavior. >! >! lappend lib_opts "additional_flags=-qdbxextra" > } > >! if { [gdb_compile_shlib $lib1src $lib1_sl $lib_opts] != ""} { >! untested "Could not build $lib1_sl." >! return -1 >! } elseif { [gdb_compile_shlib $lib2src $lib2_sl $lib_opts] != ""} { >! untested "Could not build $lib1_s2." >! return -1 >! } elseif { [gdb_compile $srcfile $binfile executable $exec_opts] != ""} { >! untested "Could not build $binfile." > return -1 > } > >+ # Start with a fresh gdb. >+ > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > > >