From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18940 invoked by alias); 29 Apr 2004 18:05:47 -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 18929 invoked from network); 29 Apr 2004 18:05:45 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sources.redhat.com with SMTP; 29 Apr 2004 18:05:45 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i3TI5ZLD000255; Thu, 29 Apr 2004 20:05:35 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i3TI5Y1V000371; Thu, 29 Apr 2004 20:05:34 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i3TI5YBZ000368; Thu, 29 Apr 2004 20:05:34 +0200 (CEST) Date: Thu, 29 Apr 2004 18:05:00 -0000 Message-Id: <200404291805.i3TI5YBZ000368@elgar.kettenis.dyndns.org> From: Mark Kettenis To: guitton@act-europe.fr CC: gdb-patches@sources.redhat.com In-reply-to: <20040427180734.GA7639@act-europe.fr> (message from Jerome Guitton on Tue, 27 Apr 2004 20:07:34 +0200) Subject: Re: [RFA] New test for i386 prologue scan References: <20040427180734.GA7639@act-europe.fr> X-SW-Source: 2004-04/txt/msg00687.txt.bz2 Date: Tue, 27 Apr 2004 20:07:34 +0200 From: Jerome Guitton Thanks, I checked it in after tweaking the indentation a bit. Related to this patch (not approved yet): http://sources.redhat.com/ml/gdb-patches/2004-04/msg00432.html Tested on i686-linux. OK to apply? Index: testsuite/ChangeLog from Jerome Guitton * i386-prologue.exp: Add testcase for jump instruction as first instruction of the real code. * i386-prologue.c (jump_at_beginning): New function. Index: testsuite/gdb.arch/i386-prologue.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.c,v retrieving revision 1.2 diff -u -p -r1.2 i386-prologue.c --- testsuite/gdb.arch/i386-prologue.c 17 Aug 2003 23:18:31 -0000 1.2 +++ testsuite/gdb.arch/i386-prologue.c 29 Apr 2004 18:02:58 -0000 @@ -1,11 +1,13 @@ void gdb1253 (void); void gdb1338 (void); +void jump_at_beginning (void); int main (void) { gdb1253 (); gdb1338 (); + jump_at_beginning (); return 0; } @@ -34,4 +36,20 @@ asm(".text\n" " popl %ebx\n" " popl %esi\n" " popl %edi\n" + " ret\n"); + +/* The purpose of this function is to verify that, during prologue + skip, GDB does not follow a jump at the beginnning of the "real" + code. */ + +asm(".text\n" + " .align 8\n" + "jump_at_beginning:\n" + " pushl %ebp\n" + " movl %esp,%ebp\n" + " jmp .gdbjump\n" + " nop\n" + ".gdbjump:\n" + " movl %ebp,%esp\n" + " popl %ebp\n" " ret\n"); Index: testsuite/gdb.arch/i386-prologue.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-prologue.exp,v retrieving revision 1.3 diff -u -p -r1.3 i386-prologue.exp --- testsuite/gdb.arch/i386-prologue.exp 7 Sep 2003 16:38:00 -0000 1.3 +++ testsuite/gdb.arch/i386-prologue.exp 29 Apr 2004 18:02:58 -0000 @@ -76,3 +76,16 @@ gdb_test "backtrace 10" \ gdb_test "info frame" \ ".*Saved registers:.*ebx at.*esi at.*edi at.*eip at.*" \ "saved registers in gdb1338" + +# Testcase jump_at_beginning. +gdb_test_multiple "break jump_at_beginning" \ + "set breakpoint in jump_at_beginning" { + -re "Breakpoint \[0-9\]* at ($hex).*$gdb_prompt $" { + gdb_test "x/i $expect_out(1,string)" \ + ".*:.*jmp.*" \ + "check jump_at_beginning prologue end" + } + default { + fail "set breakpoint in jump_at_beginning" + } +}