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 04:33:27PM +0200, Andreas Schwab wrote:
> Daniel Jacobowitz <drow@false.org> writes:
> 
> > I think the current behavior is actually more correct despite any
> > warning.
> 
> GCC _always_ sign extends, which is definitely wrong here.

Well presumably it honors POINTERS_EXTEND_UNSIGNED.

> >  Were you fixing an observed problem?
> 
> 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.  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?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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