Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* constvars.exp & volatile.exp fixes
@ 2001-12-19 12:33 law
  2001-12-19 12:54 ` Fernando Nasser
  0 siblings, 1 reply; 2+ messages in thread
From: law @ 2001-12-19 12:33 UTC (permalink / raw)
  To: gdb-patches


constvars.exp & volatile.exp are failing miserably on the PA when using
GCC.

The problem is we compile these ".c" files with the C++ compiler.

This causes names to be mangled, but because we're working with a .c
file, the debugger has set the language to "C", not "C++".  Therefore
it does not demangle the names.

It appears this was done to pacify HP's compilers; particularly since
if you use GCC all these tests ought to pass without problems.

The fix is pretty obvious.  First, we have to get the compiler info
so that we know whether we're using GCC or one of HP's compilers.  Once
armed with that information, we can arrange to do the right thing for
whatever compiler we happen to be using.

With this change, there are no unexpected failures in either test when
using GCC.

	* gdb.base/constvars.exp: Only set lang to c++ if we're 
	compiling the test with HP's compilers.
	* gdb.base/volatile.exp: Similarly.

Index: constvars.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/constvars.exp,v
retrieving revision 1.8
diff -c -3 -p -r1.8 constvars.exp
*** constvars.exp	2001/09/28 11:46:40	1.8
--- constvars.exp	2001/12/19 20:26:18
*************** set testfile "constvars"
*** 41,47 ****
  set srcfile ${testfile}.c
  set binfile ${objdir}/${subdir}/${testfile}
  
! if [istarget "hppa*-*-*"] {
      set lang "c++"
  } else {
      set lang ""
--- 41,53 ----
  set srcfile ${testfile}.c
  set binfile ${objdir}/${subdir}/${testfile}
  
! # Create and source the file that provides information about the compiler
! # used to compile the test case.
! if [get_compiler_info ${binfile}] {
!     return -1;
! }
! 
! if {$hp_aCC_compiler || $hp_cc_compiler} {
      set lang "c++"
  } else {
      set lang ""
Index: volatile.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/volatile.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 volatile.exp
*** volatile.exp	2001/09/28 11:46:40	1.6
--- volatile.exp	2001/12/19 20:26:18
*************** set testfile "constvars"
*** 49,55 ****
  set srcfile ${testfile}.c
  set binfile ${objdir}/${subdir}/${testfile}
  
! if [istarget "hppa*-*-*"] {
      set lang "c++"
  } else {
      set lang ""
--- 49,61 ----
  set srcfile ${testfile}.c
  set binfile ${objdir}/${subdir}/${testfile}
  
! # Create and source the file that provides information about the compiler
! # used to compile the test case.
! if [get_compiler_info ${binfile}] {
!     return -1;
! }
! 
! if {$hp_aCC_compiler || $hp_cc_compiler} {
      set lang "c++"
  } else {
      set lang ""





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

end of thread, other threads:[~2001-12-19 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 12:33 constvars.exp & volatile.exp fixes law
2001-12-19 12:54 ` Fernando Nasser

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