From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109269 invoked by alias); 14 Oct 2016 17:35:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 109084 invoked by uid 89); 14 Oct 2016 17:35:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*r:112, AFTER, mains, Hx-languages-length:1931 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Oct 2016 17:35:14 +0000 Received: by simark.ca (Postfix, from userid 112) id 658C21E14E; Fri, 14 Oct 2016 13:35:13 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 496BF1E120; Fri, 14 Oct 2016 13:35:12 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 14 Oct 2016 17:35:00 -0000 From: Simon Marchi To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [RFC 2/3] Record function descriptor address instead of function address in value In-Reply-To: <1476442387-17291-3-git-send-email-yao.qi@linaro.org> References: <1476442387-17291-1-git-send-email-yao.qi@linaro.org> <1476442387-17291-3-git-send-email-yao.qi@linaro.org> Message-ID: <1e73fccd01e8a226c95719bb334669d7@simark.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.0 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00459.txt.bz2 On 2016-10-14 06:53, Yao Qi wrote: > In this patch, I add a new gdbarch method convert_from_func_addr, which > converts function address back to function descriptor address or > function pointer address. It is the reversed operation of > convert_from_func_ptr_addr. We convert function address to function > descriptor address when, I think these could be better named, byt saying what it converts from _and_ what it converts to. With convert_from_func_addr, we know it takes as input a function address, but we don't know what it converts it to. What about something like convert_func_address_to_descriptor (or convert_func_addr_to_desc if you prefer shorter names)? I think that it would also be clearer if we always used the same terminology (address and descriptor seem good). It is not very intuitive what is the difference between convert_from_func_ptr_addr and convert_from_func_addr. "function pointer address" and "function address" sound too close to each other, so it's easy to confuse them... > 3. User visible changes > > This patch brings several user visible changes, which look more > accurate, shown by this table below, > > COMMAND BEFORE AFTER > p main main function address main function > descriptor > address > disass main disassembly function main not changed > disass main+4,+4 disassembly 4 bytes from disassembly 4 bytes > from > function main address + 4 main's function > descriptor + 4 > x/i main show one instruction on show one instruction on > main's > function main address function descriptor > > Although the latter looks inconvenient, that is consistent to the > meaning on C language level. Due to these changes, test cases are > adjusted accordingly. Could you provide example of the actual output of those commands, before and after? It is not clear to me what the difference will be. Thanks, Simon