From patchwork Thu May 16 16:47:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32720 Received: (qmail 8507 invoked by alias); 16 May 2019 16:47:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8499 invoked by uid 89); 16 May 2019 16:47:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1372, Marshall, marshall, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 May 2019 16:47:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 736D7117A32; Thu, 16 May 2019 12:47:23 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SlrJS4aPgI9M; Thu, 16 May 2019 12:47:23 -0400 (EDT) Received: from murgatroyd.Home (71-218-69-43.hlrn.qwest.net [71.218.69.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 1C90D117A30; Thu, 16 May 2019 12:47:23 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Fix darwin-nat.c build Date: Thu, 16 May 2019 10:47:21 -0600 Message-Id: <20190516164721.21127-1-tromey@adacore.com> MIME-Version: 1.0 John Marshall pointed out that darwin-nat.c fails to build: CXX darwin-nat.o ../../../binutils-gdb/gdb/darwin-nat.c:1709:8: error: must use 'class' tag to refer to type 'thread_info' in this scope for (thread_info *it : all_threads ()) /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/thread_act.h:240:15: note: class 'thread_info' is hidden by a non-type declaration of 'thread_info' here kern_return_t thread_info Mach has a thread_info() function declared in that header, which darwin-nat.c #includes. This patch fixes the problem by reintroducing the struct keyword. gdb/ChangeLog 2019-05-16 Tom Tromey * darwin-nat.c (thread_info_from_private_thread_info): Add struct keyword to foreach. --- gdb/ChangeLog | 5 +++++ gdb/darwin-nat.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index e3368ce6471..8282ef27e61 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1706,7 +1706,7 @@ darwin_attach_pid (struct inferior *inf) static struct thread_info * thread_info_from_private_thread_info (darwin_thread_info *pti) { - for (thread_info *it : all_threads ()) + for (struct thread_info *it : all_threads ()) { darwin_thread_info *iter_pti = get_darwin_thread_info (it);