From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8213 invoked by alias); 2 Feb 2004 19:01:49 -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 8188 invoked from network); 2 Feb 2004 19:01:48 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 2 Feb 2004 19:01:48 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 890D22B99; Mon, 2 Feb 2004 14:01:48 -0500 (EST) Message-ID: <401E9E9C.9080100@gnu.org> Date: Mon, 02 Feb 2004 19:01:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: Daniel Jacobowitz , Mark Kettenis Cc: gdb@sources.redhat.com Subject: Re: [RFC] TARGET_OBJECT_WCOOKIE References: <200402011702.i11H2HEZ000487@elgar.kettenis.dyndns.org> <20040201202313.GA20053@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00008.txt.bz2 >>The second issue I'd like your opinion on is related to the patch. I >> followed the example set by TARGET_OBJECT_UNWIND_TABLE in having a >> macro (NATIVE_XFER_WCOOKIE) to invoke the native-specific function >> that fetches the cookie. This macro would be defined in the nm.h >> file, but wasn't it our goal to get rid of the nm.h file sooner rather >> than later? Shouldn't we add another method for these kinds of hooks? >> The obvious alternatives are: >> >> a) Use a public function pointer, which is initialized to some >> do-nothing-and-return-minus-one function by default. This function >> pointer would be overridden by some code in the appropraite *-nat.c >> files. >> b) Use a private function pointer, and provide a function to set that >> pointer, along the lines of inftarg_set_find_memory_regions(). >> Opinions? It sux less than some of the other existing alternatives - in particular the way certain /proc or ptrace specific functions just happen to be linked in. Makes a real mess of the idea of having both /proc and ptrace support in a single executable. > Personally, I think the -nat files should have a chance to edit > child_ops, or provide their own version of child_ops. This would > eliminate 90% of the gunk in nm* files which is checked in the various > inf* files implementing child_ops. Have "proc" and "ptrace" export functions for creating fairly generic target ops and then have *-nat "inherit" from it (or push on-top of it)? Andrew