From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27599 invoked by alias); 6 Sep 2003 00:02:40 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27591 invoked from network); 6 Sep 2003 00:02:38 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 6 Sep 2003 00:02:38 -0000 Received: by zenia.home (Postfix, from userid 5433) id 60BF3204FF; Fri, 5 Sep 2003 19:01:35 -0500 (EST) To: Daniel Jacobowitz Cc: Mark Kettenis , gdb@sources.redhat.com Subject: Re: [RFC] Register sets References: <200308232249.h7NMnvhh090154@elgar.kettenis.dyndns.org> <20030824164347.GA17520@nevyn.them.org> <200308252234.h7PMYqFu001245@elgar.kettenis.dyndns.org> <3F4B8173.1000302@redhat.com> <20030826165547.GA22836@nevyn.them.org> <86he3xrkjb.fsf@elgar.kettenis.dyndns.org> <20030904125514.GA2577@nevyn.them.org> From: Jim Blandy Date: Sat, 06 Sep 2003 00:02:00 -0000 In-Reply-To: <20030904125514.GA2577@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-09/txt/msg00083.txt.bz2 Daniel Jacobowitz 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.