From: Daniel Jacobowitz <drow@mvista.com>
To: Jafa <jafa@silicondust.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] missing case in epilogue stub detection
Date: Sun, 07 Sep 2003 15:16:00 -0000 [thread overview]
Message-ID: <20030907151614.GA480@nevyn.them.org> (raw)
In-Reply-To: <010f01c36c26$09ae49c0$0502a8c0@scenix.com>
On Tue, Aug 26, 2003 at 04:01:52PM -0700, Jafa wrote:
> Hi Daniel,
>
> My appologies...
> (description below)
>
> diff -u -6 -r1.10 infrun.c
> --- infrun.c 20 Aug 2003 17:15:33 -0000 1.10
> +++ infrun.c 26 Aug 2003 23:00:59 -0000
> @@ -2443,15 +2443,15 @@
>
> ecs->remove_breakpoints_on_following_step = 1;
> keep_going (ecs);
> return;
> }
>
> - if (stop_pc == ecs->stop_func_start /* Quick test */
> - || (in_prologue (stop_pc, ecs->stop_func_start) &&
> - !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
> + if (((stop_pc == ecs->stop_func_start /* Quick test. */
> + || in_prologue (stop_pc, ecs->stop_func_start))
> + && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
> || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
> || ecs->stop_func_name == 0)
> {
> /* It's a subroutine call. */
>
> if ((step_over_calls == STEP_OVER_NONE)
>
>
> The first thing the original code does is "if (stop_pc ==
> ecs->stop_func_start /* Quick test */" which means if the stop_pc is equal
> to the first instrucion of a function or stub then it bypasses all of the
> other checks and blindly assumes it is a function. The "in_prologue" and
> "IN_SOLIB_RETURN_TRAMPOLINE" functions never get called because it has
> already decided that it is a function.
>
> I believe the original code is valid in assuming that if the pc is at the
> start of the func/stub then it can skip the prologue test, however it still
> needs to check to see if it is in an epilogue stub.
>
> This is critical because an epilogue stub (by definition) does not return to
> the caller, thus cannot be treated as a subroutine.
>
> BTW - Thanks for the feedback, you are probably right, the comment is still
> reasonably relavant and my editor doesn't pick up lines being too long.
>
> If there is a better way to solve this problem then I would appreciate your
> advice.
Hi Nick,
OK, thank you for the explanation. Presumably, for whatever target
this code was originally added, the return stubs didn't show up as
functions in the symbol table and so the first check never triggered.
Your explanation makes sense, so I've committed this patch.
[I don't believe this patch requires copyright assignment, but do
you/Ubicom have one in place? I don't remember.]
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-09-07 Daniel Jacobowitz <drow@mvista.com>
From Nick Kelsey <nickk@ubicom.com>:
* infrun.c (handle_inferior_event): Check IN_SOLIB_RETURN_TRAMPOLINE
when the stop PC is at the beginning of a function also.
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.110
diff -u -p -r1.110 infrun.c
--- infrun.c 19 Jun 2003 15:04:57 -0000 1.110
+++ infrun.c 7 Sep 2003 04:34:55 -0000
@@ -2446,9 +2446,9 @@ process_event_stop_test:
return;
}
- if (stop_pc == ecs->stop_func_start /* Quick test */
- || (in_prologue (stop_pc, ecs->stop_func_start) &&
- !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+ if (((stop_pc == ecs->stop_func_start /* Quick test */
+ || in_prologue (stop_pc, ecs->stop_func_start))
+ && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
|| IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
|| ecs->stop_func_name == 0)
{
next prev parent reply other threads:[~2003-09-07 15:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-31 22:01 RFA: patch to display ia64 function pointers J. Johnston
2003-08-25 21:12 ` Kevin Buettner
2003-08-26 17:34 ` J. Johnston
2003-08-26 22:37 ` [patch] missing case in epilogue stub detection Jafa
2003-08-26 22:45 ` Daniel Jacobowitz
2003-08-26 23:01 ` Jafa
2003-09-07 15:16 ` Daniel Jacobowitz [this message]
2003-09-09 3:00 ` 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=20030907151614.GA480@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jafa@silicondust.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