Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: jimb@redhat.com
Cc: drow@mvista.com, gdb@sources.redhat.com
Subject: Re: [RFC] Register sets
Date: Sat, 06 Sep 2003 14:18:00 -0000	[thread overview]
Message-ID: <200309061417.h86EHmu1034345@elgar.kettenis.dyndns.org> (raw)
In-Reply-To: <vt2oexyzswx.fsf@zenia.home> (message from Jim Blandy on 05 Sep 2003 19:01:34 -0500)

   From: Jim Blandy <jimb@redhat.com>
   Date: 05 Sep 2003 19:01:34 -0500

   Daniel Jacobowitz <drow@mvista.com> writes:
   > struct regset
   > {
   >   void (*supply_regset)(struct regcache *, const void *, size_t, int);
   >   void (*read_regset)(struct regcache *, void *, size_t, int);
   > };

   If you want to allow people to define regset formats via the CLI, it
   seems to me you probably want some kind of closure argument in there,
   like this:

       struct regset
       {
	 /* Always pass this to the supply_regset and read_regset
	    functions below as their first argument.  */
	 void *closure;
	 void (*supply_regset)(void *closure,
			       struct regcache *, const void *, size_t, int);
	 void (*read_regset)(void *closure,
			     struct regcache *, void *, size_t, int);
       };

   This gives you the hook you need to have a single function for all
   CLI-defined regsets, interpreting the layout the user supplies to the
   CLI command.

Actually I need this closure argument for the corefile regset stuff
too.  For the i386 I have a single supply_regset function for all the
different "gregsets", and I define a table with offsets that defines
rhe proper mapping in `struct gdbarch_tdep'.  I could get at that
mapping since I was passing the architecture in, but that's just a
special case of the closure argument you propose.

Mark


  reply	other threads:[~2003-09-06 14:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-23 22:50 Mark Kettenis
2003-08-24 16:43 ` Daniel Jacobowitz
2003-08-25 22:35   ` Mark Kettenis
2003-08-26 15:49     ` Andrew Cagney
2003-08-26 16:55       ` Daniel Jacobowitz
2003-08-27  3:50         ` Andrew Cagney
2003-08-31 14:04         ` Mark Kettenis
2003-09-02 18:40           ` Andrew Cagney
2003-09-04 21:31             ` Mark Kettenis
2003-09-04 12:55           ` Daniel Jacobowitz
2003-09-04 14:00             ` Andrew Cagney
2003-09-04 14:08               ` Daniel Jacobowitz
2003-09-04 15:04                 ` Andrew Cagney
2003-09-04 15:13                   ` Daniel Jacobowitz
2003-09-04 22:07                     ` Mark Kettenis
2003-09-04 22:05                 ` Mark Kettenis
2003-09-04 22:16                   ` Andrew Cagney
2003-09-04 22:59                   ` Andrew Cagney
2003-09-05 23:15                     ` Daniel Jacobowitz
2003-09-09  4:21                       ` Andrew Cagney
2003-09-04 21:58             ` Mark Kettenis
2003-09-06  0:02             ` Jim Blandy
2003-09-06 14:18               ` Mark Kettenis [this message]
2003-09-09  4:51               ` Andrew Cagney
2003-09-09 17:15                 ` Jim Blandy
2003-09-09 19:16                   ` Andrew Cagney
2003-08-29 20:20       ` Mark Kettenis

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=200309061417.h86EHmu1034345@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=jimb@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