From: Michael Chastain <mec.gnu@mindspring.com>
To: nickc@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA/RFC: Change Sparc64 gdb.asm tests to use -gdwarf2 instead of -gstabs
Date: Mon, 26 Jul 2004 14:07:00 -0000 [thread overview]
Message-ID: <41051014.nailLY111456S@mindspring.com> (raw)
In-Reply-To: <m3oem29ap2.fsf@redhat.com>
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 <nickc@redhat.com>
* gdb.asm/asm-source.exp: Use -gdwarf2 in preference to
-gstabs for Sparc64.
next prev parent reply other threads:[~2004-07-26 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-26 12:59 Nick Clifton
[not found] ` <41051014 dot nailLY111456S at mindspring dot com>
2004-07-26 14:07 ` Michael Chastain [this message]
2004-07-26 17:31 ` Nick Clifton
2004-07-26 23:55 ` Michael Chastain
2004-07-29 23:03 ` Mark Kettenis
2004-07-29 23:38 ` Michael Chastain
2004-07-30 0:07 ` Mark Kettenis
2004-07-30 11:55 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41051014.nailLY111456S@mindspring.com \
--to=mec.gnu@mindspring.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nickc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox