From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52872 invoked by alias); 16 Dec 2018 19:08:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 52851 invoked by uid 89); 16 Dec 2018 19:08:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:ISO-8859-1, avoided X-HELO: mail-lj1-f194.google.com Received: from mail-lj1-f194.google.com (HELO mail-lj1-f194.google.com) (209.85.208.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Dec 2018 19:08:12 +0000 Received: by mail-lj1-f194.google.com with SMTP id g11-v6so9094606ljk.3 for ; Sun, 16 Dec 2018 11:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to:references :organization:user-agent:mime-version:content-transfer-encoding; bh=dM8yCEmaIyERnPZg94rEwmFj5L8j/1aTzd2qlunVrEw=; b=cbIQF9MMxALUllcpHoqz8lkUiefU6kV4fqGplA8J5p+Oy+JtAjLGgk7MupPQNhDfxE /QO/Dzkji67k/fNP1rplNt1Nz6FeVxjDweWv3WSbXMsPEMBx4Ff5Q1lPhvdMd1f8rjNN OdftZyw4MmgVW35EayCXRHxVgncjFlCp8RQqF6sdovu05dqSGTzbToNB2gvEwb3zm7cI D7fHmyY0NPtuz7onKc+UmA3gsD6vOChtXltYi6x8Ysr73QioViuqvNGcmmIpbHC6zj+N nUK13wJBKR/Dw2okHB0B5KhChDY7CKZHP1OxkhtKaDwffxAvQNjagYIUu6zNIXu0nIh5 WZFA== Return-Path: Received: from G3620.lan (178-78-231-178.customers.ownit.se. [178.78.231.178]) by smtp.gmail.com with ESMTPSA id b25sm2155928lfa.96.2018.12.16.11.08.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Dec 2018 11:08:10 -0800 (PST) Message-ID: <000db1d81a0c415190b6648222ed29db7f927df9.camel@gmail.com> Subject: Re: [PATCH] Please define thread_info as struct thread_info (and other stuff) From: Svante Signell Reply-To: svante.signell@gmail.com To: Andreas Schwab , Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org Date: Sun, 16 Dec 2018 19:08:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.0-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-12/txt/msg00191.txt.bz2 On Sun, 2018-12-16 at 10:20 +0100, Andreas Schwab wrote: > On Dez 15 2018, Svante Signell wrote: > > Try adding a forward declaration of struct thead_info. Note that > config/i386/nm-i386gnu.h includes "regcache.h", making it unique among > the nm.h files. >From what I've leraned forward declarations is bad coding, an should be avoided as much as possible. Right or wrong? Furthermore, not defining thread_info as struct everywhere is in my opinion very lazy coding. Another issue is to compile C-code (and C++-code) in *.c files. Please rename these to *.cpp (and eventually the header files to *.hpp)! As it is now it is very confusing. Finally, I've found the problem (but no workaround yet): thread_info is an RPC on GNU/Hurs, and including mach.h in gdb/config/i386/nm-i386gnu.h:#include further includes which has the conflicting name of that RPC: kern_return_t thread_info ( mach_port_t target_thread, int flavor, thread_info_t thread_info_out, mach_msg_type_number_t *thread_info_outCnt ); Please reconsider your coding stype for gdb. Thanks!