From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qCP8Mjl8N2EJNwAAWB0awg (envelope-from ) for ; Tue, 07 Sep 2021 10:50:33 -0400 Received: by simark.ca (Postfix, from userid 112) id CC3221EE22; Tue, 7 Sep 2021 10:50:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2F3C81EDF0 for ; Tue, 7 Sep 2021 10:50:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A19B9385383F for ; Tue, 7 Sep 2021 14:50:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A19B9385383F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631026231; bh=poCW3OWXqkLwrN/Y61wqqQGlTOCiA8zaAUMgNrXQWc0=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=jO2qRC55MUqRiD+lLIjRI9TaB/d5fv60lrkl/VSWP1AvNbdkH/HeQ98cNY9dPjct+ I8HU1KHlWGcpjXu0e8ioyTV7fBW64RXGWGJRYQLSKvA3wfw8dg98fgMRrr2eAQWwoJ aCG0nNify/m2bH2uxTJX01/yau7qoKEfoVOHn2hg= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id F01D83858D34 for ; Tue, 7 Sep 2021 14:50:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F01D83858D34 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 0F6E62007C; Tue, 7 Sep 2021 14:50:10 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id E777213A45; Tue, 7 Sep 2021 14:50:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id nti/NiF8N2EdEQAAGKfGzw (envelope-from ); Tue, 07 Sep 2021 14:50:09 +0000 Date: Tue, 7 Sep 2021 16:50:08 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/build] Fix build with undefined CXX_STD_THREAD Message-ID: <20210907145006.GA4878@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When building gdb on openSUSE Leap 42.3, we trigger the case that CXX_STD_THREAD is undefined, and run into: ... gdb/maint.c: In function ‘void maintenance_show_worker_threads \ (ui_file*, int, cmd_list_element*, const char*)’: gdb/maint.c:877:14: error: ‘gdb::thread_pool’ has not been declared gdb::thread_pool::g_thread_pool->thread_count ()); ^ Makefile:1647: recipe for target 'maint.o' failed make[1]: *** [maint.o] Error 1 ... Fix this by handling the undefined CXX_STD_THREAD case in maintenance_show_worker_threads, such that we get: ... $ gdb -q -batch -ex "maint show worker-thread" The number of worker threads GDB can use is 0. ... Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/build] Fix build with undefined CXX_STD_THREAD --- gdb/maint.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/maint.c b/gdb/maint.c index cbd7d4ed47b..56a197c2a14 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -871,6 +871,7 @@ maintenance_show_worker_threads (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { +#if CXX_STD_THREAD if (n_worker_threads == -1) fprintf_filtered (file, _("The number of worker threads GDB " "can use is unlimited (currently %zu).\n"), @@ -879,6 +880,10 @@ maintenance_show_worker_threads (struct ui_file *file, int from_tty, fprintf_filtered (file, _("The number of worker threads GDB " "can use is %d.\n"), n_worker_threads); +#else + fprintf_filtered (file, _("The number of worker threads GDB " + "can use is 0.\n")); +#endif }