public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: mark@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Setup pc value for LinuxExeTask.
Date: Fri, 23 Nov 2007 11:35:00 -0000	[thread overview]
Message-ID: <20071123113516.1351.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  177953c49c7e94a7f24d81806782dbc005ca617d (commit)
      from  0a57bd86cdd2366aeadf6833c871331ba0c9ae41 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 177953c49c7e94a7f24d81806782dbc005ca617d
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Fri Nov 23 12:35:04 2007 +0100

    Setup pc value for LinuxExeTask.
    
    2007-11-23  Mark Wielaard  <mwielaard@redhat.com>
    
            * LinuxExeTask.java (bankBuffers): New final field.
            (LinuxExeTask): Setup bankBuffers and explicitly set pc.
            (sendrecRegisterBanks): Use cached bankBuffers.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/proc/dead/ChangeLog         |    6 +++++
 frysk-core/frysk/proc/dead/LinuxExeTask.java |   29 +++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
index b34d397..63adddf 100644
--- a/frysk-core/frysk/proc/dead/ChangeLog
+++ b/frysk-core/frysk/proc/dead/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-23  Mark Wielaard  <mwielaard@redhat.com>
+
+	* LinuxExeTask.java (bankBuffers): New final field.
+	(LinuxExeTask): Setup bankBuffers and explicitly set pc.
+	(sendrecRegisterBanks): Use cached bankBuffers.
+
 2007-11-19  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* TestLinuxCore.java (testInsertedBreakpoint): Pass executable
diff --git a/frysk-core/frysk/proc/dead/LinuxExeTask.java b/frysk-core/frysk/proc/dead/LinuxExeTask.java
index 3eb584c..1302be5 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeTask.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeTask.java
@@ -47,17 +47,44 @@ import frysk.proc.TaskId;
 import frysk.proc.TaskState;
 import frysk.isa.ISA;
 
+import lib.dwfl.*;
 
 public class LinuxExeTask extends DeadTask
 {
 
   LinuxExeProc proc = null;
   TaskId id = null;
+
+  // Holds all the register values, setup once in the constructor.
+  private final ByteBuffer[] bankBuffers;
   
   protected LinuxExeTask(LinuxExeProc proc, TaskId id, TaskState state) {
       super(proc, id, state);
       this.proc = proc;
       this.id = id;
+      this.bankBuffers = sendrecRegisterBuffersFIXME();
+
+      // Fake PC.  XXX should be done in Proc instead of creating Elf
+      // object in the Task itself.
+      long pc;
+      Elf e = null;
+      try
+	{
+	  e = new Elf(getProc().getExe(), ElfCommand.ELF_C_READ);
+	  ElfEHeader h = e.getEHeader();
+	  pc = h.entry;
+	}
+      catch (ElfException ee)
+	{
+	  // Nice try, just give up.
+	  pc = 0;
+	}
+      finally
+	{
+	  if (e != null)
+	    e.close();
+	}
+      getIsa().setPC(this, pc);
   }
   
   protected ISA sendrecISA() {
@@ -93,6 +120,6 @@ public class LinuxExeTask extends DeadTask
 
   protected RegisterBanks sendrecRegisterBanks() {
       return CorefileRegisterBanksFactory.create
-      	  (getISA(), sendrecRegisterBuffersFIXME());
+      	  (getISA(), bankBuffers);
   }
 }


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2007-11-23 11:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071123113516.1351.qmail@sourceware.org \
    --to=mark@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --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).