From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4388 invoked by alias); 5 Aug 2015 14:35:44 -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 4377 invoked by uid 89); 5 Aug 2015 14:35:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 05 Aug 2015 14:35:41 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Aug 2015 15:35:35 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 5 Aug 2015 15:35:10 +0100 X-MailFrom: uweigand@de.ibm.com X-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id E8F9F2190056 for ; Wed, 5 Aug 2015 15:34:44 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t75EZ9l936765942 for ; Wed, 5 Aug 2015 14:35:09 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t75EZ9eC003479 for ; Wed, 5 Aug 2015 08:35:09 -0600 Received: from oc7340732750.ibm.com (icon-9-167-246-65.megacenter.de.ibm.com [9.167.246.65]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t75EZ8gu003465; Wed, 5 Aug 2015 08:35:09 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 206EB22DD; Wed, 5 Aug 2015 16:35:08 +0200 (CEST) Subject: Re: [PATCH v2] C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c To: palves@redhat.com (Pedro Alves) Date: Wed, 05 Aug 2015 14:35:00 -0000 From: "Ulrich Weigand" Cc: dje@google.com (Doug Evans), gdb-patches@sourceware.org (gdb-patches) In-Reply-To: <55C214E7.6090506@redhat.com> from "Pedro Alves" at Aug 05, 2015 02:51:35 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20150805143508.206EB22DD@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15080514-0021-0000-0000-000004D826BD X-SW-Source: 2015-08/txt/msg00112.txt.bz2 Pedro Alves wrote: > On 08/05/2015 02:34 PM, Ulrich Weigand wrote: > > It seems this is caused by the nat/gdb_thread_db.h header file > > being included twice into gdbserver/thread-db.c: > > > > 1) via line 23: > > #include "linux-low.h" > > (which includes "nat/gdb_thread_db.h" at line 20) > > > > 2) directly in line 30: > > #include "nat/gdb_thread_db.h" > > > > and the file not being guarded against double inclusion. > > Yeah, I think we should just add the guards. > > Are you already taking care of that, or would you like me to? I've now checked in the patch below. (Also adding the missing copyright header while I was at it.) Tested on i686-linux. Bye, Ulrich ChangeLog: * nat/gdb_thread_db.h: Add copyright header. Protect against multiple inclusion. diff --git a/gdb/nat/gdb_thread_db.h b/gdb/nat/gdb_thread_db.h index 2938eaf..3be4170 100644 --- a/gdb/nat/gdb_thread_db.h +++ b/gdb/nat/gdb_thread_db.h @@ -1,3 +1,23 @@ +/* Copyright (C) 2000-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef GDB_THREAD_DB_H +#define GDB_THREAD_DB_H 1 + #ifdef HAVE_THREAD_DB_H #include #else @@ -52,3 +72,5 @@ typedef td_err_e (td_thr_tlsbase_ftype) (const td_thrhandle_t *th, typedef const char ** (td_symbol_list_ftype) (void); typedef td_err_e (td_ta_delete_ftype) (td_thragent_t *); + +#endif /* GDB_THREAD_DB_H */ -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com