Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jason-swarelist@molenda.com>
To: David Carlton <carlton@math.stanford.edu>,
	Andrew Cagney <ac131313@redhat.com>,
	gdb-patches@sources.redhat.com, jjohnstn@redhat.com
Subject: Re: PATCH RFA: Fix MI stack frame output for synthetic frames
Date: Tue, 04 Feb 2003 08:09:00 -0000	[thread overview]
Message-ID: <20030204000936.A19984@molenda.com> (raw)
In-Reply-To: <20030203183441.GA27429@nevyn.them.org>; from drow@mvista.com on Mon, Feb 03, 2003 at 01:34:41PM -0500

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 <subroutine>: push   %ebp
0x804852d <subroutine+1>:       mov    %esp,%ebp
0x804852f <subroutine+3>:       nop
0x8048530 <subroutine+4>:       cmpl   $0x63,0x8(%ebp)
0x8048534 <subroutine+8>:       jle    0x8048538 <subroutine+12>
0x8048536 <subroutine+10>:      jmp    0x8048540 <subroutine+20>
0x8048538 <subroutine+12>:      incl   0x8(%ebp)
0x804853b <subroutine+15>:      jmp    0x8048530 <subroutine+4>
0x804853d <subroutine+17>:      lea    0x0(%esi),%esi
0x8048540 <subroutine+20>:      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


  reply	other threads:[~2003-02-04  8:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 14:22 PATCH: " Jason Molenda
2002-11-08 14:38 ` Andrew Cagney
2002-11-08 14:46   ` Jason Molenda
2002-11-08 15:56     ` Andrew Cagney
2002-11-09  0:47   ` PATCH RFA: " Jason Molenda
2002-11-09  2:13     ` Jason Molenda
2002-11-15 11:16     ` Ping on two MI patches Jason Molenda
2003-02-02  5:52     ` PATCH RFA: Fix MI stack frame output for synthetic frames Andrew Cagney
2003-02-02 17:38       ` Mark Kettenis
2003-02-02 18:23         ` Andrew Cagney
2003-02-02 20:51           ` Mark Kettenis
2003-02-03 18:15       ` David Carlton
2003-02-03 18:27         ` Jason Molenda
2003-02-03 18:34           ` Daniel Jacobowitz
2003-02-04  8:09             ` Jason Molenda [this message]
2003-02-05  8:28               ` Jason Molenda
2003-02-05 13:59                 ` Daniel Jacobowitz
2003-02-05 14:54                   ` Elena Zannoni
2003-02-06  6:28                     ` Fix committed for mi-syn-frames fails (was: Re: PATCH RFA: Fix MI stack frame output for synthetic frames) Jason Molenda
2003-02-06  6:31                       ` Jason Molenda
2003-02-06 17:01                       ` David Carlton
2003-02-06 18:21                       ` Andrew Cagney
2003-02-06 18:27                         ` Jason Molenda

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=20030204000936.A19984@molenda.com \
    --to=jason-swarelist@molenda.com \
    --cc=ac131313@redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@redhat.com \
    /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: link
Be 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