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: [PATCH] Use `unsigned long' for Linux/x86 debug registers


   Date: Sun, 1 Apr 2001 13:04:44 +0200 (IST)
   From: Eli Zaretskii <eliz@is.elta.co.il>

   On Sun, 1 Apr 2001, Mark Kettenis wrote:

   > It just occurred to me that Linux/x86 should really be using `unsigned
   > long' instead of `long' as the type for debug register values.

   They should indeed be unsigned, but why `unsigned long' instead of 
   `unsigned int'?  i386-nat.c uses the latter, and ia32 debug registers
   are 32-bit wide.

Well an `unsigned int' *might* be 16-bits, wheras ISO C guarantees
that `unsigned long' is at least 32-bits.  All that matters, is that
the variables that we use to store ia32 debug registers are at least
32-bit wide.  I was planning on changing i386-nat.c to use `unsigned
long' in the relevant places.  This all doesn't really matter for
native stuff, but if we ever move this code to i386-tdep.c it might
matter.  Better fix it now than be sorry later :-).

Mark


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