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 C5DA53851405 for ; Fri, 10 Feb 2023 14:18:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5DA53851405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id j23so5260178wra.0 for ; Fri, 10 Feb 2023 06:18:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vT6Mqfv0jr7Urt4Qw0M6IERisZePbcDMewoNqDEDJ0g=; b=MRU9xNI3LcQCpkYujLkQ83GTYcknZxS+sXh/fctX5BQan4uhQUis7nNiXNnSWm+gWu dCFQG5xNWtC45xcIvrBon5sITjbJX9TWHVvw+JDIRBb1EyYH3c3zqcOWcJ4uZPJIm7Cu oEDM4+8GdYZa83RYtKZg+dcxrxgfRzO4xZ23D6KYmXYkS4JLpwN6uPf9J0atHII6N61M KgBTRdwsQXrDmLrWj2VIq5y/pgMuZ8pLuxCd3UZnvywRuZErK1ecKc/Iuj/oSX131iie e/L29FzYrS9N9B3MNx16QRoztYsUaL6Zdu35Zu/OBEh/qa074z0PvYAG9SItdLVN5Bg5 kMvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vT6Mqfv0jr7Urt4Qw0M6IERisZePbcDMewoNqDEDJ0g=; b=qWk1mwQaIDCwhNRzQPtTCOJbfLEW60684b/BptF5tHQqvHYYEbaBH/LKqHpw4mG8Dk WwVebSs+7Z1WcQZ221N50BRJDWt/KsfOj7mhFSts/ShXrRhVZgFxXpfHKhA1zEbSgBRf DbG3XeYNZyZ0CrFu8ZsHO75RkVChcfMN8oFn1L3SWXixPjeBQ1jSM8ZzyGDAQbGK9PoA /hQDza0tdnSW+Hu22Xd0KpgsaLygWrcsuLFAUMTDDQNOH2iRnGuT6Ijj4/CAFp60nntF CRpizVmVon1IjxlzeYLGy6X3qufdzBoLb5WisEP44aVN0A0uJXjb7QKzkYorIs0BnYpZ XveA== X-Gm-Message-State: AO0yUKU0VSotjZtPcOwW4fPt19hGm1X9nx4ExdPN8e5mMHdWLpqSxXJT 0Br8pmBESGM1k3WwWy9GaaGUzg== X-Google-Smtp-Source: AK7set9ehC5MaP6eM0ylZV/HMbH5ejzL9CnXG1VrxvC3qwzxRHG7y1jOrROU3OIyX7X5ecV1d6z1rA== X-Received: by 2002:a5d:6307:0:b0:2c3:e993:9d81 with SMTP id i7-20020a5d6307000000b002c3e9939d81mr16638840wru.66.1676038708676; Fri, 10 Feb 2023 06:18:28 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id n1-20020a5d4001000000b002bcaa47bf78sm3802739wrp.26.2023.02.10.06.18.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2023 06:18:27 -0800 (PST) Date: Fri, 10 Feb 2023 14:18:26 +0000 (GMT) From: "Maciej W. Rozycki" To: Tom Tromey cc: gdb-patches@sourceware.org, Andrew Burgess , Richard Bunt Subject: Re: [PATCH v3 5/5] GDB: Introduce limited array lengths while printing values In-Reply-To: <877cx2l9a1.fsf@tromey.com> Message-ID: References: <877cx2l9a1.fsf@tromey.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.6 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: On Tue, 31 Jan 2023, Tom Tromey wrote: > Maciej> +/* Try to limit ourselves to only fetching the limited number of > Maciej> + elements. However, if this limited number of elements still > Maciej> + puts us over max_value_size, then we still throw an error. */ > Maciej> + > Maciej> +static bool > Maciej> +set_limited_array_length (struct value *val) > > I think the comment is slightly incorrect, in that this doesn't seem to > throw, but instead returns false. Yeah, it refers to the invocation of `check_type_length_before_alloc' in the caller really, which is where this comment was placed previously. I have updated the wording to: /* Try to limit ourselves to only fetching the limited number of elements. However, if this limited number of elements still puts us over max_value_size, then we still refuse it and return failure here, which will ultimately throw an error. */ This will be included in the next iteration. Let me know if you have any concerns about this rewrite. Maciej