This is the mail archive of the mailing list for the frysk project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New method to get real length of register

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.


Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Fedora -


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