public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Push Task.getPC and .setPC into sub-classes.
@ 2008-01-07 19:19 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-01-07 19:19 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  9374e6ea92b30da95ee42d8629d29dbd92d01845 (commit)
       via  754d4128c90e6bafe92edea5e2892171b7ff40b0 (commit)
       via  1bd94332df2ccb598ea45f56ab37e8b8d863fd63 (commit)
      from  ac4b57f756a833b51959b089b0c3cb685fe68fcd (commit)

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

- Log -----------------------------------------------------------------
commit 9374e6ea92b30da95ee42d8629d29dbd92d01845
Author: Andrew Cagney <cagney@redhat.com>
Date:   Mon Jan 7 14:03:30 2008 -0500

    Push Task.getPC and .setPC into sub-classes.
    
    frysk-core/frysk/proc/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* Task.java (setPC(long), getPC()): Make abstract.
    	(pcRegister, pcRegister()): Delete.
    
    frysk-core/frysk/proc/dead/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxCoreTask.java (getPC()): New.
    	* LinuxExeTask.java (getPC()): New.
    	* DeadTask.java (setPC(long)): New.
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxPtraceTask.java (setPC(long), getPC()): New.
    	(pcRegister, pcRegister()): New.

commit 754d4128c90e6bafe92edea5e2892171b7ff40b0
Author: Andrew Cagney <cagney@redhat.com>
Date:   Mon Jan 7 13:43:32 2008 -0500

    Add LinuxPtraceTask.clearIsa().
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxPtraceTask.java (clearIsa()): New.

commit 1bd94332df2ccb598ea45f56ab37e8b8d863fd63
Author: Andrew Cagney <cagney@redhat.com>
Date:   Mon Jan 7 13:34:25 2008 -0500

    Replace Isa.pc(Task) and .setPC(Task,long) with Task.getPC() and .setPC(long).
    
    frysk-core/frysk/bindir/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* fstep.java: Update; use Task.getPC().
    
    frysk-core/frysk/proc/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* Task.java (getPC(), setPC(long)): New.
    	(pcRegister, pcRegister()): New.
    	* Isa.java (pc(Task), setPC(Task,long)): Delete.
    	* LinuxIa32.java: Update.
    	* LinuxX8664.java: Update.
    	* IsaPowerPC.java: Update.
    	* TestInstructions.java: Update.
    	* TestBreakpoints.java: Update.
    	* TestTaskObserverInstructionAndCode.java: Update.
    	* IA32InstructionParser.java: Update.
    	* Instruction.java: Update.
    
    frysk-core/frysk/proc/dead/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxExeTask.java: Update; use Task.setPC(long).
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxPtraceTaskState.java: Update; Use Task.setPC(long).
    
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* Breakpoint.java: Update; use Task.getPC().
    
    frysk-core/frysk/stepping/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* SteppingEngine.java: Update; use Task.getPC().
    	* TaskStepEngine.java: Ditto.
    
    frysk-core/frysk/symtab/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* TestSymbol.java: Update; Use Task.getPC().
    
    frysk-gui/frysk/gui/ChangeLog
    2008-01-07  Andrew Cagney  <cagney@redhat.com>
    
    	* disassembler/DisassemblyWindow.java: Update; use Task.getPC().
    	* memory/MemoryWindow.java: Ditto.

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

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog                  |    4 +
 frysk-core/frysk/bindir/fstep.java                 |    2 +-
 frysk-core/frysk/proc/ChangeLog                    |   15 +++++
 frysk-core/frysk/proc/IA32InstructionParser.java   |    8 +--
 frysk-core/frysk/proc/Instruction.java             |    8 +--
 frysk-core/frysk/proc/Isa.java                     |   17 +-----
 frysk-core/frysk/proc/IsaPowerPC.java              |   20 +------
 frysk-core/frysk/proc/LinuxIa32.java               |   16 +----
 frysk-core/frysk/proc/LinuxX8664.java              |   16 +----
 frysk-core/frysk/proc/Task.java                    |   11 ++++
 frysk-core/frysk/proc/TestBreakpoints.java         |    2 +-
 frysk-core/frysk/proc/TestInstructions.java        |    8 +-
 .../proc/TestTaskObserverInstructionAndCode.java   |    2 +-
 frysk-core/frysk/proc/dead/ChangeLog               |    6 ++
 frysk-core/frysk/proc/dead/DeadTask.java           |    4 +
 frysk-core/frysk/proc/dead/LinuxCoreTask.java      |    7 ++
 frysk-core/frysk/proc/dead/LinuxExeTask.java       |   59 +++++++++----------
 frysk-core/frysk/proc/dummy/DummyTask.java         |    7 ++
 frysk-core/frysk/proc/live/ChangeLog               |    7 ++
 frysk-core/frysk/proc/live/LinuxPtraceTask.java    |   22 +++++++-
 .../frysk/proc/live/LinuxPtraceTaskState.java      |   15 ++---
 frysk-core/frysk/rt/Breakpoint.java                |    2 +-
 frysk-core/frysk/rt/ChangeLog                      |    4 +
 frysk-core/frysk/stepping/ChangeLog                |    5 ++
 frysk-core/frysk/stepping/SteppingEngine.java      |    2 +-
 frysk-core/frysk/stepping/TaskStepEngine.java      |    2 +-
 frysk-core/frysk/symtab/ChangeLog                  |    4 +
 frysk-core/frysk/symtab/TestSymbol.java            |    2 +-
 frysk-gui/frysk/gui/ChangeLog                      |    5 ++
 .../frysk/gui/disassembler/DisassemblyWindow.java  |    8 +-
 frysk-gui/frysk/gui/memory/MemoryWindow.java       |    6 +-
 31 files changed, 172 insertions(+), 124 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index 1bbe15f..9925b91 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-07  Andrew Cagney  <cagney@redhat.com>
