From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9462 invoked by alias); 9 Oct 2003 19:42:25 -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 9446 invoked from network); 9 Oct 2003 19:42:25 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 9 Oct 2003 19:42:25 -0000 Received: by zenia.home (Postfix, from userid 5433) id 2BB8020766; Thu, 9 Oct 2003 14:40:50 -0500 (EST) To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: "struct target_ops" -> "struct gdbtarg" || "struct target" References: <3F856516.9020904@redhat.com> <3F8567D2.3020902@redhat.com> From: Jim Blandy Date: Thu, 09 Oct 2003 19:42:00 -0000 In-Reply-To: <3F8567D2.3020902@redhat.com> 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-10/txt/msg00161.txt.bz2 Andrew Cagney writes: > > Hello, > > The current "target_ops" structure appeared with GDB 4. The > > original implementation containing only methods. Since then the > > target_ops have evolved to include data vis: > > struct section_table > > *to_sections; > > struct section_table > > *to_sections_end; > > I think, the vector should be re-named to "struct target" or "struct > > gdbtarg" (consistent with gdbarch, and more name space proof) so > > that it correctly reflects its current implementation. > > I'd like to do this now, before the target methods start being > > explicitly parameterized with their target vector. > > I should note that an alternative is to have "struct gdbarch" as the > object and "struct target_ops" as the methods vis: > > struct target > { > .. data elements ...; > const struct target_ops *ops; > }; You mean 'struct target' not 'struct gdbarch', right? The second alternative seems better to me, since it separates the static stuff from the dynamic stuff. (Except, of course, that the 'static' stuff isn't actually static, because of update_current_target...)