This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to insert dynamic code? (continued)
jacob navia writes:
> Andrew Haley wrote:
>
> >I suspect that the gcc unwinder is relying on __dl_iterate_phdr to
> >scan the loaded libraries and isn't using the region that you have
> >registered.
> >
> >But this is odd, becasue when I look at _Unwind_Find_FDE in
> >unwind-dw2-fde-glibc.c, I see:
> >
> > ret = _Unwind_Find_registered_FDE (pc, bases);
> >
> > ...
> >
> >
> > if (dl_iterate_phdr (_Unwind_IteratePhdrCallback, &data) < 0)
> > return NULL;
> >
> >So, it looks to me as though we do call _Unwind_Find_registered_FDE
> >first. If you have registered your EH data, it should be found.
> >
> >
> >
> OK, so I have to look there then. Actually this is good news because
> figuring out how to mess with the dynamic loader data is not something
> for the faint of heart :-)
True.
> >So, what happens when _Unwind_Find_registered_FDE is called? Does it
> >find the EH data you have registered?
> >
> >
> >
> Yes but then it stops there instead of going upwards and finding the catch!
> It is as my insertion left the list of registered routines in a bad state.
OK, so the problem is in decoding the unwinder data, and you're just
going to have to single-step through the part where it decodes the
data you've generated.
Andrew.