From: Elena Zannoni <ezannoni@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] use frame IDs to detect function calls while stepping
Date: Thu, 05 Feb 2004 18:54:00 -0000 [thread overview]
Message-ID: <16418.37058.65446.669052@localhost.redhat.com> (raw)
In-Reply-To: <20040205171324.GF18961@gnat.com>
Joel Brobecker writes:
> [aghaaaaa .... With the patch this time, with my thanks to Elena and Daniel]
>
> Hello,
>
> This is a followup on the discussion that took place in the following
> thread:
>
> [RFA] OSF/1 - "next" over prologueless function call
> http://sources.redhat.com/ml/gdb-patches/2003-12/msg00037.html
>
> During the discussion, it appeared that it was better to rely on
> frame IDs to detect cases when we stepped inside a function rather
> than further adjusting the test that checks whether we landed at
> the begining of a function or not.
>
> After a bit of testing on various platforms, I found that only relying
> on a test that checks the ID of frame #1 against the step_frame_id was
> not sufficient, unfortunately. The sparc-solaris testing revealed 2
> regressions.
>
> After careful analysis of the regressions and a bit of dicussion
> with Andrew, here is what we found:
>
> 1. We sometimes step levels of function calls down from the point
> where we started stepping. This is to get past the dynsym
> resolve code. So once we get more than one level deep, the
> frame ID test can no longer work.
>
> That was regression #1.
>
> 2. We have a testcase where we try to "next" our way out of a function
> for which we have no line number information. The expected output
> was to run until the end of the program. But instead we stopped
> before.
>
> It turned out that we were landing inside a shared library
> trampoline after having left the function we were in, so again
> the frame ID check didn't kick in. We didn't know what to do,
> simply stopped there.
>
> That was regression #2.
>
> Given the current implementation, and the analysis of the regressions,
> we determined that the logic should be something like this:
>
> . If we landed in undebuggable code (identified by lack of symbol
> name), and we're stepping over this kind of code, then:
>
> Run our way out of the function.
>
Could this kind of logic be handled inside handle_step_into_function
(which already checks for UNDEBUGGABLE)? I.e. is this case caught by
the complex condition in the old frame case which makes you call
handle_step_into_function? For the new frame case, this is regression
#1, did you have this bug/regression with the old frame code?
> . If we are in a shlib call trampoline, then:
>
> Likewise.
> (This test was already part of the previous check, BTW)
>
> . If we are in a function called from the function where we started
> stepping, as identified by frame ID unwind, then:
>
> Likewise.
>
> I tried it and no longer had any regression.
>
I think the explanations above should go in the function as comments.
> + else
> + {
> + if (IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name))
> + {
> + /* We landed in a shared library call trampoline, so it
> + is a subroutine call. */
> + handle_step_into_function (ecs);
> + return;
> + }
I am not sure I understand why the case above is not covered by the
test below. Is this to fix regression #1? I.e multiple frames?
> +
> + if (frame_id_eq (get_frame_id (get_prev_frame (get_current_frame ())),
> + step_frame_id))
> + {
> + /* It's a subroutine call. */
> + handle_step_into_function (ecs);
> + return;
> + }
> +
> }
>
> /* We've wandered out of the step range. */
next prev parent reply other threads:[~2004-02-05 18:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-05 4:41 Joel Brobecker
2004-02-05 17:13 ` Joel Brobecker
2004-02-05 18:54 ` Elena Zannoni [this message]
2004-02-07 4:01 ` Joel Brobecker
2004-02-27 15:23 ` Andrew Cagney
2004-03-19 0:09 ` Joel Brobecker
2004-03-01 19:48 ` Joel Brobecker
2004-03-19 0:09 ` Joel Brobecker
2004-03-01 23:52 ` Joel Brobecker
2004-03-02 6:16 ` Joel Brobecker
2004-03-03 21:12 ` Mark Kettenis
2004-03-19 0:09 ` Mark Kettenis
2004-03-19 0:09 ` Andrew Cagney
2004-03-02 15:48 ` Andrew Cagney
2004-03-19 0:09 ` Joel Brobecker
2004-03-02 22:07 ` Joel Brobecker
2004-03-06 0:15 ` Andrew Cagney
2004-03-19 0:09 ` Andrew Cagney
2004-03-19 0:09 ` Joel Brobecker
2004-02-05 19:01 ` Daniel Jacobowitz
2004-02-05 19:23 ` Elena Zannoni
2004-02-05 19:49 ` Daniel Jacobowitz
2004-02-09 19:21 ` Andrew Cagney
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=16418.37058.65446.669052@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=brobecker@gnat.com \
--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