From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20869 invoked by alias); 12 Oct 2005 17:43:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20850 invoked by uid 22791); 12 Oct 2005 17:43:25 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 12 Oct 2005 17:43:25 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EPkdP-0006tT-PB; Wed, 12 Oct 2005 13:43:23 -0400 Date: Wed, 12 Oct 2005 17:43:00 -0000 From: Daniel Jacobowitz To: Andreas Schwab Cc: gdb-patches@sources.redhat.com Subject: Re: Broken cast in linux-thread-db Message-ID: <20051012174323.GA26380@nevyn.them.org> Mail-Followup-To: Andreas Schwab , gdb-patches@sources.redhat.com References: <20051012142427.GA21308@nevyn.them.org> <20051012144130.GA21870@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00111.txt.bz2 On Wed, Oct 12, 2005 at 05:59:21PM +0200, Andreas Schwab wrote: > Daniel Jacobowitz writes: > > > Well presumably it honors POINTERS_EXTEND_UNSIGNED. > > No. > > http://gcc.gnu.org/onlinedocs/gcc/Arrays-and-pointers-implementation.html#Arrays-and-pointers-implementation Huh, fascinating. > >> If notify.u.bptaddr has the high bit set it will be sign extended, but the > >> breakpoint address when the thread event breakpoint is hit will be zero > >> extended, so they don't match and the breakpoint is not recognized. > > > > Then this will break thread debugging on MIPS, where the breakpoint > > address will be sign extended. > > Note that CORE_ADDR is always unsigned, even on MIPS. Yes. But we don't treat it that way; it contains sign extended values. > > We'll only be in linux-thread-db.c if we have enough symbols to load > > shared libraries; maybe bfd_get_sign_extend_vma (exec_bfd) and assert > > that exec_bfd is provided? > > Like this? > > 2005-10-12 Andreas Schwab > > * Makefile.in (linux-thread-db.o): Depend on $(gdbcore_h). > > * linux-thread-db.c (enable_thread_event): Extend pointer value as > specified by target. > (thread_db_get_thread_local_address): Likewise. Yes, precisely. This is OK. [I'm assuming no one's going to try to build a native gdb on a Linux system predating intptr_t. Probably a good assumption.] -- Daniel Jacobowitz CodeSourcery, LLC