From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14584 invoked by alias); 4 Feb 2004 22:31:11 -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 14575 invoked from network); 4 Feb 2004 22:31:10 -0000 Received: from unknown (HELO smtp10.atl.mindspring.net) (207.69.200.246) by sources.redhat.com with SMTP; 4 Feb 2004 22:31:10 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by smtp10.atl.mindspring.net with esmtp (Exim 3.33 #1) id 1AoVXt-0007Y1-00; Wed, 04 Feb 2004 17:30:57 -0500 Received: by berman.michael-chastain.com (Postfix, from userid 502) id 7766C4B364; Wed, 4 Feb 2004 17:31:04 -0500 (EST) To: cagney@gnu.org, mec.gnu@mindspring.com Subject: Re: Problems with dejagnu and c++ tests... Cc: brobecker@gnat.com, gdb-patches@sources.redhat.com Message-Id: <20040204223104.7766C4B364@berman.michael-chastain.com> Date: Wed, 04 Feb 2004 22:31:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2004-02/txt/msg00084.txt.bz2 ac> (aren't we trying to delete gcc_compiled? :-) Yes. When the last reference to gcc_compiled goes away, then we can remove the code that initializes it. ac> Something based on CPP would be more robust, and avoid assumptions such ac> as the target has output and can correctly compile / execute code. ac> Consider what happens when trying to bring up a new GDB+GCC+.... We're running the test suite. If gdb_compile does not work, or the resulting executables cannot be run, then the test script cannot run its tests anyways. Just look at the code in gdb.cp/ambiguous.exp or anywhere else that calls get_compiler_info: if [get_compiler_info ${binfile} "c++"] { return -1; } ... if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } ... gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} get_compiler_info is always followed by gdb_compile. get_compiler_info should use the same compiler as gdb_compile. Also, read the comments at the beginning of get_compiler_info. 'Something based on CPP' has a lot of problems with any implementation that I can think of. gdb 6.0 had four different implementations: most targets with c most targets with c++ hpux|irix with c hpux|irix with c++ "most targets with c" and "most targets with c++" depended on a non-standard gcc extension, which is why the hpux|irix targets needed special cases. hpux|irix with c++ *did not work*. It used about 100 lines of special code but did not even use the same compiler as gdb_compile, so it invoked a different compiler and set the variables wrong. That's what drove me to rewrite get_compiler_info in the first place. Michael C