From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 77A533858D28 for ; Thu, 26 Jan 2023 09:30:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77A533858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B39081FEA2; Thu, 26 Jan 2023 09:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674725454; h=from:from:reply-to: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=iQ/D6QIjWg9spYmHddQLLvLnCEhFBSzqy8L2NwJNopA=; b=qHoj4aJ4HMyemKGKZYF8cWEHN9h/P2xmiq17J3qPwOuWVY41cNV3ZrbHkjETmi7CaWtmiS Qm5SConTGSZws4JDJ17fuXMOZeVuxFOnk9LgVG8Lh6ieEvVbMr7VFz6pD8ufMRFJYTucsK ZbhFRVdh165Rru7kZNYjlZ/z759/NyM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674725454; h=from:from:reply-to: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=iQ/D6QIjWg9spYmHddQLLvLnCEhFBSzqy8L2NwJNopA=; b=0FK/QTWI1TcmfmINUilcvwgLMyfqtRbJYv+TGklJuHJjZhU4e1c/pLrePYcebgN2x25zCN gVr2e7XgiErWT6Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9ED9D139B3; Thu, 26 Jan 2023 09:30:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7palJU5I0mPiWQAAMHmgww (envelope-from ); Thu, 26 Jan 2023 09:30:54 +0000 Message-ID: <3b85f763-dcc0-7430-423e-e90f636884ce@suse.de> Date: Thu, 26 Jan 2023 10:30:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC 0/3] [gdb/testsuite] Introduce is_x86_64_m64_target Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20230125200626.29340-1-tdevries@suse.de> <87v8kutiej.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87v8kutiej.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 1/25/23 22:26, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> I used a refactoring setup I wrote in python for another refactoring to > Tom> rewrite: > Tom> ... > Tom> if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { > Tom> verbose "Skipping ${testfile}." > Tom> return > Tom> } > Tom> ... > Tom> into: > Tom> ... > Tom> require is_x86_64_m64_target > Tom> ... > > Tom> It also handles the elseif case. > > Tom> Due to a recent commit, only the elseif cases are transformed, the others > Tom> have been handled already. > > If you want the existing requires could be converted to use the new > proc. Seems a little simpler. > Done. > I sent a comment to one patch but otherwise this looks good to me. > Thanks for doing it. > > FWIW I also have some refactoring scripts, but mine are > idiosyncratically written in emacs lisp, which is convenient in some > ways (easier to do multi-line edits, and back in the day I could have > them make ChangeLog entries) but worse in others (slow). I see. I love to use emacs, but I'm not familiar with lisp, so that's not an option for me :) Anyway, I don't think that the refactoring scripts I've posted here are ready for contribution, but ideally I'd love to have some refactoring tool commonly used, with the idea that it would enable not only posting the result of the transformation, put also the transformation itself, and you could get feedback on the transformation, people could try it out themselves, find cases they think could be handled in addition, post improved versions. And something in python seems not a bad choice, considering the popularity of it. FWIW, I've started out with the idea of using cocinelle for some gdb source transformation, but pretty soon found out that c++ support is missing/poor, so I abandoned that idea. Thanks, - Tom