From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 9823A3858404 for ; Fri, 9 Sep 2022 08:04:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9823A3858404 Received: by mail-wr1-x42d.google.com with SMTP id bj14so1358956wrb.12 for ; Fri, 09 Sep 2022 01:04:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=7avmxiUSUIaFEw4Q/rSkQfYXiXTKV81q1LfMVwLkTco=; b=0j7Akg9k4qEvXow6iY7ViiO3ISLOdZQbgnXfJeLoW/6n53Ap68m4nAecODi71seizi u4iweH9Q0YGZ/W/Pi4ZlSHumY2bsN/A/eCILFz3FmmPNBlqWEEfzZ6fOxFQbO/bJRpD9 y9ctWUMkNzmBtp2oHdnrK3E0cOLKr+R+FzJ/16WLdTSTK4c400h+KhUf+1hHAsxv1gzX 8OOMLCiZ8XTBAGjPZklEB0rwMCEqTUod59vLFHXjkP/IRn894MdvsdQdmH+N45/khVW2 KqIsxSAomLFuhsvmZaLjOaG7MUS6AVw1NB+6mCkI0+EicbbVuj4k+PM9y9hVzy04rImM 0M1A== X-Gm-Message-State: ACgBeo3TUrHE7RFU76zZq3F9ekrrZZ5L1utr4ZwL1okRYlRSaGAXltwD Ia2+Kts5E4bUb8AZJn/ANMMTw98rWUCv5X4pQw/Cdg== X-Google-Smtp-Source: AA6agR7Z6EvyC2B1p7yGJlI98IBL/wAdeUg/s7FXLAGBywY+pDSZOktOO78W0gClg54mW112MVnyqwtWItGgHF/7r84= X-Received: by 2002:a5d:46c9:0:b0:22a:4306:b77d with SMTP id g9-20020a5d46c9000000b0022a4306b77dmr235643wrs.305.1662710698262; Fri, 09 Sep 2022 01:04:58 -0700 (PDT) MIME-Version: 1.0 References: <877d2ema8q.fsf@redhat.com> <20220908110248.1084-1-grees@undo.io> <834jxif0yp.fsf@gnu.org> In-Reply-To: <834jxif0yp.fsf@gnu.org> From: Gareth Rees Date: Fri, 9 Sep 2022 09:04:47 +0100 Message-ID: Subject: Re: [PATCH v2] [gdb/mi] Don't treat references to compound values as "simple". To: Eli Zaretskii Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2022 08:05:01 -0000 Eli Zaretskii wrote: > > There are two ways we could fix this problem, depending on whether we > > consider the current behaviour to be a bug. > > > > 1. If the current behaviour is a bug, then we can update the behaviour > > of '--simple-values' so that it takes reference types into account: > > that is, a value is simple if it is neither an array, struct, or > > union, nor a reference to an array, struct or union. > > > > In this case we must add a feature to the '-list-features' command so > > that IDEs can detect that it is safe to use the '--simple-values' > > argument when refreshing the call stack. > > > > 2. If the current behaviour is not a bug, then we can add a new option > > for the PRINT-VALUES argument, for example, '--simplest-values' (3), > > that would be suitable for use by IDEs. > > > > In this case we must add a feature to the '-list-features' command so > > that IDEs can detect that the '--simplest-values' argument is > > available for use when refreshing the call stack. > > Thanks. FWIW, I think we should implement 2, not 1. I have prepared a new patch that implements solution (2), adding a '--scalar-values' option for the PRINT-VALUES argument to '-stack-list-arguments' and similar commands. This option prints the value only for scalars and so matches the behaviour of the 'scalars' argument to the 'set print frame-arguments' command. References to structures are not scalars, and so the option is suitable for use by IDEs. See my e-mail with subject: "[PATCH v3] [PR mi/29554] New PRINT-VALUES option '--scalar-values'."