From: Pedro Alves <pedro@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org, Tristan Gingold <gingold@adacore.com>
Subject: Re: [RFC] How to get target_ops from to_kill method?
Date: Tue, 17 Mar 2009 00:05:00 -0000 [thread overview]
Message-ID: <200903162252.26346.pedro@codesourcery.com> (raw)
In-Reply-To: <20090316221103.GC384@adacore.com>
On Monday 16 March 2009 22:11:03, Joel Brobecker wrote:
> Do you think that the implementation for "target_kill" is good?
> That was my first implementation until I realized that the to_kill
> field is inherited. So perhaps I can simplify the implementation by
> calling the to_kill field from the target layer that's at the top
> of the current target stack?
The implementation of the function itself is good. What happens is that
we're switching from having the stack "hardcoded" at push time, to have
it traversed on demand, so, this method doesn't need to be inherited and
shouldn't be defaulted anymore. You can also delete debug_to_kill, it becomes
unreacheable code, since you start the lookup at current_target.beneath,
and you now handle the debug outputting in the new target_kill function.
At some point, I'd like to implement some of the ideas at:
http://sourceware.org/ml/gdb-patches/2009-02/msg00156.html
The most important/annoying part is to convert the targets and the
method interfaces, due to the need to touch "native" files.
> Other than that, I think I got all implementations, and I recompiled
> all the files that I could recompile on my x86_64-linux machine.
> I also built GDB with --enable-targets=all, even if I don't think
> it help test that much more since most impacted files are "native"
> units.
Yeah, that's the problem with these conversions. :-)
> static void
> -hpux_thread_kill_inferior (void)
> +hpux_thread_kill_inferior (struct target_ops *ops)
> {
> - deprecated_child_ops.to_kill ();
> + deprecated_child_ops.to_kill (ops);
Doesn't matter much for a deprecated_child_ops target user,
but, this should be:
deprecated_child_ops.to_kill (&deprecated_child_ops);
... so the next target in the chain can again do
find_target_beneath (ops)->to_kill (find_target_beneath (ops)),
and so on.
--
Pedro Alves
next prev parent reply other threads:[~2009-03-16 22:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 16:42 Joel Brobecker
2009-03-16 17:02 ` Pedro Alves
2009-03-16 17:24 ` Joel Brobecker
2009-03-16 17:24 ` Pedro Alves
2009-03-16 19:07 ` Joel Brobecker
2009-03-16 22:22 ` Joel Brobecker
2009-03-17 0:05 ` Pedro Alves [this message]
2009-03-17 18:05 ` Joel Brobecker
2009-03-17 18:28 ` Pedro Alves
2009-03-17 19:11 ` Joel Brobecker
2009-03-17 19:13 ` Pedro Alves
2009-03-17 19:31 ` Joel Brobecker
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=200903162252.26346.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=gingold@adacore.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