public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-misc: Improve the testcase gdb.base/lineno-makeup-func.c to PASS also on s390. Date: Mon, 26 Jan 2009 09:19:00 -0000 [thread overview] Message-ID: <20090126091934.16339.qmail@sourceware.org> (raw) The branch, archer-jankratochvil-misc has been updated via a94bd75a6a33d2a5f284a848cfb04c115365a3cc (commit) from a6ed408bab2c039e7056f9f961d60baaafed4895 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit a94bd75a6a33d2a5f284a848cfb04c115365a3cc Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Jan 26 10:18:12 2009 +0100 Improve the testcase gdb.base/lineno-makeup-func.c to PASS also on s390. ----------------------------------------------------------------------- Summary of changes: .../{lineno-makeup.c => lineno-makeup-func.c} | 15 +-------- gdb/testsuite/gdb.base/lineno-makeup.c | 7 +++- gdb/testsuite/gdb.base/lineno-makeup.exp | 30 ++++++++++++++++--- 3 files changed, 32 insertions(+), 20 deletions(-) copy gdb/testsuite/gdb.base/{lineno-makeup.c => lineno-makeup-func.c} (66%) First 500 lines of diff: diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup-func.c similarity index 66% copy from gdb/testsuite/gdb.base/lineno-makeup.c copy to gdb/testsuite/gdb.base/lineno-makeup-func.c index 1e7a501..1a0220e 100644 --- a/gdb/testsuite/gdb.base/lineno-makeup.c +++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c @@ -15,18 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number - information (.debug_line) so we cannot use an external object file. - - It must not be just a label as it would alias on the next function even for - correct GDB. Therefore a stub byte must be placed there. */ - -extern void func (void); -asm ("func: .quad 0"); - -int -main (void) +void +func (void) { - func (); - return 0; } diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup.c index 1e7a501..bb20e98 100644 --- a/gdb/testsuite/gdb.base/lineno-makeup.c +++ b/gdb/testsuite/gdb.base/lineno-makeup.c @@ -19,10 +19,13 @@ information (.debug_line) so we cannot use an external object file. It must not be just a label as it would alias on the next function even for - correct GDB. Therefore a stub byte must be placed there. */ + correct GDB. Therefore some stub data must be placed there. + + We need to provide a real stub function body as at least s390 + (s390_analyze_prologue) would skip the whole body till reaching `main'. */ extern void func (void); -asm ("func: .quad 0"); +asm ("func: .incbin \"gdb.base/lineno-makeup-func.bin\""); int main (void) diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp index c85c680..0c75b84 100644 --- a/gdb/testsuite/gdb.base/lineno-makeup.exp +++ b/gdb/testsuite/gdb.base/lineno-makeup.exp @@ -14,11 +14,26 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. set testfile "lineno-makeup" +set srcfuncfile ${testfile}-func.c set srcfile ${testfile}.c +set objfuncfile ${objdir}/${subdir}/${testfile}-func.o +set binfuncfile ${objdir}/${subdir}/${testfile}-func.bin set binfile ${objdir}/${subdir}/${testfile} -if { [prepare_for_testing ${testfile}.exp "${testfile}" "${testfile}.c" {debug}] } { - return -1 +if { [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" "${objfuncfile}" object {}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +set objcopy [catch "exec objcopy -O binary --only-section .text ${objfuncfile} ${binfuncfile}" output] +verbose -log "objcopy=$objcopy: $output" +if { $objcopy != 0 } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} +set binfuncfilesize [file size $binfuncfile] +verbose -log "file size $binfuncfile = $binfuncfilesize" + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } gdb_exit @@ -50,9 +65,14 @@ gdb_test_multiple $test $test { } verbose -log "p_addr=<$p_addr>" -set test "break and print addresses match" +set test "break address belongs to func" if {$b_addr == $p_addr} { - pass $test + pass "$test (exact match)" } else { - fail $test + set skip [expr $b_addr - $p_addr] + if {$skip > 0 && $skip < $binfuncfilesize} { + pass "$test (prologue skip by $skip bytes)" + } else { + fail $test + } } hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2009-01-26 9:19 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090126091934.16339.qmail@sourceware.org \ --to=jkratoch@sourceware.org \ --cc=archer-commits@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).