+
+	* fstep.java: Update; use Task.getPC().
+
 2007-12-20  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* TestFauxv.java (fauxv):  Delete System.out.
diff --git a/frysk-core/frysk/bindir/fstep.java b/frysk-core/frysk/bindir/fstep.java
index e6e4e2f..92749da 100644
--- a/frysk-core/frysk/bindir/fstep.java
+++ b/frysk-core/frysk/bindir/fstep.java
@@ -308,7 +308,7 @@ public class fstep
 
     if (sample == 0 || steps % sample == 0) {
 	int tid = task.getTid();
-	long pc = task.getIsa().pc(task);
+	long pc = task.getPC();
 	Iterator it;
 	it = disassembler.disassembleInstructions(pc, instrs).iterator();
 	while (it.hasNext()) {
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index ead93dd..a5a931a 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,20 @@
 2008-01-07  Andrew Cagney  <cagney@redhat.com>
 
+	* Task.java (setPC(long), getPC()): Make abstract.
+	(pcRegister, pcRegister()): Delete.	
+
+	* Task.java (getPC(), setPC(long)): New.
+	(pcRegister, pcRegister()): New.
+	* Isa.java (pc(Task), setPC(Task,long)): Delete.
+	* LinuxIa32.java: Update.
+	* LinuxX8664.java: Update.
+	* IsaPowerPC.java: Update.
+	* TestInstructions.java: Update.
+	* TestBreakpoints.java: Update.
+	* TestTaskObserverInstructionAndCode.java: Update.
+	* IA32InstructionParser.java: Update.
+	* Instruction.java: Update.
+
 	* State.java: Move to frysk.proc.live.State.
 
 	* Task.java (getMod()): Make abstract.
diff --git a/frysk-core/frysk/proc/IA32InstructionParser.java b/frysk-core/frysk/proc/IA32InstructionParser.java
index 165ac40..fa88f4d 100644
--- a/frysk-core/frysk/proc/IA32InstructionParser.java
+++ b/frysk-core/frysk/proc/IA32InstructionParser.java
@@ -67,11 +67,9 @@ class IA32InstructionParser
       super("JMP", new byte[] { (byte) 0xeb, addr }, true);
     }
 
-    public void fixupExecuteOutOfLine(Task task, long pc, long address)
-    {
-      Isa isa = task.getIsa();
-      long new_pc = isa.pc(task);
-      isa.setPC(task, pc + (new_pc - address));
+    public void fixupExecuteOutOfLine(Task task, long pc, long address) {
+	long newPc = task.getPC();
+	task.setPC(pc + (newPc - address));
     }
   }
 
diff --git a/frysk-core/frysk/proc/Instruction.java b/frysk-core/frysk/proc/Instruction.java
index c88e7f5..0e9aab5 100644
--- a/frysk-core/frysk/proc/Instruction.java
+++ b/frysk-core/frysk/proc/Instruction.java
@@ -143,7 +143,7 @@ public class Instruction
     ByteBuffer buffer = task.getRawMemory();
     buffer.position(address);
     buffer.put(instr);
-    task.getIsa().setPC(task, address);
+    task.setPC(address);
   }
 
   /**
@@ -155,10 +155,8 @@ public class Instruction
    * the length of this instruction. Override when the instruction needs
    * to do anything else.
    */
-  public void fixupExecuteOutOfLine(Task task, long pc, long address)
-  {
-    Isa isa = task.getIsa();
-    isa.setPC(task, pc + instr.length);
+  public void fixupExecuteOutOfLine(Task task, long pc, long address) {
+      task.setPC(pc + instr.length);
   }
 
   /**
diff --git a/frysk-core/frysk/proc/Isa.java b/frysk-core/frysk/proc/Isa.java
index 814a4bf..c81fd12 100644
--- a/frysk-core/frysk/proc/Isa.java
+++ b/frysk-core/frysk/proc/Isa.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2005, 2006, 2007 Red Hat Inc.
+// Copyright 2005, 2006, 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -47,20 +47,7 @@ import inua.eio.ByteBuffer;
  *
  */
 
-public interface Isa
-{
-  /**
-   * Get the value of the program counter in a task.
-   * @param task the task
-   * @return program counter, which might be negative!
-   */
-  long pc(Task task);
-  
-
-  /**
-   * Sets the value of the program counter in a task to the given address.
-   */
-  void setPC(Task task, long address);
+public interface Isa {
 
   /**
    * Get the breakpoint instruction.
diff --git a/frysk-core/frysk/proc/IsaPowerPC.java b/frysk-core/frysk/proc/IsaPowerPC.java
index b5126fa..db0110b 100644
--- a/frysk-core/frysk/proc/IsaPowerPC.java
+++ b/frysk-core/frysk/proc/IsaPowerPC.java
@@ -1,7 +1,7 @@
 // This file is part of the program FRYSK.
 //
 // Copyright 2006 IBM Corp.
-// Copyright 2007 Red Hat Inc.
+// Copyright 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -45,10 +45,7 @@ import inua.eio.ByteBuffer;
 import frysk.isa.Register;
 
 abstract class IsaPowerPC implements Isa {
-    private final Register PC;
-
     protected IsaPowerPC(Register PC) {
-	this.PC = PC;
     }
 
    // the illegal instruction for powerpc: 0x7d821008.
@@ -57,14 +54,6 @@ abstract class IsaPowerPC implements Isa {
    	new Instruction(new byte[] { (byte)0x7d, (byte)0x82, 
 				     (byte)0x10, (byte)0x08 }, false);
 
-    public long pc (Task task) {
-	return task.getRegister(PC);
-    }
-
-    public void setPC (Task task, long address) {
-	task.setRegister(PC, address);
-    }
-
   /**
    * Get the breakpoint instruction of the PowerPC platform.
    */
@@ -107,12 +96,9 @@ abstract class IsaPowerPC implements Isa {
    * one breakpoint set in task. In PowerPC, the PC register's value will 
    * remain unchanged. 
    */
-  public final long getBreakpointAddress(Task task)
-  {
+  public final long getBreakpointAddress(Task task) {
     long pcValue = 0;
-
-    pcValue = this.pc(task);
-    
+    pcValue = task.getPC();
     return pcValue;
   }
 
diff --git a/frysk-core/frysk/proc/LinuxIa32.java b/frysk-core/frysk/proc/LinuxIa32.java
index eb74bd1..f779ba1 100644
--- a/frysk-core/frysk/proc/LinuxIa32.java
+++ b/frysk-core/frysk/proc/LinuxIa32.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2005, 2006, 2007 Red Hat Inc.
+// Copyright 2005, 2006, 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -49,14 +49,6 @@ class LinuxIa32 implements Isa {
     private static final Instruction IA32Breakpoint
 	= new Instruction(new byte[] { (byte)0xcc }, false);
   
-    public long pc(Task task) {
-	return task.getRegister(IA32Registers.EIP);
-    }
-
-    public void setPC(Task task, long address) {
-	task.setRegister(IA32Registers.EIP, address);
-    }
-
     /**
      * Get the breakpoint instruction for IA32.
      */
@@ -84,7 +76,7 @@ class LinuxIa32 implements Isa {
     public long getBreakpointAddress(Task task) {
 	long pcValue;
     
-	pcValue = this.pc(task);
+	pcValue = task.getPC();
 	pcValue = pcValue - 1;
     
 	return pcValue;
@@ -135,7 +127,7 @@ class LinuxIa32 implements Isa {
      * that should trap into a kernel syscall.
      */
     public boolean hasExecutedSpuriousTrap(Task task) {
-	long address = pc(task);
+	long address = task.getPC();
 	return (task.getMemory().getByte(address - 1) == (byte) 0x80
 		&& task.getMemory().getByte(address - 2) == (byte) 0xcd);
     }
@@ -148,7 +140,7 @@ class LinuxIa32 implements Isa {
      * eax register contains 0x77.
      */
     public boolean isAtSyscallSigReturn(Task task) {
-	long address = pc(task);
+	long address = task.getPC();
 	boolean result = (task.getMemory().getByte(address) == (byte) 0xcd
 			  && (task.getMemory().getByte(address + 1)
 			      == (byte) 0x80));
diff --git a/frysk-core/frysk/proc/LinuxX8664.java b/frysk-core/frysk/proc/LinuxX8664.java
index a3501e4..8943d42 100644
--- a/frysk-core/frysk/proc/LinuxX8664.java
+++ b/frysk-core/frysk/proc/LinuxX8664.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2005, 2006, 2007 Red Hat Inc.
+// Copyright 2005, 2006, 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -48,14 +48,6 @@ class LinuxX8664 implements Isa {
     private static final Instruction X8664Breakpoint
 	= new Instruction(new byte[] { (byte)0xcc }, false);
   
-    public long pc(Task task) {
-	return task.getRegister(X8664Registers.RIP);
-    }
-
-    public void setPC(Task task, long address) {
-	task.setRegister(X8664Registers.RIP, address);
-    }
-
     /**
      * Get the breakpoint instruction for X8664.
      */
@@ -84,7 +76,7 @@ class LinuxX8664 implements Isa {
     public long getBreakpointAddress(Task task) {
 	long pcValue = 0;
 
-	pcValue = this.pc(task);
+	pcValue = task.getPC();
 	pcValue = pcValue - 1;
     
 	return pcValue;
@@ -135,7 +127,7 @@ class LinuxX8664 implements Isa {
      * SYSCALL instruction.
      */
     public boolean hasExecutedSpuriousTrap(Task task) {
-	long address = pc(task);
+	long address = task.getPC();
 	return (task.getMemory().getByte(address - 1) == (byte) 0x05
 		&& task.getMemory().getByte(address - 2) == (byte) 0x0f);
     }
@@ -148,7 +140,7 @@ class LinuxX8664 implements Isa {
      * the rax register contains 0x0f.
      */
     public boolean isAtSyscallSigReturn(Task task) {
-	long address = pc(task);
+	long address = task.getPC();
 	boolean result = (task.getMemory().getByte(address) == (byte) 0x0f
 			  && task.getMemory().getByte(address + 1) == (byte) 0x05);
 	if (result) {
diff --git a/frysk-core/frysk/proc/Task.java b/frysk-core/frysk/proc/Task.java
index 16b4e57..fa77578 100644
--- a/frysk-core/frysk/proc/Task.java
+++ b/frysk-core/frysk/proc/Task.java
@@ -383,6 +383,17 @@ public abstract class Task {
     public LinkedList pendingObservations = new LinkedList();
 
     /**
+     * Return the address of the instruction that this task will
+     * execute next.
+     */
+    public abstract long getPC();
+    /**
+     * Set the address of the instruction that this task will execute
+     * next.
+     */
+    public abstract void setPC(long addr);
+
+    /**
      * Return the Task's Register as a long.
      */
     public long getRegister(Register register) {
diff --git a/frysk-core/frysk/proc/TestBreakpoints.java b/frysk-core/frysk/proc/TestBreakpoints.java
index 721728e..f629bef 100644
--- a/frysk-core/frysk/proc/TestBreakpoints.java
+++ b/frysk-core/frysk/proc/TestBreakpoints.java
@@ -579,7 +579,7 @@ public class TestBreakpoints
                                         + " not equals expected "
                                         + this.task);
 
-      if (task.getIsa().pc(task) == addr)
+      if (task.getPC() == addr)
 	addr_hit++;
       return Action.CONTINUE;
     }
diff --git a/frysk-core/frysk/proc/TestInstructions.java b/frysk-core/frysk/proc/TestInstructions.java
index 2263567..9dba007 100644
--- a/frysk-core/frysk/proc/TestInstructions.java
+++ b/frysk-core/frysk/proc/TestInstructions.java
@@ -207,7 +207,7 @@ public class TestInstructions
     assertRunUntilStop("Remove setup instruction observer");
 
     assertEquals("stopped at first breakpoint",
-		 task.getIsa().pc(task), first);
+		 task.getPC(), first);
 
     // Reinsert instruction observer now that we are at the start.
     task.requestAddInstructionObserver(io);
@@ -258,7 +258,7 @@ public class TestInstructions
 	long addr = ((Long) it.next()).longValue();
 	CodeObserver code = (CodeObserver) codeObservers.remove(0);
 	assertEquals("code observer hit: " + addr,
-		     task.getIsa().pc(task), addr);
+		     task.getPC(), addr);
 	task.requestUnblock(code);
 	if (it.hasNext())
 	  assertRunUntilStop("wait for next code observer hit after "
@@ -299,7 +299,7 @@ public class TestInstructions
 	long addr = ((Long) it.next()).longValue();
 	CodeObserver code = (CodeObserver) codeObservers.remove(0);
 	assertEquals("code observer hit: " + addr,
-		     task.getIsa().pc(task), addr);
+		     task.getPC(), addr);
 	assertEquals("step observer hit: " + addr, io.getAddr(), addr);
 	task.requestUnblock(io);
 	task.requestUnblock(code);
@@ -399,7 +399,7 @@ public class TestInstructions
                                         + " not equals expected "
                                         + this.task);
       
-      addr = task.getIsa().pc(task);
+      addr = task.getPC();
       if (block)
 	{
 	  Manager.eventLoop.requestStop();
diff --git a/frysk-core/frysk/proc/TestTaskObserverInstructionAndCode.java b/frysk-core/frysk/proc/TestTaskObserverInstructionAndCode.java
index 075f7fe..3a01d68 100644
--- a/frysk-core/frysk/proc/TestTaskObserverInstructionAndCode.java
+++ b/frysk-core/frysk/proc/TestTaskObserverInstructionAndCode.java
@@ -164,7 +164,7 @@ public class TestTaskObserverInstructionAndCode
                                         + this.task);
 
       hit++;
-      lastAddress = task.getIsa().pc(task);
+      lastAddress = task.getPC();
 
       if (cont)
         return Action.CONTINUE;
diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
index 7c31647..ecb988a 100644
--- a/frysk-core/frysk/proc/dead/ChangeLog
+++ b/frysk-core/frysk/proc/dead/ChangeLog
@@ -1,5 +1,11 @@
 2008-01-07  Andrew Cagney  <cagney@redhat.com>
 
+	* LinuxCoreTask.java (getPC()): New.
+	* LinuxExeTask.java (getPC()): New.
+	* DeadTask.java (setPC(long)): New.
+
+	* LinuxExeTask.java: Update; use Task.setPC(long).
+
 	* DeadTask.java (getMod()): New.
 
 	* LinuxCoreProc.java (getCommand()): Replace sendrecCommand().
diff --git a/frysk-core/frysk/proc/dead/DeadTask.java b/frysk-core/frysk/proc/dead/DeadTask.java
index 0728adf..46ec9f0 100644
--- a/frysk-core/frysk/proc/dead/DeadTask.java
+++ b/frysk-core/frysk/proc/dead/DeadTask.java
@@ -244,4 +244,8 @@ abstract class DeadTask extends Task {
     public int getMod() {
 	return 1; // never changes.
     }
+
+    public void setPC(long addr) {
+	throw new RuntimeException("setPC: the task is dead");
+    }
 }
diff --git a/frysk-core/frysk/proc/dead/LinuxCoreTask.java b/frysk-core/frysk/proc/dead/LinuxCoreTask.java
index 4711a63..8a4f041 100644
--- a/frysk-core/frysk/proc/dead/LinuxCoreTask.java
+++ b/frysk-core/frysk/proc/dead/LinuxCoreTask.java
@@ -49,6 +49,7 @@ import frysk.proc.TaskId;
 import frysk.proc.Isa;
 import frysk.isa.ISA;
 import frysk.bank.RegisterBanks;
+import frysk.isa.RegistersFactory;
 
 public class LinuxCoreTask extends DeadTask {
 
@@ -142,4 +143,10 @@ public class LinuxCoreTask extends DeadTask {
     protected Isa sendrecIsa() {
 	return getProc().getIsa();
     }
+
+    public long getPC() {
+	return getRegister(RegistersFactory
+			   .getRegisters(getISA())
+			   .getProgramCounter());
+    }
 }
diff --git a/frysk-core/frysk/proc/dead/LinuxExeTask.java b/frysk-core/frysk/proc/dead/LinuxExeTask.java
index 8cfa420..0d14acd 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeTask.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeTask.java
@@ -48,40 +48,37 @@ import frysk.isa.ISA;
 
 import lib.dwfl.*;
 
-public class LinuxExeTask extends DeadTask
-{
+public class LinuxExeTask extends DeadTask {
+    private final long pc;
+    LinuxExeProc proc = null;
+    TaskId id = null;
 
-  LinuxExeProc proc = null;
-  TaskId id = null;
-
-  protected LinuxExeTask(LinuxExeProc proc, TaskId id) {
-      super(proc, id);
-      this.proc = proc;
-      this.id = id;
-
-      // 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;
+    protected LinuxExeTask(LinuxExeProc proc, TaskId id) {
+	super(proc, id);
+	this.proc = proc;
+	this.id = id;
+	// Compute a Fake PC.  XXX should be done in Proc instead of
+	// creating Elf object in the Task itself.
+	Elf e = null;
+	long pc;
+	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();
 	}
-      finally
-	{
-	  if (e != null)
-	    e.close();
-	}
-      getIsa().setPC(this, pc);
-  }
+	this.pc = pc;
+    }
   
+    public long getPC() {
+	return pc;
+    }


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


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

only message in thread, other threads:[~2008-01-07 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-07 19:19 [SCM] master: Push Task.getPC and .setPC into sub-classes cagney

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