From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 960C13858D35 for ; Thu, 16 Mar 2023 12:28:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 960C13858D35 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=undo.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=undo.io Received: by mail-ed1-x533.google.com with SMTP id y4so7001970edo.2 for ; Thu, 16 Mar 2023 05:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo.io; s=google2; t=1678969692; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jgMMlnZwPWEgBxWwPxc+ranxjqmgtEvtD7ulITeLmCg=; b=b8l0RwqQe+jlwoaXYDOP2owZ4VA62IrZnHSb1Ypj+MDpK5qkqTkuVfn0MHUuKQyJ/g mIqv2cVwBFRdBFRW2I/2HW55s5eXnTQTkzZsayWkbgLIKDoeXjFTcrDI9guLuLB5wBtx Q/lrDhyGrNA5zYxH5NBTsxsVmC2A6wsFOJa5Vi/sghQlRtNelj5XyEzwVan9Dz/Xllg+ tUFXC55z/oKVdTsvbWoPdV21RPsLIgzjxOEkYpXCPduEzhlCbrz7d8uto+UVEfm3Zc8f CD74Xlr+vwuqQS7o1IOBMooTKvaebjSCFkGeMsHOFrY/rFrlb/iBscrV6FhzbaN7Fvip /wEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678969692; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jgMMlnZwPWEgBxWwPxc+ranxjqmgtEvtD7ulITeLmCg=; b=ossmVnD8a8MwQQcPGk2o7X7fX6KbnEBVR2E26N9wkZK0HX4vht69IHDaIy2VrbvGgk MUO44lKYxPA0pvOP0O2H2HTPx8Ty8TTN11lqZ102dxG3pddhPgvKWLMNagVLvoFyOWd1 gBQcfMYQtPAWvK06qz1LBi8TC3ID59pSMTZsHvhUAii1NfDd0DM+1aaF31uiFdVD9fmW XwFtKQNVoX3hQpW2t4LgqLG1gXaESqn1GqifBqMdmqSi3fXaxODO9t6vuzslYf7GXm9G jCN/Iwb+H6FPDlV7ODmhHkJXpTJuf15OY2Y7LHYNwgvVntZwCzKxbUsBhQi6rpiXOXvE 2IMg== X-Gm-Message-State: AO0yUKUQm4ZDBt9K41mM52le49WG3O19fja6TBMs9gP88EUCQjY+YANk fNRY9My7FAPcAO8EUTwrd1d8JeN87lJnkFTNtjmf0w== X-Google-Smtp-Source: AK7set/16jaU+ZekFiq0ywj6aitZan/0FejfK/wM1097wMTNliYlAlO8I9PZXvgkLrfAueVSRtPJQysJnj7Mz/jyi0o= X-Received: by 2002:a17:907:7ea9:b0:8d1:9162:514a with SMTP id qb41-20020a1709077ea900b008d19162514amr5335311ejc.8.1678969692327; Thu, 16 Mar 2023 05:28:12 -0700 (PDT) MIME-Version: 1.0 References: <87fsftateu.fsf@redhat.com> <20221020174702.514681-1-grees@undo.io> <87bkl3h153.fsf@redhat.com> <83r0twzu8r.fsf@gnu.org> <87v8j4fu48.fsf@redhat.com> In-Reply-To: <87v8j4fu48.fsf@redhat.com> From: Gareth Rees Date: Thu, 16 Mar 2023 12:28:01 +0000 Message-ID: Subject: Re: [PATCH v5] [PR mi/29554] New PRINT-VALUES option '--scalar-values'. To: Andrew Burgess Cc: Eli Zaretskii , gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.8 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Andrew Burgess wrote: > If we really feel that the old behaviour is worth saving then adding a > new flag isn't the end of the world. I'd just want to make sure we > really have considered the alternatives first. I agree with Andrew's analysis. Another consideration is that it is likely that existing GDB/MI clients that use --simple-values are subject to latent bugs or performance issues that could be fixed by changing the behaviour of the option. When implementing a GDB/MI client for an IDE, you typically want to update the displayed call stack every time the debuggee stops, and the most convenient way to do this is to use the -stack-list-arguments command. Since it is helpful for the user to be able to see the type of each argument, it is natural to use the --simple-values option, as otherwise you have to loop over the arguments calling -var-create. If you use -stack-list-arguments with --simple-values, it can be hard to spot that you are introducing bugs or performance issues when debugging C++ programs with functions taking references to large data structures, and it is easy to omit this case in testing. Visual Studio Code's initial implementation of their GDB/MI client had exactly such an issue. Searching GitHub, I found a couple of other bugs that might take this form, in particular [1] and [2] are hangs in gdbgui whose descriptions suggest that they might be related to the handling of reference types by the --simple-values option. [1] https://github.com/cs01/gdbgui/issues/205 [2] https://github.com/cs01/gdbgui/issues/206