From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6585 invoked by alias); 20 Feb 2018 16:48:37 -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 6572 invoked by uid 89); 20 Feb 2018 16:48:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f182.google.com Received: from mail-qk0-f182.google.com (HELO mail-qk0-f182.google.com) (209.85.220.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Feb 2018 16:48:35 +0000 Received: by mail-qk0-f182.google.com with SMTP id n198so17237045qke.7 for ; Tue, 20 Feb 2018 08:48:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J8T6744xWvgbzNu5tukCxeXzVad0WflPREkHf7tP+Ig=; b=s+CD47XkEMISyPsfz83eJ8XtgW9QSb8dfyCgi2fzWVY8ezvtysPoGOy8CVvEkke+rK OMnU0zyutDxfIpTpRzEClkzJWpIkOq882WPUHzdCfh8FHoMSfqtsaS6C+FN+ABqGLSP/ hKXiGtGFM5gRmIPU3Mg4Nt+HlbiD74MLVa1dDRvXQBWPFbCTemlj3jw7Wsfs1mslNAXA itHI7tIADPBCQibDlQTO20yu9iEhlmh6R33Vj8yxxQpVVqnEvQxYnuNnTW4CmrYrjpTb 9xVe0m/do5KEe/A6XT6f9A4WgjM3Wd5tUQ0KNRKls9W7FJyYGQOJYWUZLx9OVf42LLYQ 5Ovw== X-Gm-Message-State: APf1xPBfRbpmikiK5u4nRpPFQm4X7X290cgVVAYl8oXmRZA9Jn50v8Pa tpUUss/A3rmc5uP3f3WZxGvNrqtj+v4Rd4G50dk= X-Google-Smtp-Source: AH8x224wJs6mfYpAi+hx1ZJRUCUw5eMNE4itWyvqrX33TRRo0fRjyoa3215OP5CQCgTRFFX2JhR5r6WUbsGE4/jOj5s= X-Received: by 10.55.191.65 with SMTP id p62mr389901qkf.88.1519145313404; Tue, 20 Feb 2018 08:48:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.168.200 with HTTP; Tue, 20 Feb 2018 08:48:33 -0800 (PST) In-Reply-To: References: <1519044767-8741-1-git-send-email-roirand@adacore.com> From: Yao Qi Date: Tue, 20 Feb 2018 16:48:00 -0000 Message-ID: Subject: Re: [RFA] Fix frame argument printing when using auto language mode To: Xavier Roirand Cc: GDB Patches , Joel Brobecker Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00267.txt.bz2 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 beca= use > 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. > --=20 Yao (=E9=BD=90=E5=B0=A7)