From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2919 invoked by alias); 4 Feb 2003 08:09:38 -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 2911 invoked from network); 4 Feb 2003 08:09:36 -0000 Received: from unknown (HELO molenda.com) (192.220.74.81) by 172.16.49.205 with SMTP; 4 Feb 2003 08:09:36 -0000 Received: (qmail 23628 invoked by uid 19025); 4 Feb 2003 08:09:36 -0000 Date: Tue, 04 Feb 2003 08:09:00 -0000 From: Jason Molenda To: David Carlton , Andrew Cagney , gdb-patches@sources.redhat.com, jjohnstn@redhat.com Subject: Re: PATCH RFA: Fix MI stack frame output for synthetic frames Message-ID: <20030204000936.A19984@molenda.com> References: <20021108142248.A65720@molenda.com> <3DCC3CEE.5040902@redhat.com> <20021109004723.A20334@molenda.com> <3E3CB218.1020706@redhat.com> <20030203102748.A75701@molenda.com> <20030203183441.GA27429@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030203183441.GA27429@nevyn.them.org>; from drow@mvista.com on Mon, Feb 03, 2003 at 01:34:41PM -0500 X-SW-Source: 2003-02/txt/msg00108.txt.bz2 On Mon, Feb 03, 2003 at 01:34:41PM -0500, Daniel Jacobowitz wrote: > On Mon, Feb 03, 2003 at 10:27:48AM -0800, Jason Molenda wrote: > > On Mon, Feb 03, 2003 at 10:15:20AM -0800, David Carlton wrote: > > > > > > > > On i686-pc-linux-gnu/GCC3.1/DWARF2, I get the following: > > > > > > > > PASS: gdb.mi/mi-syn-frame.exp: 407-stack-list-frames > > > FAIL: gdb.mi/mi-syn-frame.exp: 408-exec-continue > The exec-continue failure seems to be a bad regular expression - it's > expecting "*stopped[\r\n]+", not any of the things which follow > *stopped. The problem is that a breakpoint on this function: void subroutine (int in) { while (in < 100) in++; } will be triggered each time in the loop. e.g. [jason@little-green-moose gdb.mi]$ ../../gdb -q ./mi-syn-frame (gdb) b main Breakpoint 1 at 0x8048408: file ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c, line 14. (gdb) run Starting program: /home/jason/sware/gdb/b/gdb/testsuite/gdb.mi/mi-syn-frame Breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c:14 14 puts ("Starting up"); (gdb) b subroutine Breakpoint 2 at 0x8048530: file ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c, line 49. (gdb) call subroutine(5) Breakpoint 2, subroutine (in=5) at ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c:49 49 while (in < 100) The program being debugged stopped while in a function called from GDB. When the function (subroutine) is done executing, GDB will silently stop (instead of continuing to evaluate the expression containing the function call). (gdb) cont Continuing. Breakpoint 2, subroutine (in=6) at ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c:49 49 while (in < 100) (gdb) cont Continuing. [etc] It's failing for both stabs and for DWARF with gcc 3.2 (the one included in RH 8). In both cases, gdb is putting the breakpoint on the cmpl at subroutine+4 so it's hit each time we iterate the loop: (gdb) x/10i subroutine 0x804852c : push %ebp 0x804852d : mov %esp,%ebp 0x804852f : nop 0x8048530 : cmpl $0x63,0x8(%ebp) 0x8048534 : jle 0x8048538 0x8048536 : jmp 0x8048540 0x8048538 : incl 0x8(%ebp) 0x804853b : jmp 0x8048530 0x804853d : lea 0x0(%esi),%esi 0x8048540 : pop %ebp But when I compile the same test program with gcc 2.96, gdb is putting the breakpoint on subroutine+3 - the nop - and things work as expected. My promise to fix this this evening assumed it was a dumb little testsuite regexp problem - this is novel enough (read: Not My Fault :) that I'm instead going to bed as it's about bedtime... I'll look back into this tomorrow night when I get home if no one else recognizes why this problem might be coming up. Jason