From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27086 invoked by alias); 30 Jul 2004 05:59:51 -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 27079 invoked from network); 30 Jul 2004 05:59:50 -0000 Received: from unknown (HELO maynard.mail.mindspring.net) (207.69.200.243) by sourceware.org with SMTP; 30 Jul 2004 05:59:50 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by maynard.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1BqQQh-0004Qt-00; Fri, 30 Jul 2004 01:59:43 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id 2CFA74B102; Fri, 30 Jul 2004 02:00:02 -0400 (EDT) Date: Fri, 30 Jul 2004 05:59:00 -0000 From: Michael Chastain To: kettenis@chello.nl, gdb-patches@sources.redhat.com Subject: [rfc/testsuite] asm-source.exp: convert debug_flags Cc: nickc@redhat.com Message-ID: <4109E3E1.nail9AU189C8X@mindspring.com> User-Agent: nail 10.8 6/28/04 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00484.txt.bz2 Okay, how about this? I added a comment that debug_flags is in the format that gcc expects, and that the test script adjusts to the format that the assembler expects. Also I strip out "-g2" and "-g3" because as soon as I ran my testbed I noticed that my testbed provides those. Tested on native i686-pc-linux-gnu with gcc 3.3.4 and binutils 2.15 with the following flags: make check RUNTESTFLAGS="asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gdwarf-2 asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gdwarf2 asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs+ asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs+\\\\\\ -g2 asm-source.exp" make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-g3\\\\\\ -gdwarf-2 asm-source.exp" Mark, does this patch work for you too? If it does, I'll commit it. Michael C 2004-07-29 Michael Chastain * gdb.base/asm-source.exp: Properly convert target board debug flags from gcc format to binutils format. Index: asm-source.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v retrieving revision 1.51 diff -c -3 -p -r1.51 asm-source.exp *** asm-source.exp 27 Jul 2004 09:28:42 -0000 1.51 --- asm-source.exp 30 Jul 2004 05:57:33 -0000 *************** switch -glob -- [istarget] { *** 77,87 **** } "m6811-*-*" { set asm-arch m68hc11 ! set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" } "m6812-*-*" { set asm-arch m68hc11 ! set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" } "mips*-*" { set asm-arch mips --- 77,87 ---- } "m6811-*-*" { set asm-arch m68hc11 ! set asm-flags "-mshort-double -m68hc11 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" } "m6812-*-*" { set asm-arch m68hc11 ! set asm-flags "-mshort-double -m68hc12 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" } "mips*-*" { set asm-arch mips *************** if { "${asm-flags}" == "" } { *** 173,187 **** set debug-flags "-gstabs" } ! # Allow the target board to override the debug flags if { [board_info $dest exists debug_flags] } then { set debug-flags "[board_info $dest debug_flags]" } ! # The GNU assembler does not support STABS+ ! if { ${debug-flags} == "-gstabs+" } then { ! set debug-flags "-gstabs" ! } if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." --- 173,202 ---- set debug-flags "-gstabs" } ! # Allow the target board to override the debug flags. if { [board_info $dest exists debug_flags] } then { set debug-flags "[board_info $dest debug_flags]" } ! # The debug flags are in the format that gcc expects: ! # "-gdwarf-2", "-gstabs+", or "-gstabs". To be compatible with the ! # other languages in the test suite, we accept this input format. ! # So the user can run the test suite with: ! # ! # runtest --target_board unix/gdb:debug_flags=-gdwarf-2 ! # make check RUNTESTFLAGS="--target_board unix/gdb:debug_flags=-gdwarf-2" ! # ! # However, the GNU assembler has different spellings than gcc. ! # So I adjust the debug flags here. ! ! # The GNU assembler spells "dwarf-2" as "dwarf2". ! regsub "--" "-gdwarf-2" "${debug-flags}" "-gdwarf2" debug-flags ! ! # The GNU assembler before 2.15 did not support "stabs+". ! regsub "--" "-gstabs\[+\]" "${debug-flags}" "-gstabs" debug-flags ! ! # The GNU assembler does not support level options like "-g2" or "-g3". ! regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."