From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 681 invoked by alias); 1 Oct 2003 06:01:50 -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 564 invoked from network); 1 Oct 2003 06:01:49 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 1 Oct 2003 06:01:49 -0000 Received: by zenia.home (Postfix, from userid 5433) id 0F21D20766; Wed, 1 Oct 2003 00:57:30 -0500 (EST) To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: value to function? References: <3F76FB5B.4030401@redhat.com> <3F799B8C.8030601@redhat.com> From: Jim Blandy Date: Wed, 01 Oct 2003 06:01:00 -0000 In-Reply-To: <3F799B8C.8030601@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/msg00009.txt.bz2 Andrew Cagney writes: > > Andrew Cagney writes: > > > >> If the proposal to pass a function value to push_dummy_call is going > >> to fly there's going to need to be a method that converts an arbitrary > >> value into a function/method value. > > A new gdbarch method to be called from where, specifically? This > > area > > is a mess (just try describing the behavior of find_function_addr...), > > so I'm not sure what you mean. > > Now I think I'm missing something. What new architecture method? > What mess? Never mind. You said "there's going to need to be a method that converts..." Since you said "method", I assumed you didn't mean "function", so I was trying to figure out what sort of method you meant. > > Kind of like find_function_addr() and the oposite of value_coerce_function. > > pre (I guess that value isn't void or NULL); > struct value *foo (struct value *); > post (VALUE_TYPE (foo (value)) == TYPE_CODE_FUNC > || VALUE_TYPE (foo (value)) == TYPE_CODE_METHOD)); > > it would be used in relative proximity to push_dummy_call and > return_value (ex, replace find_function_addr). Sure, this is just a nicer packaging of find_function_addr, which seems to be doing two separable jobs: - coercing various non-function values into callable things, and - extracting that callable thing's entry point address and return type. A function value carries both those data in a handy and obvious way.