Re: [RFA] Handle runtime loader dyn sym resolution in reverse

Michael Snyder
2008-10-27T05:00:16Z

Michael Snyder wrote:
> Joel Brobecker wrote:
>
>>> 2008-10-24 Michael Snyder <msnyder@vmware.com>
>>>
>>> * infrun.c (handle_inferior_event): Handle dynamic symbol
>>> resolution in reverse.
>> Looks OK to me, but I don't understand why you check that stop_func_start
>> is zero. If I were to make a guess, it would be to quickly dismiss
>> the case were we reverse stepped into a function call, and so don't
>> need to check for trampolines (in other words, a CPU saver).
>
> Correct, but it's more than a CPU saver.
> If we are in a function (stop_func_start is non-zero),
> then we can set a step_resume breakpoint and continue,
> which is way faster than single stepping.
>
> We single-step only when we have to, ie. when we have
> actually stepped into the fixup jump table.

The big difference is, 'in_solib_dynsym_resolve_code'
returns true when we're in the dynamic loader function
"_dl_runtime_resolve", but we really don't want to single
step through that. Since it's a function with a minsym,
we can jump over it just like any other function -- but
then we hit the jump table and have to singlestep a few
times.

The test case was sent to me by teawater, who tried to
reverse-next over a printf. GDB handled the printf call
fine, then it stepped into _dl_runtime_resolve, which it
also handled, but it stumbled over the jump table.

Committed, by the way.