From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27895 invoked by alias); 19 Dec 2001 20:33:18 -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 27676 invoked from network); 19 Dec 2001 20:32:00 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 19 Dec 2001 20:32:00 -0000 Received: from porcupine.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id MAA11094 for ; Wed, 19 Dec 2001 12:31:56 -0800 (PST) Received: from porcupine.cygnus.com (law@localhost) by porcupine.cygnus.com (8.11.6/8.11.6) with ESMTP id fBJKVSP22601 for ; Wed, 19 Dec 2001 13:31:29 -0700 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 To: gdb-patches@sources.redhat.com Reply-to: law@redhat.com From: law@redhat.com Subject: constvars.exp & volatile.exp fixes Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 19 Dec 2001 12:33:00 -0000 Message-ID: <22600.1008793888@porcupine.cygnus.com> X-SW-Source: 2001-12/txt/msg00479.txt.bz2 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 ""