This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: gdb 5.0: solib.c (LM_ADDR) should be signed, not unsigned


Andrew Cagney wrote:
> 
> Michael Snyder wrote:
> 
> > > > -#define LM_ADDR(so) (SOLIB_EXTRACT_ADDRESS ((so) -> lm.l_addr))
> > > > +#define LM_ADDR(so) (SOLIB_EXTRACT_SIGNED_ADDRESS ((so) -> lm.l_addr))
> > > >  #define LM_NEXT(so) (SOLIB_EXTRACT_ADDRESS ((so) -> lm.l_next))
> > > >  #define LM_NAME(so) (SOLIB_EXTRACT_ADDRESS ((so) -> lm.l_name))
> > > >  /* Test for first link map entry; first entry is the exec-file. */
> > >
> > > I don't think this is right.  I think it would sign extend that address
> > > for all targets - wrong in 99% of cases.
> >
> > By the way, I will shortly be submitting changes that
> > make all these macros into functions.  Should I do it
> > sooner rather than later?  Will that help at all?
> 
> Yes please.
> It won't help Maciej's problem though.  It looks to be a real bug - I
> can't confirm or deny it (JimB?) as I don't have an ELF spec lying
> around.

Well, at least it might make it easier to debug!  ;-)

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