From: teawater <teawater@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Get rid of linux-thread-db.c:target_beneath
Date: Sun, 08 Feb 2009 13:15:00 -0000 [thread overview]
Message-ID: <daef60380902080515v49d07f17l5e61c66eda140721@mail.gmail.com> (raw)
In-Reply-To: <200902061550.13149.pedro@codesourcery.com>
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
next prev parent reply other threads:[~2009-02-08 13:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 3:05 Pedro Alves
2009-02-06 4:57 ` teawater
2009-02-06 15:50 ` Pedro Alves
2009-02-08 13:15 ` teawater [this message]
2009-02-06 22:23 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=daef60380902080515v49d07f17l5e61c66eda140721@mail.gmail.com \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox