Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] if (INNER_THAN (read_sp(), step_sp - 16))
Date: Mon, 25 Jun 2001 18:04:00 -0000	[thread overview]
Message-ID: <3B37DEEA.8BB876E6@cygnus.com> (raw)
In-Reply-To: <200106230933.LAA24205@reisser.regent.e-technik.tu-muenchen.de>

"Peter.Schauer" wrote:
> 
> Hellooooooo.
> 
> This ugly hack is coming back to haunt me every other year, and if I'd
> know about a cleaner way to solve this, I'd already have done it long ago.
> 
> You already asked me about this `gem' in August 1999 and I tried to explain
> the issue back then (see appended message below).

> As of CVS GDB from May 27 2001 this hack is still needed for
> Solaris x86 and Linux x86 (at least for a debian 2.2r2 release, for which
> I have just run the signals.exp test with and without the hack).

Ah -- I see.  Yep, I get that failure too.  Good, now at least I know
how to manifest the problem that the code is trying to fix.  

> Kevin Buettner also tried to come up with a better solution to no avail
> (see second message below).
> 
> I think we have two options here:
> 
> - Back out the change unconditionally as Andrew suggested and live with
>   the signals.exp regressions this will cause.
> 
> - Try to refine the test, so that the `serious bugs in debugging native
>   Linux x86' are not triggered.
>   Which problems are you encountering due to the hack ?

Basically, there are any number of ways in which the current SP
may be off by 16 or more from the SP at the beginning of the step.
The most likely problem is that we hit a breakpoint in the middle
of a line (eg. a step_resume breakpoint), but this test tells us
that we are not at a breakpoint.  If that happens, we may report
a random SIGTRAP, or worse, we may attempt to resume the target
without first decrementhing the PC.

To demonstrate this problem, build the "gdb.base/break.exp" test case
and load it into GDB.  Set a breakpoint at line 79, the call to
printf(factorial(atoi("6))).  Now set a breakpoint on the last 
instruction of this line, and attempt a "next".  On my red hat 7.0
linux system, this causes the inferior to SEGV, because it resumes
after the breakpoint without decrementing the PC (because it failed
to recognize that it was at a breakpoint).

We will have to decide whether this is a worse problem than
the problem you were trying to fix.

Michael


  reply	other threads:[~2001-06-25 18:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3B2A97C7.52A839FD@cygnus.com>
     [not found] ` <3B2A9EC8.7020106@cygnus.com>
2001-06-15 18:13   ` Michael Snyder
2001-06-16  9:42     ` Andrew Cagney
2001-06-23  2:33 ` Peter.Schauer
2001-06-25 18:04   ` Michael Snyder [this message]
2001-06-25 18:14     ` Michael Snyder
2001-06-27 15:10   ` Michael Snyder
2001-06-29  3:08     ` Peter.Schauer
2001-06-29 14:16       ` Michael Snyder
2001-07-01  5:10         ` Peter.Schauer

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=3B37DEEA.8BB876E6@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE \
    --cc=gdb-patches@sources.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