From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 62A843858D3C for ; Fri, 9 Feb 2024 19:14:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62A843858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 62A843858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707506083; cv=none; b=iCudFxdiAxs7eWuzrPKAezj6Kn2ZJoV0xeziC9IUffEX/t1fAQ8WjRyHaT+pKnysyDHTcC3ZzLEXIWlj0ZhtQc0nrt3LRSR63bK2YAalgVHRCaW9KAVN5kns+JFuQxxmqI9JBC8HhN50M+GqVYtLNQbAZmjlAOxlG0cIrC3+/bA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707506083; c=relaxed/simple; bh=ryy5fuipVLctLWbofbIx9LnKR/ffb0Pdxom4JRMmBdo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cCPOJrCag+4wMXn0dNUJ/0cbBjwEUqCqJZh6+efw4ZusV6M4j+ejmc7t0MYJvYQtu6eq7sKnIDazz32I86mp9p0uU5aghi0IC6KJZo0IOGAdHb/Hxhf4im2xC/NaiLRav7IYuMSRuMRWHq2Ohsj9rcIx+YODT9ZHhtcDmSoYkjI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707506082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zCdmsVQYJ1IUXlQWBFam6DhjsIBsil2vNSaEYg7uCRg=; b=O8wZDb03lSj2rJIQuVkchpTQqimCo+3ttqmBGk3RFyD1RzW+Mu80wSxOK6PMATjDHmvxBn IxDAFYeLeCs9FlfU1ZhwCNAwHl1Zpo6sviuGV+OiNGiXd5P0Pnz6uYk8Kq9Lj9U7ahyOAx 0SoksAiBo5aWRveMpNG7QoV4V82SnXA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-NQ5-PNKNNryYbcQFyOCFAA-1; Fri, 09 Feb 2024 14:14:39 -0500 X-MC-Unique: NQ5-PNKNNryYbcQFyOCFAA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6DEC3C1E9C6; Fri, 9 Feb 2024 19:14:38 +0000 (UTC) Received: from f39-zbm-amd (unknown [10.22.16.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34723C08EF7; Fri, 9 Feb 2024 19:14:38 +0000 (UTC) Date: Fri, 9 Feb 2024 12:14:36 -0700 From: Kevin Buettner To: Hannes Domani Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Allow value repeat operator on references Message-ID: <20240209121436.79da5ec9@f39-zbm-amd> In-Reply-To: <20240209130451.31442-1-ssbssa@yahoo.de> References: <20240209130451.31442-1-ssbssa.ref@yahoo.de> <20240209130451.31442-1-ssbssa@yahoo.de> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Fri, 9 Feb 2024 14:04:51 +0100 Hannes Domani wrote: > Currently it's not possible to use the value repeat operator on references: > ``` > print ((int &) v_int_array_init[0])@2 > Only values in memory can be extended with '@'. > ``` > > This seems like an unnecessary restriction, since it also prevents > its use on iterators (which was the original reported problem): > ``` > (gdb) p *it@2 > Only values in memory can be extended with '@'. > ``` > > So this converts any references to the referenced value in value_repeat, > making this possible: > ``` > print ((int &) v_int_array_init[0])@2 > $1 = {10, 20} > (gdb) p *it@2 > $2 = {1, 2} > ``` > --- > gdb/testsuite/gdb.base/exprs.exp | 1 + > gdb/valops.c | 2 ++ > 2 files changed, 3 insertions(+) LGTM. Approved-by: Kevin Buettner