From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8682 invoked by alias); 23 Mar 2007 22:22:17 -0000 Received: (qmail 8672 invoked by uid 22791); 23 Mar 2007 22:22:16 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,TW_EB X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 23 Mar 2007 22:22:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l2NMMA6l004620 for ; Fri, 23 Mar 2007 18:22:10 -0400 Received: from pobox.hsv.redhat.com (pobox.hsv.redhat.com [172.16.16.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l2NMM9B5001473 for ; Fri, 23 Mar 2007 18:22:10 -0400 Received: from [10.11.14.36] (vpn-14-36.rdu.redhat.com [10.11.14.36]) by pobox.hsv.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l2NMM8vD032296 for ; Fri, 23 Mar 2007 18:22:08 -0400 Message-ID: <4604530F.3010204@redhat.com> Date: Fri, 23 Mar 2007 22:22:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: frysk@sourceware.org Subject: Corefile Host was (Re: frysk-core/frysk/proc IsaFactory.java TestIsa.) References: <20070323212539.20974.qmail@sourceware.org> In-Reply-To: <20070323212539.20974.qmail@sourceware.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00265.txt.bz2 I've checked in an initial first base of Corefile analysis code. A lot of this code is built on top of the considerable Frysk Java Elf bindings work that I and others have worked on for several months. It's good to finally see daylight ;) The next task is to write an arbitary get(memory address) -> (translation) -> read from core file wrapper. Corefile host/proc/tasks extend the abstract host/core/task pattern that Frysk is built on, and access is achieved through these interfaces. This allows us to "slot in" a LinuxCoreFileTask in many places without modification to the code-base (like unwinding and source view) where a LinuxPtraceTask would have been used before. Access to a core file via api is simple and is illustrated in several ways via the test classes, also checked in with this code. But to illustrate briefly: Host coreHost = new LinuxCoreFileHost(Manager.eventLoop,File("your-core-file")); {Run event loop} Access to that corefile's procs/tasks is via the normal ways, via observers, finders or simply like: Proc proc = coreHost.getProc(new ProcId(31497)); getting the main task something like: Task task = proc.getMainTask(); and as usual all tasks via the getTasks() interface. to look at a corefile task's registers you might do something like Isa isa = task.getIsa(); long ebx = isa.getRegisterByName("ebx").get(task)) All of these interfaces are exactly the same as live ptrace procs. Regards Phil pmuldoon@sourceware.org wrote: > CVSROOT: /cvs/frysk > Module name: frysk-core > Changes by: pmuldoon@sourceware.org 2007-03-23 21:25:39 > > Modified files: > frysk/proc : IsaFactory.java TestIsa.java ChangeLog > Added files: > frysk/proc : LinuxCoreFileHost.java > LinuxCoreFileHostState.java > LinuxCoreFileProc.java > LinuxCoreFileProcState.java > LinuxCoreFileTask.java > LinuxCoreFileTaskState.java TestLinuxCore.java > > Log message: > 2007-03-23 Phil Muldoon > > * TestLinuxCore.java: New. > * LinuxCoreFileTaskState.java: New. > * LinuxCoreFileTask.java:New. > * LinuxCoreFileHostState.java: New. > * LinuxCoreFileHost.java:New. > * LinuxCoreFileProcState.java: New. > * LinuxCoreFileProc.java: New. > > * TestIsa.java: Changed to call getIsaForCoreFile. > * IsaFactory.java (getIsaByElfType): Renamed to > getIsaForCoreFile. Also, modified to always return > the architecture of the core file, regardless of > 32on64 ISA situations. > > Patches: > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileHost.java.diff?cvsroot=frysk&r1=1.1&r2=1.2 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileHostState.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileProc.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileProcState.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileTask.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxCoreFileTaskState.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/TestLinuxCore.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/IsaFactory.java.diff?cvsroot=frysk&r1=1.15&r2=1.16 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/TestIsa.java.diff?cvsroot=frysk&r1=1.11&r2=1.12 > http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/ChangeLog.diff?cvsroot=frysk&r1=1.641&r2=1.642 > >