From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22049 invoked by alias); 16 Apr 2013 18:31:22 -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 22033 invoked by uid 89); 16 Apr 2013 18:31:22 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 16 Apr 2013 18:31:21 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GIVK9R012117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 14:31:20 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3GIVJI9029510 for ; Tue, 16 Apr 2013 14:31:19 -0400 Subject: [PATCH 5/6] Fix remaining GDBserver issues with !HAVE_THREAD_DB_H. To: gdb-patches@sourceware.org From: Pedro Alves Date: Wed, 17 Apr 2013 02:54:00 -0000 Message-ID: <20130416183118.540.36291.stgit@brno.lan> In-Reply-To: <20130416183043.540.32214.stgit@brno.lan> References: <20130416183043.540.32214.stgit@brno.lan> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-04/txt/msg00504.txt.bz2 The previous patches are still not sufficient to build gdbserver with our copy of thread_db.h. ../../../src/gdb/gdbserver/thread-db.c: In function ‘find_one_thread’: ../../../src/gdb/gdbserver/thread-db.c:316:6: error: ‘struct lwp_info’ has no member named ‘th’ ../../../src/gdb/gdbserver/thread-db.c: In function ‘attach_thread’: ../../../src/gdb/gdbserver/thread-db.c:341:6: error: ‘struct lwp_info’ has no member named ‘th’ ../../../src/gdb/gdbserver/thread-db.c: In function ‘thread_db_get_tls_address’: ../../../src/gdb/gdbserver/thread-db.c:514:47: error: ‘struct lwp_info’ has no member named ‘th’ make: *** [thread-db.o] Error 1 First, linux-low.h is including directly instead of our gdb_thread_db.h, although thread-db.c includes the latter. Then the 'th' field of struct lwp_info is only defined if HAVE_THREAD_DB_H is defined, which is not true if we're using our replacement copy of thread_db.h. We have a USE_THREAD_DB symbol defined if we're building thread-db.c that's ideal for this, however, it's currently only defined when compiling linux-low.c (through a Makefile rule). The patch makes it defined when compiling any file. gdb/gdbserver/ 2013-04-16 Pedro Alves * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@. (linux-low.o): Delete rule. * linux-low.h: Always include "gdb_thread_db.h" instead of conditionally including thread_db.h. (struct lwp_info) : Guard with #ifdef USE_THREAD_DB instead of HAVE_THREAD_DB_H. --- gdb/gdbserver/Makefile.in | 8 ++------ gdb/gdbserver/linux-low.h | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 6c3d7bd..a2281cb 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -123,7 +123,8 @@ CFLAGS = @CFLAGS@ INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) -INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER +INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) \ + @USE_THREAD_DB@ -DGDBSERVER # LDFLAGS is specifically reserved for setting from the command line # when running make. @@ -559,11 +560,6 @@ vsnprintf.o: $(srcdir)/../../libiberty/vsnprintf.c $(POSTCOMPILE) i386_low_h = $(srcdir)/i386-low.h - -linux-low.o: linux-low.c - $(COMPILE) $< @USE_THREAD_DB@ - $(POSTCOMPILE) - win32_low_h = $(srcdir)/win32-low.h aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh) diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index 27dd3b5..834dd91 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -16,9 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef HAVE_THREAD_DB_H -#include -#endif +#include "gdb_thread_db.h" #include #include "gdbthread.h" @@ -270,7 +268,7 @@ struct lwp_info int need_step_over; int thread_known; -#ifdef HAVE_THREAD_DB_H +#ifdef USE_THREAD_DB /* The thread handle, used for e.g. TLS access. Only valid if THREAD_KNOWN is set. */ td_thrhandle_t th;