This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [resend/patch/rfc] How to handle stepping into an unresolvedplt entry?
- From: Andrew Cagney <cagney at gnu dot org>
- To: Randolph Chung <randolph at tausq dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 11 Jun 2004 14:07:56 -0400
- Subject: Re: [resend/patch/rfc] How to handle stepping into an unresolvedplt entry?
- References: <20040607030222.GC601@tausq.org>
(I've been avoiding this one :-()
Any comments on the following? Can I check it in?
Part of this thread went to gdb@s.r.c instead of gdb-patches@s.r.c, if
anyone wants to see the history....
thanks,
randolph
----- Forwarded message from Randolph Chung <randolph@tausq.org> -----
Date: Tue, 25 May 2004 00:13:40 -0700
From: Randolph Chung <randolph@tausq.org>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: [patch/rfc] How to handle stepping into an unresolved plt entry?
Reply-To: Randolph Chung <randolph@tausq.org>
The rationale (if we think it can be called that :-) is lost in the
depths of time. Perhaps some unwinders barfed when presented with a
function with no function name so it was thought that doing the check
first was prudent?
Anyway, can the IN_SOLIB_RETURN_TRAMPOLINE be moved up as well (with an
additional ecs->stop_func_name != NULL check?
The attached patch contains the new arrangement of tests that works
better on hppa. Regression tested on i386-linux. I'd be interested to
see test results for some of the ppc variants, since they seem to be
also have interesting trampoline code.
Also, some comments from looking at the 2nd half of
handle_inferior_event (stepping out of stepping range).... the new
order of cases being handled is:
1. Runtime loader
2. Signal trampoline
signal trampoline, or signal delivered (which is before the trampoline
is created)?
3. current frame == step frame
== or !=?
3a. stepi/nexti-in-prologue
3b. next/IGNORE_HELPER_CALL check
3c. skip trampolines
3d. Runtime loader check
3e. If line number available at target, step into function
else put breakpoint in previous frame and continue
4. Return trampoline
5. Stopped at function with no name
6. stepi/nexti
7. No line number info
8. Stepped to next line
9. Stepped out of current function
10. Update current frame and continue
Hmm, nice description!
Several questions:
- At step 3:
if (frame_id_eq (frame_unwind_id (get_current_frame ()),
step_frame_id))
{
/* It's a subroutine call. */
Why is this "a subroutine call"? It seems that in the general case this
is not a subroutine call.....
It's always some sort of ``nested call'' but not necessarially due to a
funciton call instruction (it could be due to a signal for instance).
- At step 3b, IGNORE_HELPER_CALL () is only defined for mips. The
comments say:
/* On MIPS16, a function that returns a floating point value may call
a library helper function to copy the return value to a floating point
register. The IGNORE_HELPER_CALL macro returns non-zero if we
should ignore (i.e. step over) this function call. */
Shouldn't this be handled by the trampoline logic? I guess this might
be historical...
At step 5: we declare the function as "undebuggable" if it has no name,
but elsewhere in this function it seems to equate "undebuggable" with
"no line number" in a sal lookup.... are both tests needed, or is 5/7
redundant?
I see your point. Anyway here's a guess:
- If there's no function name info then, regardless of the line number
info, its pretty undebuggable. I think this might have also been the
very original intent - have gdb skip over thunks and stubs into real code.
- If there is a function name, but no line number info, then I think
this might have been motivated by the more recent ``skip nodebug''
command line mode's intent.
I think resolving this belongs in a separate, later, thread.
2004-05-24 Randolph Chung <tausq@debian.org>
* infrun.c (handle_inferior_event): Handle the case when a trampoline
ends up in the runtime resolver, and if the trampoline has no name.
Rearrange the code so that all the trampoline processing happens before
other step-out-of-range handling.
so, ..., ok,
Andrew