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: [RFA] Add shared object relocation tests


On Tue, Jun 03, 2003 at 11:14:44AM +0100, Raoul Gough wrote:
> I've written a test for load-time relocation of shared objects, to verify
> that the symbols in gdb match the real (loaded) locations in memory.
> This was originally designed to test some patches to coffread.c, but
> is probably appropriate wherever shared objects are available. This
> is related to PR 1132 in Gnats. Tested under i686-pc-cygwin and
> i686-pc-linux.
> 
> There may be problems on systems where shared objects are not
> supported - this will probably result in compilation or linkage
> failures during the test (and I think the test is then skipped?).
> 
> This would add the following files to src/gdb/testsuite/gdb.base:
> 
> shreloc.exp
> shreloc.c
> shreloc1.c
> shreloc2.c
> 
> Should I go ahead and add the new files?

First of all, even new files get a changelog entry.  It will go in
gdb/testeuite/ChangeLog.

> foreach module [list "shreloc" "shreloc1" "shreloc2"] {
>     if {[gdb_compile "${srcdir}/${subdir}/${module}.c" "${workdir}/${module}.o" object {debug}] != ""} {
>  gdb_suppress_entire_file "${module}.c compile failed, so all tests in this file will automatically fail."
>  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]] != ""} {
>  gdb_suppress_entire_file "${module}.dll link failed, so all tests in this file will automatically fail."
>  return -1
>     }
> }
> 
> if {[gdb_compile [list "${workdir}/shreloc.o" "${workdir}/shreloc1.dll" "${workdir}/shreloc2.dll"] "${workdir}/shreloc" executable
> debug] != ""} {
>     gdb_suppress_entire_file "shreloc link failed, so all tests in this file will automatically fail."
>     return -1
> }

Please just use return, not gdb_suppress_entire_file.  In particular,
using both causes the _next_ test to fail, I think.

Other than those two details, this is OK.  Give other people a day or
so to comment and then check it in.

-- 
Daniel Jacobowitz
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]