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.129.124]) by sourceware.org (Postfix) with ESMTPS id 50C9E3858D1E for ; Tue, 25 Apr 2023 15:50:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50C9E3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682437857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=36h9t1nRRD2RGENAg7J+HFsGDg/N/7kRlY/s/pZJw+g=; b=Z8+XwIFVOd3vUcYqqmZnJkCk3owKLMOk2q2YsNYEWJsKpGC0yYeS4v6S6kECWYuWH4nZ50 PoRXrSLA42z7IU88seaowvq+7w85d/shsHHVmuh7hKy4IKQjp4s50y2L6tNcUfI4t1hoJ4 cjGFhVxL0Q73AFS0t1j+ykd2l8m37Uc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-bOYMqHLaNxyM9ORc4adr1w-1; Tue, 25 Apr 2023 11:50:56 -0400 X-MC-Unique: bOYMqHLaNxyM9ORc4adr1w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AF87A9E3; Tue, 25 Apr 2023 15:50:56 +0000 (UTC) Received: from [10.22.9.236] (unknown [10.22.9.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA50AC15BA0; Tue, 25 Apr 2023 15:50:55 +0000 (UTC) Message-ID: <514297cf-4c9e-f6bb-95f3-3ebdec9bb13e@redhat.com> Date: Tue, 25 Apr 2023 08:50:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Allow strings with printf/eval To: Tom Tromey , Keith Seitz via Gdb-patches References: <20230423172131.1104908-1-keiths@redhat.com> <87r0s9xkyu.fsf@tromey.com> From: Keith Seitz In-Reply-To: <87r0s9xkyu.fsf@tromey.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 4/24/23 10:12, Tom Tromey wrote: >>>>>> "Keith" == Keith Seitz via Gdb-patches writes: > > Keith> (gdb) printf "%s\n", "hello" > Keith> evaluation of this expression requires the target program to be active > > This is https://sourceware.org/bugzilla/show_bug.cgi?id=13098 Thank you for that bz; I will add a reference in the commit log. > Keith> - if (value->type ()->code () != TYPE_CODE_PTR > Keith> - && value->lval () == lval_internalvar > Keith> + if (((value->type ()->code () != TYPE_CODE_PTR && value->lval () == lval_internalvar) > Keith> + || (value->type ()->code () == TYPE_CODE_ARRAY && value->lval () == not_lval)) > > I wonder if lval check is necessary here. It does not appear to be, but I erred on the overly conservative side when implementing the change. Regression testing shows no differences when removing that lval check. I've removed it locally. Keith