This is the mail archive of the 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: Severe regression in corefile.exp with Solaris 2.7 sparc + hack

On Tue, Mar 07, 2000 at 10:36:56PM -0500, Jim Kingdon wrote:
> > Of the two choices, I prefer manually anding with 0xffffffff.  The
> > cast that you suggest will only yield the desired results when
> > sizeof(void *) == sizeof(size_t).
> Shrug.  Various provisions of ISO C make it pretty darn likely that
> sizeof(void *) == sizeof(size_t).  But you're right, it isn't a
> guarantee (and would be ugly even if it were).

Wrong.  In fact at the time of the 1990 standard was written there were several
vendors in the DOS world who participated in the standards process and who had
compilers that had 32-bit pointers and size_t was only 16 bits for some of
their options.  It was desirable to have size_t be 16 bits, because it made
adding/comparing/etc. segmented pointers so much easier, especially considering
the intel segmented format for pointers.

> > I think there must be a better solution than the one that Peter
> > proposes.  However, I don't know what it is either.
> Something like "extract_address (&lm->field, sizeof (lm->field))" I
> think.  I didn't suggest that at first because I thought it would
> require massive solib.c changes to use separate internal and external
> structures like in BFD.  But I guess that isn't true, I guess you can
> just change the cast to a call to extract_address.

Michael Meissner, Cygnus Solutions, a Red Hat company.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:		phone: +1 978-486-9304
Non-work:	fax:   +1 978-692-4482

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