This is the mail archive of the
mailing list for the frysk project.
Re: proposed refactoring of LinuxIA32
- From: Yao Qi <qiyaoltc at cn dot ibm dot com>
- To: frysk at sourceware dot org
- Date: Mon, 10 Jul 2006 10:12:06 +0800
- Subject: Re: proposed refactoring of LinuxIA32
- References: <44ABFBDD.firstname.lastname@example.org>
On Wed, Jul 05, 2006 at 07:50:21PM +0200, Tim Moore wrote:
> I've started looking at supporting x86_64 in frysk. To that end I
> propose refactoring Isa, LinuxIA32 and friends. I've turned Isa into an
> interface implemented by IsaIA32 and IsaEMT64. There's also a new
> interface, SyscallEventDecoder, that just returns a SyscallEventInfo
> object. Then e.g., LinuxIA32 extends IsaIA32 and implements
> SyscallEventDecoder. Comments welcome on this code...
Sorry for delayed reply!
The code looks good to me, and there is two points I want discuss
1) In your code, you refactor Isa as an interface, and IsaIA32, IsaEMT64
implement it, Isa could not be instantiated, but instance of Isa is
needed in Task and LinuxTask, so it is better to refactor Isa as
an super class, and IsaIA32, IsaEMT64 inherit it. Task and LinuxTask
could get registers, byte orders via isa without concerning what exactly
2) Assuming IsaIA32, IsaEMT64 work OK, the next problem is which class
among the set of subclasses(IsaIA32, IsaEMT64, etc.) of the parent
class(Isa) is to be selected, and what is the criteria to select.
IMO, it is reasonable and flexible to read ELF headers of
/proc/<pid>/exe as the criteria to select sub class, and I coded a
Class named IsaFactory, get e_machine from ELF header as the criteria.
Some other discussions about this issues could be found
Any comments are welcome!