Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [rfa/testsuite/stabs] weird.exp: skip hp
@ 2004-01-08  0:40 Michael Elizabeth Chastain
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-08  0:40 UTC (permalink / raw)
  To: cagney, mec.gnu; +Cc: ezannoni, gdb-patches

ac> BTW, does your get_compiler_info rewrite mean that those hpcc_... 
ac> variables can eventually be eliminated (replaced by test_compiler_info)?

Hell yeah!

In fact, get_compiler_info logs the value that it calculates for
"compiler_info".  gdb.log looks like this:

  Running /house/chastain/gdb/s1/gdb/testsuite/gdb.base/volatile.exp ...
  get_compiler_info: hpcc-111106
  Executing on host: gcc /house/chastain/gdb/s1/gdb/testsuite/gdb.base/constvars.c -g  -lm   -o /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc/gdb/testsuite/gdb.base/constvars    (timeout = 300)
    GNU gdb 2004-01-07-cvs
    Copyright 2004 Free Software Foundation, Inc.

(Yes, my hpcc compiler is a shell script named "gcc").

And it will be trivial to add more vendor compilers to
compiler.c/compiler.cc:

  #if defined(__SUN_whatever)
  set compiler_info [join {suncc __SUN_whatever} -]
  #endif

  #if defined(__TRU64_blah)
  set compiler_info [join {osfcc __TRU64_blah} -]
  #endif

Michael C


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [rfa/testsuite/stabs] weird.exp: skip hp
@ 2004-01-07 21:59 Michael Elizabeth Chastain
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-07 21:59 UTC (permalink / raw)
  To: ezannoni; +Cc: gdb-patches

Committed.

Another one down, NNNN to go!

Michael C

 > 2004-01-07  Michael Chastain  <mec.gnu@mindspring.com>
 > 
 > 	* gdb.stabs/weird.exp: Use hp_cc_compiler and hp_aCC_compiler
 > 	to test for hp-ux assembler.  Fix copyright years.


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [rfa/testsuite/stabs] weird.exp: skip hp
@ 2004-01-07 21:31 Michael Elizabeth Chastain
  2004-01-07 21:38 ` Elena Zannoni
  2004-01-07 23:59 ` Andrew Cagney
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-07 21:31 UTC (permalink / raw)
  To: ezannoni; +Cc: gdb-patches

This patch fixes weird.exp so that it skips properly on hp-ux.

The old code looked at the CC environment variable.  The new code looks
at hp_cc_compiler and hp_aCC_compiler.

This isn't perfect, because we really want to test for the HP assembler,
not the HP compiler.  If someone is using an HP compiler then of course
they are using the HP assembler.  But if someone is using gcc with the
HP assembler (which is not recommended on hp-ux), then the test script
is going to execute.

If I detect hp_cc_compiler or hp_aCC_compiler, I issue one UNSUPPORTED
message and skip the test script.

I also fixed the copyright years by adding years where patches were
committed to this file on cvs HEAD.  I could do this as a separate
patch if you want.

Tested on:

  native i686-pc-linux-gnu, gcc 2.95.3 3.3.2 HEAD, dwarf-2 and stabs+
  native hppa2.0w-hp-hpux11.11, hp ansi c

Okay to commit?

Michael C

2004-01-07  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.stabs/weird.exp: Use hp_cc_compiler and hp_aCC_compiler
	to test for hp-ux assembler.  Fix copyright years.

Index: gdb.stabs/weird.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.stabs/weird.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 weird.exp
*** gdb.stabs/weird.exp	11 Sep 2003 19:09:46 -0000	1.6
--- gdb.stabs/weird.exp	7 Jan 2004 21:18:43 -0000
***************
*** 1,4 ****
! #   Copyright 1997, 1998, 1999 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, 2001, 2003, 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
*************** if ![file isdirectory ${objdir}/${subdir
*** 33,38 ****
--- 34,57 ----
  set prms_id 0
  set bug_id 0
  
+ set testfile weird
+ set srcfile ${objdir}/${subdir}/weird.s
+ set binfile ${objdir}/${subdir}/weirdx.o
+ 
+ if { [ get_compiler_info "$binfile" ] } {
+     return -1
+ }
+ 
+ if { $hp_cc_compiler || $hp_aCC_compiler } {
+     # The native hp-ux assembler does not support stabs at all.
+     # If the compiler is native hp-ux, of course the assembler is too.
+     # But if someone builds gcc with the native assembler (not recommended)
+     # rather than the gnu assembler, then this logic will not suppress it.
+     # -- chastain 2004-01-07
+     unsupported "stabs with HP assembler"
+     continue
+ }
+ 
  proc do_tests {} {
  	global binfile
  	global gdb_prompt
*************** proc print_weird_var { var } {
*** 236,244 ****
  
  # Don't use gdb_load; it doesn't bitch if the loading produced some
  # error messages during symbol reading.
- set testfile weird
- set srcfile ${objdir}/${subdir}/weird.s
- set binfile ${objdir}/${subdir}/weirdx.o
  
  global target_os
  set sedscript ${srcdir}/${subdir}/aout.sed
--- 255,260 ----
*************** switch -glob ${target_triplet} {
*** 266,284 ****
      }
  }
  
- 
  # Hope this is a Unix box.
  set exec_output [remote_exec build "sed" "-f ${sedscript}" "${srcdir}/${subdir}/weird.def" "${srcfile}"]
  if { [lindex $exec_output 0] != 0 } {
      perror "Couldn't make test case. $exec_output"
      return -1
  }
- 
- # HP's assembler has no idea of what to do with .stab directives; detect the
- # use of HP compilers and escape from here.  (No doubt a better heuristic
- # could be devised.)
- 
- if { [ info exists CC ] && [ string first "/opt/ansic/bin/cc" "$CC" ] >= 0 } then { continue }
  
  if  { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
--- 282,293 ----


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-08  0:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08  0:40 [rfa/testsuite/stabs] weird.exp: skip hp Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2004-01-07 21:59 Michael Elizabeth Chastain
2004-01-07 21:31 Michael Elizabeth Chastain
2004-01-07 21:38 ` Elena Zannoni
2004-01-07 23:59 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox