public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Setup pc value for LinuxExeTask.
@ 2007-11-23 11:35 mark
  0 siblings, 0 replies; only message in thread
From: mark @ 2007-11-23 11:35 UTC (permalink / raw)
  To: frysk-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-23 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23 11:35 [SCM] master: Setup pc value for LinuxExeTask mark

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).