From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QFH2BvHYCGNwni0AWB0awg (envelope-from ) for ; Fri, 26 Aug 2022 10:30:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 0FF0D1E4A7; Fri, 26 Aug 2022 10:30:09 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JeEW1AUR; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id AFF581E222 for ; Fri, 26 Aug 2022 10:30:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2EA223857028 for ; Fri, 26 Aug 2022 14:30:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EA223857028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661524202; bh=RqeiLAOKo/uruOCkFSHXsJc6RSIhZ+6ItuqJBq5p4Ys=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JeEW1AURNXayGbJ2QzICxlld/SXjhoGsqHycCohvVYBivQ7K5Ndlh2A1faJCB0AHz DNgJaaVz1dckdaDhQ8xmdbNCN2CdTxritzICNQmS0HQFEeMPT+GrWks2jMLsiP/CwS LASL5grwjKT/kSkz/itTGqCYg/J5OLYYHkB54+rw= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 8F3833858403 for ; Fri, 26 Aug 2022 14:29:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F3833858403 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 27QETR2t015375 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 10:29:31 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 27QETR2t015375 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A58FA1E222; Fri, 26 Aug 2022 10:29:26 -0400 (EDT) Message-ID: Date: Fri, 26 Aug 2022 10:29:26 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] gdb, gdbsupport: configure: factor out yes/no/auto value checking Content-Language: en-US To: Tom Tromey , Simon Marchi via Gdb-patches References: <20220817175341.1594352-1-simon.marchi@polymtl.ca> <87zgfubwh6.fsf@tromey.com> In-Reply-To: <87zgfubwh6.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 26 Aug 2022 14:29:27 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-08-23 15:17, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> From: Simon Marchi > Simon> Factor out the code that checks that a value is yes/no or yes/no/auto. > Simon> Add two macros to gdbsupport/common.m4 and use them in gdb/configure.ac > > Simon> I inspected the changes to configure. Other than whitespace changes, we > Simon> have some benign changes to the error messages (one of them had an error > Simon> actually). There are changes to the --enable-source-highlight and > Simon> --enable-libbacktrace handling, but setting enable_source_highlight / > Simon> enable_libbacktrace was not really useful anyway, they already had the > Simon> right value. > > This looks reasonable to me. Ok. > Simon> +AC_ARG_ENABLE([gdbmi], > > I was very surprised to learn today that this really can be disabled. I don't really know why that is useful. There is no dependency on any external library, so there's no disadvantage (other than a bit of space saving) of having it enabled. The only real-world usage I could find is in an ancient Builroot version, but it was removed here in 2007: https://github.com/buildroot/buildroot/commit/8759a416c41f8eec02fdb5594275961534ae0c8e#diff-1ba8fa6a02f11bff1ad45de1341ee93aee241a6281298da9ad9721d38246fc91 I just tried a local build with --disable-gdbmi (which has Python implicitly enabled), and I get: /usr/bin/ld: python/py-micmd.o: in function `mi_command_py::invoke(mi_parse*) const': /home/simark/src/binutils-gdb/gdb/python/py-micmd.c:343: undefined reference to `mi_parse_argv(char const*, mi_parse*)' So this new "MI commands in Python feature" should be dependent on whether MI is enabled. But I would also support removing the --disable-gdbmi switch, that would be simpler. > Simon> -AC_ARG_ENABLE(source-highlight, > Simon> - AS_HELP_STRING([--enable-source-highlight], > Simon> - [enable source-highlight for source listings]), > Simon> - [case "${enableval}" in > Simon> - yes) enable_source_highlight=yes ;; > Simon> - no) enable_source_highlight=no ;; > Simon> - *) AC_MSG_ERROR(bad value ${enableval} for source-highlight option) ;; > Simon> -esac], > Simon> -[enable_source_highlight=auto]) > Simon> +AC_ARG_ENABLE([source-highlight], > Simon> + [AS_HELP_STRING([--enable-source-highlight], > Simon> + [enable source-highlight for source listings])], > Simon> + [GDB_CHECK_YES_NO_VAL([$enableval], [--enable-source-highlight])], > Simon> + [enable_source_highlight=auto]) > > This defaults to 'auto' but, weirdly, doesn't let one explicitly specify > 'auto'. I wonder if switching it to GDB_CHECK_YES_NO_AUTO_VAL would be > an improvement. I think that makes sense, I did the change. I will push the patch with that fixed. Thanks, Simon