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: Wed, 05 Feb 2003 08:28:00 -0000	[thread overview]
Message-ID: <20030205002416.A75501@molenda.com> (raw)
In-Reply-To: <20030204000936.A19984@molenda.com>; from jason-swarelist@molenda.com on Tue, Feb 04, 2003 at 12:09:36AM -0800

On Tue, Feb 04, 2003 at 12:09:36AM -0800, Jason Molenda wrote:
> 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.  


It's not really a compiler bug and not really a debugger bug.  
For this function -

> void
> subroutine (int in)
> {
>   while (in < 100)
>     in++;
> }

gcc 3.2 is outputting debug info like this -

        .stabs  "subroutine:F(9,7)",36,0,0,subroutine
        .stabs  "in:p(0,1)",160,0,0,8
.globl subroutine
        .type   subroutine,@function
subroutine:
        .stabn 68,0,48,.LM18-subroutine
.LM18:
        pushl   %ebp
        movl    %esp, %ebp
        nop
        .stabn 68,0,49,.LM19-subroutine    ; line #49 is the while (...)
.LM19:
.L6:
        cmpl    $99, 8(%ebp)
        jle     .L8
        jmp     .L5
.L8:

The compiler is correct to put the line stab there (it does the
equivalent for DWARF2), and gdb is correct in putting the breakpoint
on the cmpl insn, but the unfortunate end result of these two is that
a user putting a breakpoint on the subroutine will have a breakpoint
that's tripped each iteration of the loop.

Given all that, I'll check in a change to mi-syn-frames.c so this
function reads

void
subroutine (int in)
{
  int count = in;
  while (count < 100)
    count++;
}

The assignment gives us two assembly instructions after the end of the
prologue for a breakpoint that won't be hit at each iteration.  It's
stupid, I know.

I'll make that change and run it through the testsuites tomorrow
night.  If I get approval for the change before then (hint hint :)
I'll check it in, else I'll post a patch.

J


  reply	other threads:[~2003-02-05  8:28 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
2003-02-05  8:28               ` Jason Molenda [this message]
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=20030205002416.A75501@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