From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15302 invoked by alias); 27 Apr 2004 18:07:37 -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 15253 invoked from network); 27 Apr 2004 18:07:36 -0000 Received: from unknown (HELO dublin.act-europe.fr) (212.157.227.154) by sources.redhat.com with SMTP; 27 Apr 2004 18:07:36 -0000 Received: from localhost (province.act-europe.fr [10.10.0.214]) by filtered-dublin.act-europe.fr (Postfix) with ESMTP id 47ADC22A38A for ; Tue, 27 Apr 2004 20:07:35 +0200 (MET DST) Received: from dublin.act-europe.fr ([10.10.0.154]) by localhost (province.act-europe.fr [10.10.0.214]) (amavisd-new, port 10024) with ESMTP id 71285-03 for ; Tue, 27 Apr 2004 20:07:35 +0200 (CEST) Received: from berne.act-europe.fr (berne.act-europe.fr [10.10.0.165]) by dublin.act-europe.fr (Postfix) with ESMTP id 16DAA229E04 for ; Tue, 27 Apr 2004 20:07:35 +0200 (MET DST) Received: by berne.act-europe.fr (Postfix, from userid 560) id 96B26592B; Tue, 27 Apr 2004 14:07:34 -0400 (EDT) Date: Tue, 27 Apr 2004 18:07:00 -0000 From: Jerome Guitton To: gdb-patches@sources.redhat.com Subject: [RFA] New test for i386 prologue scan Message-ID: <20040427180734.GA7639@act-europe.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at act-europe.fr X-SW-Source: 2004-04/txt/msg00621.txt.bz2 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 155 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? -- Jerome --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.6" Content-length: 2206 2004-04-27 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: 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 --- gdb.arch/i386-prologue.c 17 Aug 2003 23:18:31 -0000 1.2 +++ gdb.arch/i386-prologue.c 27 Apr 2004 17:57:23 -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" + " push %ebp\n" + " mov %esp,%ebp\n" + " jmp .gdbjump\n" + " nop\n" + ".gdbjump:\n" + " movl %ebp,%esp\n" + " popl %ebp\n" " ret\n"); Index: 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 --- gdb.arch/i386-prologue.exp 7 Sep 2003 16:38:00 -0000 1.3 +++ gdb.arch/i386-prologue.exp 27 Apr 2004 17:57:23 -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" + } +} --TB36FDmn/VVEgNH/--