Get rid of linux-thread-db.c:target_beneath
teawater
teawater@gmail.com
Sun Feb 8 13:15:00 GMT 2009
Hi Pedro,
On Fri, Feb 6, 2009 at 23:50, Pedro Alves <pedro@codesourcery.com> wrote:
> On Friday 06 February 2009 04:56:58, teawater wrote:
>> But we still meet the problem that if a function of beneath target is
>> NULL, current target use find_target_beneath to get the beneath
>> function pointer is not easy and dangerous like process record meet,
>> right?
>
> linux-thread-db.c always sits on top of linux-nat.c currently, so
> it is safe to use in the cases I adjusted. When it isn't "safe",
> linux-thread-db.c already checks for NULL-ness.
>
>> What about make a interface to support safe beneath function?
>
> For now, you can check that the function pointer is NULL before
> calling it. If it is NULL, then try the next target
> beneath, etc. See target_attach, target_flash_erase, etc. You
> could do something similar in the record.c target. Things
> are cleaner on the target method implementation side
> if the target method takes a "this" pointer, like the one I'm
> adding to target_wait.
>
> If you do that, you get rid of the record_beneath_to_resume,
> record_beneath_to_wait, record_beneath_to_store_registers, etc.
> function pointer hacks you had. The wrinkle that has, is that your
> method ends up responsible for doing the default if no target
> implements the method. IMO, that would acceptible for
> now. But, it can be fixed.
>
I see.
So I make a new patch for it. Could you please help me review it?
http://sourceware.org/ml/gdb-patches/2009-02/msg00187.html
http://sourceware.org/ml/gdb-patches/2009-02/msg00188.html
And I make some new patches to fix the format errors. Please help me review it.
http://sourceware.org/ml/gdb-patches/2009-02/msg00189.html
http://sourceware.org/ml/gdb-patches/2009-02/msg00190.html
http://sourceware.org/ml/gdb-patches/2009-02/msg00192.html
Thanks,
Hui
More information about the Gdb-patches
mailing list