This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Re: New method to get real length of register
- From: Tim Moore <timoore at redhat dot com>
- To: frysk <frysk at sourceware dot org>
- Date: Wed, 23 Aug 2006 22:00:08 +0200
- Subject: Re: New method to get real length of register
- References: <20060823100418.GA18719@GreenHouse.cn.ibm.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yao Qi wrote:
> Register.getLength() now is not always equal to the real length of
> that register.
>
> On Ia32, segment register is 16-bit, instead of 32-bit.
> On X86-64, fs, gs, and ss are 16-bit, instead of 64-bit.
> On PPC64, xer and ccr are 32-bit, instead of 64-bit.
>
> On 64-bit platforms(X86-64 and PPC64), linux kernel assumes these
> registers as all 64-bit in order to simplify implementation(correct me
> if I am wrong). However, frysk should present the real length of the
> registers to the users. For example, in RegisterWindow, the real
> length of register could be presented if we add "0" as prefix..
> "0x0037" is better than "0x37", since it could tell user that this
> register is 16-bit, and this would be more clear to display some flag
> registers or condition register.
>
> A new method getRealLength is added in Register, and mostly it is the
> same as getLength, and getRealLength is overridden if they are
> different.
Right now I can't think of a reason why getLength() shouldn't return the
real length of the register. There isn't any requirement that the
registers that are read and written be some fixed length;
PtraceByteBuffer handles those details. It was just laziness (and
reading the header files) that caused all those segment registers to not
be they're proper lengths.
Tim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFE7LPHeDhWHdXrDRURAlnXAJ9NNldklOfgHEMMAKdg0FNklMku/QCgso9o
kzyIq0u2VnwNNXDGuA40rdA=
=wQ00
-----END PGP SIGNATURE-----