From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16379 invoked by alias); 26 Jan 2009 09:19:35 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 16355 invoked by uid 9674); 26 Jan 2009 09:19:34 -0000 Date: Mon, 26 Jan 2009 09:19:00 -0000 Message-ID: <20090126091934.16339.qmail@sourceware.org> 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. X-Git-Refname: refs/heads/archer-jankratochvil-misc X-Git-Reftype: branch X-Git-Oldrev: a6ed408bab2c039e7056f9f961d60baaafed4895 X-Git-Newrev: a94bd75a6a33d2a5f284a848cfb04c115365a3cc X-SW-Source: 2009-q1/txt/msg00063.txt.bz2 List-Id: 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 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 . */ -/* 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 . 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.