From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id VclzBFfUvGcybTwAWB0awg (envelope-from ) for ; Mon, 24 Feb 2025 15:19:35 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SRWQXtGg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 03C1A1E105; Mon, 24 Feb 2025 15:19:35 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8CA611E05C for ; Mon, 24 Feb 2025 15:19:34 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10C643858C53 for ; Mon, 24 Feb 2025 20:19:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10C643858C53 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SRWQXtGg Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id AEE133858D29 for ; Mon, 24 Feb 2025 20:19:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEE133858D29 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 AEE133858D29 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=1740428340; cv=none; b=xT8QcKwGeUxhVNZ5tm2WYnvAj1H4N3Jcb3+Lv7NxXDm5OfSosk8Eecam9y+bzQ6G8jfKvX7MC+vDGyNxXgCCstwCDL6Rd7PSV7eXQ4owm4W4N/2DA5R/vrOAXbiqjGDFjDIpuxEU9h/ncMgH5Zkr/qv8bupDkyGae4QHcREGaUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740428340; c=relaxed/simple; bh=RPkOGq3WGi27SjkuXycPqUCluQQDQLYhBtdaX8JkOuQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=F+JkkZM9FwXMs/oqXBZHj+FdtB2haxExPVNnxB3xWr028OpLj7d5emRv+Rv7M0P6llRoqkx/VrwtKLFPILPMeRm0VdaVZs1K5m2WlbCF+SvAjMEyoT0KPmwNUBZtKPzYyLGlsifNgPIzHUBS3jen5wiZic0SLxxPDi/5JPUw2YI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEE133858D29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740428340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8+m66sOnsupTGRepGFBEZYlaGFc6werNK9HqpS7ZQG4=; b=SRWQXtGgV8KbA2Ndl6L++rTazMV7WRb+gEGNh42dhjymzDT0cE3urTnLk6IJiVGsbBcK+y sDQTi8qBwijPmnaIw9EKAkt/LAuLfgApVGWlkH/z9bjeZECZ/teBISkZQeZUd5EBGQ49Yw mXvH3sduIT1RKVrVkBQgtKgdKS4Wsa0= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-FyLZt05vOAuX4hq7wME_MQ-1; Mon, 24 Feb 2025 15:18:55 -0500 X-MC-Unique: FyLZt05vOAuX4hq7wME_MQ-1 X-Mimecast-MFC-AGG-ID: FyLZt05vOAuX4hq7wME_MQ_1740428335 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-22126a488d7so106776825ad.2 for ; Mon, 24 Feb 2025 12:18:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740428334; x=1741033134; h=in-reply-to:content-language:references:to:from:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=8+m66sOnsupTGRepGFBEZYlaGFc6werNK9HqpS7ZQG4=; b=i5Al15HNatp3sn36YNxEtdV12kDQw5KikdYKmGwkm+3dCxtb8t9TPIllA+L2R7i00u RVIf05Pp894m0zmnnzLCWnMq5SXLewY2WhJkD9iDPawilXarS0+uwoVSfvcVPjGRf10W Ws1wQtDgsaITR18fOgzezPG/iibbtyoDubfMHosoqzvGiO/LmkF8c7Knkutc7BW4giRe +FOjhKA/Bet0z7XVtZ5X5wvdZE7gL4DUnLvxqvdtrMJEgY7a/Vq6Xd2jVqcCZ1Rh1FWR 3Tc1BENLimXBWZecq1805S54zIQP6K6EUUMNYJcTIbPc37e/hTTMBtMWM3/T/UuKynQj J+Dw== X-Forwarded-Encrypted: i=1; AJvYcCXx2p15LoqeJZp6eifLLlWU5xs1yLPJ0N0xue4+FlcdL3w0Xi2YpSKYPuQMxZ1+YkD4pEKFXIrGoFCnSg==@sourceware.org X-Gm-Message-State: AOJu0YwwAQwTmlqt0y0q/8v82rH7X9X9m7FmMXwMtPPxxr0wQ/A2/HSA kKjLbRNLtT82Gqe+z8WpHKATAZHFS09T0yd/x1JpFVf14YsCKp0rZwRDO7q6sslvwttiQAzBbT2 17ckzbZvQH3Xa3+yVetSTSpoSqLwJNBs7VDztlH6JXywQfN/6GSRWuMhnzwUDeGsuZzw= X-Gm-Gg: ASbGncvEyBLJ09oz3kE/tt+EhdV7i8cBfXT6qys19jfKtWkygme7cuCKUO0cLey7QSY FJYXdf+E72pLJfoNVK8ujP1pKbVjPb+J8fApKXMgdYDlIx9+aCDCu+9e/IgxkFLtQSYPdhN0gcm r2eG7M+haa/GocrBf1y6/2lg94xTC9VdBqcC9fHSwgMf5ican0UT+K3yajTk+yzFLbN7GxwwKrC Pk3VXWK5Yr2LmCeQ7eO/cTeHPLoPgzB99Q3piC9QXBqXZi0RBJ+6H9wORDD6DiV61Ez8PoXIweX CgL4yHNx4zzxlU5nZMX9YJH+pi8= X-Received: by 2002:a17:902:e5c2:b0:215:9470:7e82 with SMTP id d9443c01a7336-22307b455dcmr9558565ad.4.1740428334613; Mon, 24 Feb 2025 12:18:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCcFUZO/ummPcn5BR+sepo22/a+e4vFb8hwY4fUgIH/wvAjzXMleJHKxq70zae0+d6EcffVQ== X-Received: by 2002:a17:902:e5c2:b0:215:9470:7e82 with SMTP id d9443c01a7336-22307b455dcmr9558325ad.4.1740428334257; Mon, 24 Feb 2025 12:18:54 -0800 (PST) Received: from ?IPV6:2804:14d:8084:9a69::1002? ([2804:14d:8084:9a69::1002]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2230a0215c5sm187305ad.66.2025.02.24.12.18.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Feb 2025 12:18:53 -0800 (PST) Message-ID: Date: Mon, 24 Feb 2025 17:18:51 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/testsuite: add test for memory requirements of gcore From: Guinevere Larsen To: Andrew Burgess , gdb-patches@sourceware.org References: <20250224140407.252987-1-guinevere@redhat.com> <87tt8jmcfm.fsf@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: jMuruUP5BPbeBX1tGrBYSrT0tp_DyboWC93hQtqEIVU_1740428335 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------9RSzo73DcOwqVuNxJHy4Ppe0" Content-Language: en-US X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This is a multi-part message in MIME format. --------------9RSzo73DcOwqVuNxJHy4Ppe0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/24/25 5:00 PM, Guinevere Larsen wrote: >> If there was no argument passing here then I'd say you should be using >> spawn_wait_for_attach.  But that doesn't support argument passing... >> >> ... however, if you read that proc (and its helper proc) you'll see some >> comments that suggest using eval/exec like you do are not the right >> choice. >> >> So maybe we should either extend (somehow) spawn_wait_for_attach to >> allow argument passing, or write something like spawn_wait_for_attach >> that handles arguments? > > If I found the correct documentation page, I think it shouldn't be > hard to extend spawn_wait_for_attach to handle arguments. And using > optional arguments, it should be a  very minor patch, so I'll see what > I can cook up. > > Thanks for the pointer, this definitely sounds like a better solution. Actually, scratch that, we don't *need* to extend spawn_wait_for_attach. We can just give it a list with one element: "$::binfile $megs". So I'll definitely go this route. I can add a convenience function to handle this anyway, if you'd prefer, though -- Cheers, Guinevere Larsen She/Her/Hers --------------9RSzo73DcOwqVuNxJHy4Ppe0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2/24/25 5:00 PM, Guinevere Larsen wrote:
If there was no argument passing here then I'd say you should be using
spawn_wait_for_attach.  But that doesn't support argument passing...

... however, if you read that proc (and its helper proc) you'll see some
comments that suggest using eval/exec like you do are not the right
choice.

So maybe we should either extend (somehow) spawn_wait_for_attach to
allow argument passing, or write something like spawn_wait_for_attach
that handles arguments?

If I found the correct documentation page, I think it shouldn't be hard to extend spawn_wait_for_attach to handle arguments. And using optional arguments, it should be a  very minor patch, so I'll see what I can cook up.

Thanks for the pointer, this definitely sounds like a better solution.

Actually, scratch that, we don't *need* to extend spawn_wait_for_attach. We can just give it a list with one element: "$::binfile $megs". So I'll definitely go this route.

I can add a convenience function to handle this anyway, if you'd prefer, though

-- 
Cheers,
Guinevere Larsen
She/Her/Hers
--------------9RSzo73DcOwqVuNxJHy4Ppe0--