This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Broken cast in linux-thread-db


On Wed, Oct 12, 2005 at 05:59:21PM +0200, Andreas Schwab wrote:
> Daniel Jacobowitz <drow@false.org> 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  <schwab@suse.de>
> 
> 	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]