From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13049 invoked by alias); 26 Jul 2004 14:07:12 -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 13034 invoked from network); 26 Jul 2004 14:07:10 -0000 Received: from unknown (HELO smtp6.mindspring.com) (207.69.200.110) by sourceware.org with SMTP; 26 Jul 2004 14:07:10 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by smtp6.mindspring.com with esmtp (Exim 3.33 #1) id 1Bp68D-0005pN-00; Mon, 26 Jul 2004 10:07:09 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id BE85F4B102; Mon, 26 Jul 2004 10:07:17 -0400 (EDT) Date: Mon, 26 Jul 2004 14:07:00 -0000 From: Michael Chastain To: nickc@redhat.com Subject: Re: RFA/RFC: Change Sparc64 gdb.asm tests to use -gdwarf2 instead of -gstabs Cc: gdb-patches@sources.redhat.com Message-ID: <41051014.nailLY111456S@mindspring.com> References: In-Reply-To: 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/msg00358.txt.bz2 Not approved. You stepped into one of the test suite cow pies ... sorry about that. Instead of hard-wiring the debug format, the test should use the value of debug_flags. Copy this bit of code from lib/ada.exp (which was copied from default_target_compile): set dest [target_info name] if [board_info $dest exists debug_flags] { append add_flags " [board_info $dest debug_flags]"; } else { append add_flags " -g" } For asm-source.exp it would be more like: switch --glob -- [istarget] { "alpha*-*-*" { set asm-arch alpha set asm-flags "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}" set debug-flags "-gdwarf-2" } ... } # Override the flags for this target board. set dest [target_info name] if { [board_info $dest exists debug_flags] } then { set debug_flags "board_info $dest debug_flags" } if { $debug_flags == "stabs+" } then { # GNU assembler does not support stabs+ set debug_flags "stabs" } ... set asm-flags "$debug_flags $asm-flags" Or something like that. The point is to honor debug_flags. This is the same mechanism that C, C++, and Ada use to select which debug format to test. I run my test bed with both dwarf-2 and stabs+, just by supplying the right flags to runtest (see below). It would be nice if the assembler supported "-g" with a good default value. But it doesn't. So we have to keep all the existing per-architecture code to choose between -gdwarf-2 and -gstabs, with the override at the end. Also ... how did this ever work on sparc64 with stabs? I thought that stabs and stabs+ have never worked on 64-bit machines! Am I missing a clue? nick> So this patch works around a known failure in GAS, which means that nick> possibly the problem might be forgotten. It's okay to pick whatever makes the most sense for the default. gcc picks dwarf-2 so dwarf-2 is fine. It's the tester's job to test with all the supported debug formats. That person would file a bug report against gas -gstabs, and then the gas maintainers would fix it, laugh at it, or whatever. If there is a bug report filed for the bug, then the test can return XFAIL or KFAIL with the PR number (XFAIL for a PR against the assembler, KFAIL for a PR against gdb). Lastly, you have to test the patch, and say how you tested it (obviously by running asm-source.exp on a sparc64). Please test with all three of: runtest runtest --target_board unix/gdb:debug_flags=dwarf-2 runtest --target_board unix/gdb:debug_flags=stabs+ Whew. If you want me to do the boring mechanical $debug_flags part first, and then you just flip the switch on the default and run the sparc64 tests, I'm up for that. Or you can do the boring mechanical part if you want. Michael C === 2004-07-26 Nick Clifton * gdb.asm/asm-source.exp: Use -gdwarf2 in preference to -gstabs for Sparc64.