Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: Andrew Cagney <ac131313@ges.redhat.com>,
	Jim Ingham <jingham@apple.com>,
	gdb-patches@sources.redhat.com
Subject: Re: [RFC] breakpoints and function prologues...
Date: Fri, 16 Aug 2002 10:02:00 -0000	[thread overview]
Message-ID: <vt2ofc2rbkj.fsf@zenia.red-bean.com> (raw)
In-Reply-To: <20020816021108.GG906@gnat.com>

Joel Brobecker <brobecker@gnat.com> writes:
> > Don't forget that ``break func'' is is going to change.  It's going to 
> > go back to the start of the function!
> 
> Why this change? This is going to have a negative effect on the 
> Alpha Tru64 platform, since the first 2 instructions of the prologue
> are often optimized out by the linker. If we move "break func" back to
> the start of the function, the breakpoint will never be hit even if the
> function is entered.

If I understand the optimization you're referring to, GDB's prologue
policy accomodates that behavior almost by accident.  It's basically
an entirely separate reason to skip prologues, and I'm not sure it's
germane to the broader debate here.

Let me make sure I understand what the Tru64 linker is doing.  It
recognizes that the first two instructions at some function's entry
point are unnecessary, and then it ... here is where I get vague.
Does it:
a) delete those two instructions from the code stream altogether,
   shifting all subsequent instructions down in memory,
b) leave the instructions there, but adjust the value of the linker
   symbol to point two instructions beyond where it used to, or
c) leave the instructions and the linker symbol value unchanged, but
   tweak certain jumps to that symbol to actually jump two
   instructions beyond the symbol's value?

I assume it's not a), since you wouldn't have a problem in that case.

I kind of think that b) and c) are not entirely GDB's problem: after
performing that optimization, then the entry point in the debug
information is incorrect.  Requiring GDB to skip prologues just to
accomodate this optimization is not the right design.

Prologue skipping is meant to allow GDB to stop the inferior after the
frame pointer has been updated, the return address has been saved, and
register arguments have been spilled to their stack slots.  It exists
to support a simplistic assumption elsewhere in GDB: that saved frame
pointers, return addresses, and variables live in a single place
throughout the function's lifetime.  Removing that assumption (e.g.,
by supporting CFI and location lists) makes prologue analysis
unnecessary.

But what you're describing here is a rather different situation: the
function has multiple entry points, depending on whether (I'm
guessing) it's reached via an intra- or inter-load module call.

It seems to me there should be a separate gdbarch method to handle
that, because its semantics are different.


  reply	other threads:[~2002-08-16 17:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1029446396.15888.ezmlm@sources.redhat.com>
2002-08-15 15:26 ` Jim Ingham
2002-08-15 18:05   ` Andrew Cagney
2002-08-15 19:11     ` Joel Brobecker
2002-08-16 10:02       ` Jim Blandy [this message]
2002-08-16 10:17         ` Joel Brobecker
2002-08-15 19:18     ` Daniel Jacobowitz
2002-08-16  9:34     ` Jim Blandy
2002-08-16 11:34     ` Jim Ingham
2002-08-22 15:38     ` Michael Snyder
2002-08-22 15:56       ` Andrew Cagney
2002-08-22 16:34         ` Michael Snyder
     [not found] <1030059293.13128.ezmlm@sources.redhat.com>
2002-08-23 10:50 ` Jim Ingham
2002-08-23 11:34   ` Andrew Cagney
2002-08-24 18:31     ` Jim Ingham
2002-08-25  7:45       ` Andrew Cagney
2002-08-25  8:21         ` Daniel Jacobowitz
2002-08-25 15:24         ` Jim Ingham
2002-08-23 11:45   ` Michael Snyder
2002-08-23 11:48     ` Daniel Jacobowitz
     [not found] <1028439120.16228.ezmlm@sources.redhat.com>
2002-08-06 13:37 ` Jim Ingham
2002-08-14 22:57   ` Andrew Cagney
2002-08-15  6:53     ` Daniel Jacobowitz
2002-08-22 15:33       ` Michael Snyder
2002-08-22 16:19         ` Joel Brobecker
2002-08-23 11:27         ` Daniel Jacobowitz
     [not found] <1027384602.26926.ezmlm@sources.redhat.com>
2002-07-22 18:54 ` Jim Ingham
2002-07-22 22:49   ` Joel Brobecker
2002-07-22 17:36 Joel Brobecker
2002-07-23 16:53 ` Jim Blandy
2002-07-26  6:12   ` Joel Brobecker
2002-07-29 13:34     ` Daniel Jacobowitz
2002-07-29 23:57     ` Jim Blandy
2002-07-30 20:18       ` Joel Brobecker
2002-07-31 13:55         ` Jim Blandy
2002-08-01 15:44           ` Michael Snyder
2002-08-02 23:48             ` Jim Blandy

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=vt2ofc2rbkj.fsf@zenia.red-bean.com \
    --to=jimb@redhat.com \
    --cc=ac131313@ges.redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jingham@apple.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