This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Replace deprecated_target_new_objfile_hook by observer?
> There Be Dragons! Note that there is a case where the remote objfile
> hook does _not_ call the next thing on the chain.
Is this then one instance you were mentioning (remote.c)?
/* Call predecessor on chain, if any. */
if (remote_new_objfile_chain != 0 &&
remote_desc == 0)
remote_new_objfile_chain (objfile);
I'm trying to understand how this is supposed to work, since
my understanding is that the order in which _init routines are
called is not guarantied. So the above breaks the chain, but we
just don't know where...
> > Assuming that it is, there are several platforms that use that
> > mechanism. It's going to be hard to test all of them. But the changes
> > themselves should be pretty mechanical. So what I can propose is
> > to make all the necessary changes to replace that hook model with
> > an approach using observers and test on x86-linux. And then rely
> > on the mechanical aspect of the change together with the review of
> > another pair of eyes. Would that be OK?
>
> Isn't there already an adequate observer? Well, not a single one I
> guess, you'd have to survey the uses and see what they really wanted.
> But solib_loaded goes a long way.
Even better, but that would make the change a little less mechanical
because the current solib_loaded observer has a different profile...
Perhaps I can reconcile the two - I'll have a look at that tomorrow.
--
Joel