From: Daniel Jacobowitz <drow@mvista.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/PATCH] breakpoint.c: fix until command
Date: Fri, 03 Jan 2003 15:17:00 -0000 [thread overview]
Message-ID: <20030103151649.GA31921@nevyn.them.org> (raw)
In-Reply-To: <200301030649.h036nSq08310@duracef.shout.net>
On Fri, Jan 03, 2003 at 12:49:28AM -0600, Michael Elizabeth Chastain wrote:
> Daniel J says:
>
> > With a modern compiler, "after $PC" is pretty much meaningless. Not
> > going to fly. It could be re-ordered; there can be out-of-line code in
> > separate sections.
>
> I'm thinking of a famous promise in the gcc manual:
>
> Without `-O', the compiler's goal is to reduce the cost of
> compilation and to make debugging produce the expected results.
> Statements are independent: if you stop the program with a
> breakpoint between statements, you can then assign a new value to
> any variable or change the program counter to any other statement
> in the function and get exactly the results you would expect from
> the source code.
>
> Statements which are independent can could be re-ordered, like moving
> error-handling blocks far away to a different section of the address
> space to improve cache locality. So we might need additional promises.
> I think it would be reasonable for us to ask for them if we decide
> we need them.
I don't. Promises don't mean anything; we have existing code.
> With optimized code, I agree, gdb is just going to degrade, the way
> it does now with stepping through for loops.
Which isn't OK. We need to do something about this; it requires some
substantial planning but with DWARF-2 we really should have all the
information we need to do better.
> > And what it means when LOCATION is not in function is not clear.
> > The problem is, do we know well enough when LOCATION is or is not in
> > FUNCTION to make any statements?
>
> If we can get more promises from gcc, then we can know this is true
> in un-optimized code.
>
> We can also know whether LOCATION is in the function if we operate
> on LOCATION while it is in source form before we translate to object
> code location. If we are in foo:67, and the user asks to 'until 70',
> then I bet we can figure out that '70' is in the current function no
> matter where its object code addresses are.
No, we can't. It's a pretty fundamental rule that we can never do
anything except display source lines. Consider code re-organization,
templates, macros, #line directives...
> > I'm still undecided about what to do if LOCATION is not in the
> > function. Maybe you're right and we should make this an error. What
> > if LOCATION is in the frame that called this one?
>
> I still say, make it an error. I like the idea that 'until' is all
> about the current frame.
>
> And it seems weird. The user should know it's not in the current
> frame when they type in in LOCATION. And they know that 'until' rolls
> right over function calls. So the user knows that LOCATION is in a
> calling frame. This collides head on with the idea that 'until' has
> a momentary breakpoint on the return location in the caller. Try it.
> It will always take the return-breakpoint. It will never reach LOCATION.
Oh, you're right of course.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-01-03 15:17 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-03 6:49 Michael Elizabeth Chastain
2003-01-03 15:17 ` Daniel Jacobowitz [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-01-11 1:04 Michael Elizabeth Chastain
2003-01-07 4:05 Michael Elizabeth Chastain
2003-01-07 3:53 Michael Elizabeth Chastain
2003-01-04 0:37 Michael Elizabeth Chastain
2003-01-05 17:02 ` Andrew Cagney
2003-01-07 1:30 ` Michael Snyder
2003-01-03 18:03 Michael Elizabeth Chastain
2003-01-03 17:40 Michael Elizabeth Chastain
2003-01-03 17:07 Michael Elizabeth Chastain
2003-01-03 17:51 ` Elena Zannoni
2003-01-03 16:48 Michael Elizabeth Chastain
2003-01-03 23:33 ` Michael Snyder
2003-01-03 16:38 Michael Elizabeth Chastain
2003-01-03 16:57 ` Daniel Jacobowitz
2003-01-03 4:15 Michael Elizabeth Chastain
2003-01-03 4:59 ` Daniel Jacobowitz
2003-01-03 21:52 ` Michael Snyder
2003-01-03 21:54 ` Daniel Jacobowitz
2003-01-03 22:39 ` Elena Zannoni
2003-01-03 23:09 ` Michael Snyder
2003-01-03 14:43 ` Elena Zannoni
2003-01-03 22:06 ` Michael Snyder
2003-01-03 22:43 ` Elena Zannoni
2003-01-03 23:13 ` Michael Snyder
2002-12-20 10:19 Elena Zannoni
2002-12-23 15:55 ` Michael Snyder
2002-12-23 16:13 ` Daniel Jacobowitz
2002-12-23 16:59 ` Michael Snyder
2002-12-23 19:23 ` Daniel Jacobowitz
2003-01-02 20:25 ` Michael Snyder
2003-01-02 20:34 ` Elena Zannoni
2003-01-02 20:40 ` Michael Snyder
2003-01-03 0:12 ` Elena Zannoni
2003-01-03 1:44 ` Michael Snyder
2003-01-03 1:50 ` Daniel Jacobowitz
2003-01-03 2:37 ` Michael Snyder
2003-01-03 14:29 ` Elena Zannoni
2003-01-03 23:51 ` Michael Snyder
2003-01-03 23:53 ` Elena Zannoni
2003-01-04 0:05 ` Michael Snyder
2003-01-04 1:54 ` Daniel Jacobowitz
2003-01-06 22:06 ` Elena Zannoni
2003-01-07 1:27 ` Michael Snyder
2003-01-07 1:45 ` Elena Zannoni
2003-01-07 2:09 ` Michael Snyder
2003-01-07 4:31 ` Daniel Jacobowitz
2003-01-08 22:08 ` Elena Zannoni
2003-01-09 1:52 ` Daniel Jacobowitz
2003-01-10 22:25 ` Elena Zannoni
2003-01-10 22:28 ` Daniel Jacobowitz
2003-01-10 23:20 ` Elena Zannoni
2003-01-03 14:15 ` Elena Zannoni
2003-01-03 23:31 ` Michael Snyder
2003-01-03 23:51 ` Elena Zannoni
2003-01-03 23:58 ` Michael Snyder
2003-01-03 14:13 ` Elena Zannoni
2003-01-03 23:28 ` Michael Snyder
2003-01-02 20:01 ` Elena Zannoni
2003-01-02 20:29 ` Michael Snyder
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=20030103151649.GA31921@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mec@shout.net \
/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