This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: corelow and threads question


On Friday 05 June 2009 19:54:54, Aleksandar Ristovski wrote:

> With corelow.c patched as proposed, on Neutrino I could do this:
> 
> For NTO, I "hijack" core_ops:
> static void
> init_nto_core_ops ()
> {
>    struct target_ops *core_ops;
> 
>    core_ops = find_core_target ();
>    gdb_assert (core_ops && core_ops->to_shortname != NULL
>                && !!"core_ops must be initialized first!");
>    original_core_ops = *core_ops;
>    core_ops->to_extra_thread_info = 
> nto_target_extra_thread_info;
>    core_ops->to_open = nto_core_open;
>    core_ops->to_xfer_partial = nto_core_xfer_partial;
>    core_ops->to_pid_to_str = nto_pid_to_str;
> }

As I mentioned in the other threads, this is fine as a local change,
but not so to have in GDB proper, so it does go against
your goal of pushing all your local changes.  :-/

This is depending on the order of which the _initialize
routines are called, hence the gdb_assert.  I just cleaned
up the only left over target that was doing a similar hack
(sol-threads.c) a couple of months ago, to not do so.

Again, it's hard to come up with a better alternative
without knowing what you're doing in those overrides.  Maybe
what you need is a thread_stratum target sitting on top of
nto-procfs.c or corelow.c.  Maybe we need new gdbarch
callbacks.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]