From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id 47E1B383E830 for ; Sun, 10 May 2020 21:36:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47E1B383E830 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id A0F1D2B7F98; Sun, 10 May 2020 17:36:39 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id b6A4Q_OuUKIj; Sun, 10 May 2020 17:36:39 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 3D3E92B7F95; Sun, 10 May 2020 17:36:39 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 3D3E92B7F95 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id raXdxkj3LYTe; Sun, 10 May 2020 17:36:39 -0400 (EDT) Received: from [10.0.0.193] (unknown [192.222.164.54]) by mail.efficios.com (Postfix) with ESMTPSA id 123072B7E9F; Sun, 10 May 2020 17:36:39 -0400 (EDT) Subject: Re: [PATCH 0/7] Make gdbarch.sh shellcheck-clean To: Pedro Alves , Tom Tromey , Simon Marchi via Gdb-patches References: <20200428214655.3255454-1-simon.marchi@efficios.com> <878sie57an.fsf@tromey.com> <94e06111-2801-644f-3906-7c622d1ec611@redhat.com> From: Simon Marchi Message-ID: Date: Sun, 10 May 2020 17:36:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <94e06111-2801-644f-3906-7c622d1ec611@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 21:36:42 -0000 On 2020-05-10 2:57 p.m., Pedro Alves wrote: > On 4/29/20 10:08 PM, Tom Tromey wrote: >>>>>>> "Simon" == Simon Marchi via Gdb-patches writes: >> >> Simon> I ran shellcheck on gdbarch.sh and addressed all the warnings. It >> Simon> didn't catch anything serious, but I think it's good to have it clean >> Simon> anyway, so we can catch potential problems in future changes we do to >> Simon> this file. >> >> These all seemed fine to me. >> >> I'd like to see gdbarch.sh eventually go away entirely. >> Most of it could be ordinary C++ code. I don't have a concrete plan for >> this though. Mostly I've been reluctant to do it due to the amount of >> reindentation that will probably be involved, though I guess maybe I >> could write an emacs lisp script to handle this. > > My main gripe with gdbarch.sh is that the function/variable/method definitions > and the generator code is all in the same file. > > If those were split to separate files, like, the definitions inside function_list() > were moved to a separate gdbarch.def file, which would be read by gdbarch.sh, > that'd already be a large win, IMHO. If I was to do it from scratch, I'd do the definitions in a yaml file with a python script as the generator. If you would be fine with that, I'd be happy to try it as a weekend project. I just never proposed it because I thought people were happy with what we currently have and wouldn't welcome changing something for the sake of changing it :). > Also, I would like it to be able to generate the gdbarch.h/c files in place, > instead of generating new "new-gdbarch.h/c" files. Same here. I never thought about that before, but it probably comes from the pre-git era, where it would have been more difficult to compare the before and after if the file was written in place? Simon