This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Use `unsigned long' for Linux/x86 debug registers
- To: eliz at is dot elta dot co dot il
- Subject: Re: [PATCH] Use `unsigned long' for Linux/x86 debug registers
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Sun, 1 Apr 2001 16:10:35 +0200
- CC: gdb-patches at sources dot redhat dot com
- References: <Pine.SUN.3.91.1010401130258.17003B@is>
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