From: Andrew Cagney <ac131313@cygnus.com>
To: Jim Blandy <jimb@redhat.com>, Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] block_innermost_frame tweak
Date: Thu, 20 Jun 2002 17:04:00 -0000 [thread overview]
Message-ID: <3D126D8A.9020908@cygnus.com> (raw)
In-Reply-To: <nphejxver5.fsf@zwingli.cygnus.com>
> This is similar to the code in get_frame_block that decrements the
> PC before looking up its block.
>
> It seems to me that we generally want to use the return address - 1
> (well, ideally, the address of the `call' instruction, but we don't
> have that) to decide which block any frame but the youngest is "in".
>
> Would it make sense to create a new function --- `frame_calling_pc',
> perhaps --- which encapsulates the logic in get_frame_block, and then
> use that instead of `frame->pc' in get_frame_block and
> block_innermost_frame?
Is there a better name? As you note, it isn't a valid PC (it may not
even point into an instruction!). Further, it is isn't the address of
the instruction ``calling'' the ``frame''. Last time this came up
address_in_block() was used - frame_address_in_block()?
> + /* To evaluate if a given PC address is within a block range,
> + we normally check if PC is inside [block start .. block end[.
> + However, If FRAME is not the innermost frame, then frame->pc
> + normally points to the instruction *following* the call, which
> + means that the comparison with the block boundaries need to be
> + offset by one instruction. This is done by checking if PC is
> + inside ]block start .. block end] instead. */
> + innermost = !frame->next
> + || frame->next->signal_handler_caller
> + || frame_in_dummy (frame->next);
> + if ((innermost && frame->pc >= start && frame->pc < end)
> + || (!innermost && frame->pc > start && frame->pc <= end))
> return frame;
Just BTW frame_in_dummy() isn't an indication of an innermost frame.
There can easily be other frames (and even dummy frames) more inner most
than that dummy frame.
Andrew
next prev parent reply other threads:[~2002-06-21 0:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-20 13:14 Joel Brobecker
2002-06-20 14:09 ` Jim Blandy
2002-06-20 15:21 ` Joel Brobecker
2002-06-20 17:04 ` Andrew Cagney [this message]
2002-06-21 10:31 ` Joel Brobecker
2002-06-21 12:14 ` Jim Blandy
2002-06-21 13:24 ` Andrew Cagney
2002-06-21 15:33 ` Jim Blandy
2002-06-21 15:55 ` Andrew Cagney
2002-06-21 16:22 ` Jim Blandy
2002-07-02 10:41 ` Joel Brobecker
2002-07-02 11:05 ` Jim Blandy
2002-07-02 12:12 ` Joel Brobecker
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=3D126D8A.9020908@cygnus.com \
--to=ac131313@cygnus.com \
--cc=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@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