From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5536 invoked by alias); 21 Feb 2018 16:12:35 -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 5512 invoked by uid 89); 21 Feb 2018 16:12:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Feb 2018 16:12:33 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2CFCD81368 for ; Wed, 21 Feb 2018 17:12:31 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BU8RcsbqYtla for ; Wed, 21 Feb 2018 17:12:31 +0100 (CET) Received: from Xaviers-MacBook-Pro.local (unknown [46.18.100.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id EFF0581339 for ; Wed, 21 Feb 2018 17:12:30 +0100 (CET) Subject: Re: [RFA] Fix frame argument printing when using auto language mode To: gdb-patches@sourceware.org References: <1519044767-8741-1-git-send-email-roirand@adacore.com> From: Xavier Roirand Message-ID: Date: Wed, 21 Feb 2018 16:12:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00295.txt.bz2 Hello, This is a doable fix, I don't see any issue with it and hope that it will not add any side effect. I'll propose an RFA soon. Thx Regards Le 2/20/18 à 5:48 PM, Yao Qi a écrit : > On Tue, Feb 20, 2018 at 4:28 PM, Xavier Roirand wrote: >> >> It was my first idea, but it would imply a consequent amount of work because >> when ada_val_print_1 is called, the stack is the following one: >> >> #0 ada_val_print_1 >> #1 ada_val_print >> #2 val_print (got the language of the frame arg) >> >> So if we want to pass the per-frame language down to ada_val_print_1 then in >> the generic val_print function, we have to change: >> >> language->la_val_print (type, embedded_offset, address, >> stream, recurse, val, >> &local_opts); >> to something like: >> >> language->la_val_print (type, embedded_offset, address, >> stream, recurse, val, >> &local_opts, language); >> ^^^^^^^^ >> > > We don't have to do that. ada_val_print_1 is called in ada_val_print, > > ada_val_print_1 (type, embedded_offset, address, > stream, recurse, val, options, > current_language); > > and ada_val_print is language->la_val_print in effect, so "language" > is ada_language_defn, and we can rewrite the code above like this, > > ada_val_print_1 (type, embedded_offset, address, > stream, recurse, val, options, > &ada_language_defn); > > This change may break existing behaviour. Printing for ada (or other > languages) shouldn't depend on current_language, IMO. > >> Fix me if I'm wrong but it means that _val_print functions for all >> the supported GDB languages have to be modified in order to support the >> language parameter. >> >