From: Phil Muldoon <pmuldoon@redhat.com>
To: frysk@sourceware.org
Subject: Corefile Host was (Re: frysk-core/frysk/proc IsaFactory.java TestIsa.)
Date: Fri, 23 Mar 2007 22:22:00 -0000 [thread overview]
Message-ID: <4604530F.3010204@redhat.com> (raw)
In-Reply-To: <20070323212539.20974.qmail@sourceware.org>
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 <pmuldoon@redjat.com>
>
> * 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
>
>
parent reply other threads:[~2007-03-23 22:22 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20070323212539.20974.qmail@sourceware.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4604530F.3010204@redhat.com \
--to=pmuldoon@redhat.com \
--cc=frysk@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).