Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sources.redhat.com
Subject: [RFC] New function find_target_at_stratum() ?
Date: Thu, 12 Jan 2006 06:09:00 -0000	[thread overview]
Message-ID: <20060112060939.GK676@adacore.com> (raw)

Hello,

While learning a bit more about the target vector and the target
stack, and how it is used, I noticed that two files, sol-thread.c
and uw-thread.c make an explicit reference to the procfs_ops target
vector.

Looking at the code, the idea is to implement one target method at
the thread level by first using the same method at the process level
and then by performing the necessary operations to handle threads.
For instance:

  static void
  sol_thread_attach (char *args, int from_tty)
  {
    procfs_ops.to_attach (args, from_tty);
  
    /* Must get symbols from shared libraries before libthread_db can run!  */
    solib_add (NULL, from_tty, (struct target_ops *) 0, auto_solib_add);
    [...]
  }

This is really nit-picking, but I think we can get rid of these explicit
references and then make procfs_ops static. The way to do this would be
to change the reference to procfs_ops by a function that would return
the target vector at the process level. Ie:

    find_target_ops_at_stratum (process_stratum).to_attach (args, from_tty);

This means adding a new function in target.h/target.c.

To be complete, I think the current public interface already allows us
to find the target vector at any stratum. Just by using current_target
and find_target_beneath(). I just thought that the new proposed function
might be of general interest?

Thoughts?

-- 
Joel


             reply	other threads:[~2006-01-12  6:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-12  6:09 Joel Brobecker [this message]
2006-01-12 20:48 ` Mark Kettenis
2006-01-13  4:05   ` Daniel Jacobowitz

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=20060112060939.GK676@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.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