This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Replace class-name tests with ISA == tests.


The branch, master has been updated
       via  59d1aa4c32e5bd3d9275db8cae8c57eac6f28127 (commit)
       via  faa0e40e638e9f69906ed70003a1a59c60109c2e (commit)
       via  babe73c3b9004da007ea3b37176fe5ea84d72938 (commit)
      from  ddfabd8d35ebd64b1e8141b35e734d0edd57fd9c (commit)

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

- Log -----------------------------------------------------------------
commit 59d1aa4c32e5bd3d9275db8cae8c57eac6f28127
Author: Andrew Cagney <cagney@toil.yyz.redhat.com>
Date:   Fri Dec 21 15:27:21 2007 -0500

    Replace class-name tests with ISA == tests.
    
    frysk-core/frysk/util/ChangeLog
    2007-12-21  Andrew Cagney  <cagney@redhat.com>
    
    	* TestCoredumpAction.java (getArch(String)): Delete.
    	(getIsa(Proc)): Delete.
    	(testElfCoreHeader()): Use getISA.

commit faa0e40e638e9f69906ed70003a1a59c60109c2e
Author: Andrew Cagney <cagney@toil.yyz.redhat.com>
Date:   Fri Dec 21 15:08:06 2007 -0500

    Delete empty 32-on-64 Isa classes.
    
    frysk-core/frysk/proc/ChangeLog
    2007-12-21  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxPPC32On64.java: Delete.
    	* LinuxIa32On64.java: Delete.
    	* IsaFactory.java (IsaFactory()): Simplify.

commit babe73c3b9004da007ea3b37176fe5ea84d72938
Author: Andrew Cagney <cagney@toil.yyz.redhat.com>
Date:   Fri Dec 21 14:59:54 2007 -0500

    Delete unused frysk.proc.Isa.getRegisterBankBuffers().
    
    frysk-core/frysk/proc/ChangeLog
    2007-12-21  Andrew Cagney  <cagney@redhat.com>
    
    	* Isa.java (getRegisterBankBuffers(int)): Delete.
    	* LinuxIa32On64.java (getRegisterBankBuffers(int)): Delete.
    	* IsaX8664.java (getRegisterBankBuffers(int)): Delete.
    	* IsaPowerPC.java (getRegisterBankBuffers(int)): Delete.
    	* IsaIA32.java (getRegisterBankBuffers(int)): Delete.

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

Summary of changes:
 frysk-core/frysk/proc/ChangeLog               |   12 +++
 frysk-core/frysk/proc/Isa.java                |    9 ---
 frysk-core/frysk/proc/IsaFactory.java         |   35 ++--------
 frysk-core/frysk/proc/IsaIA32.java            |   19 -----
 frysk-core/frysk/proc/IsaPowerPC.java         |   11 +---
 frysk-core/frysk/proc/IsaX8664.java           |   17 -----
 frysk-core/frysk/proc/LinuxIa32On64.java      |   93 -------------------------
 frysk-core/frysk/proc/LinuxPPC32On64.java     |   52 --------------
 frysk-core/frysk/util/ChangeLog               |    6 ++
 frysk-core/frysk/util/TestCoredumpAction.java |   54 ++-------------
 10 files changed, 33 insertions(+), 275 deletions(-)
 delete mode 100644 frysk-core/frysk/proc/LinuxIa32On64.java
 delete mode 100644 frysk-core/frysk/proc/LinuxPPC32On64.java

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index 7ef1b3a..ab0e3cf 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,3 +1,15 @@
+2007-12-21  Andrew Cagney  <cagney@redhat.com>
+
+	* LinuxPPC32On64.java: Delete.
+	* LinuxIa32On64.java: Delete.
+	* IsaFactory.java (IsaFactory()): Simplify.
+	
+	* Isa.java (getRegisterBankBuffers(int)): Delete.
+	* LinuxIa32On64.java (getRegisterBankBuffers(int)): Delete.
+	* IsaX8664.java (getRegisterBankBuffers(int)): Delete.
+	* IsaPowerPC.java (getRegisterBankBuffers(int)): Delete.
+	* IsaIA32.java (getRegisterBankBuffers(int)): Delete.
+
 2007-12-20  Andrew Cagney  <cagney@redhat.com>
 
 	* Task.java (sendrecRegisterBuffersFIXME()): Delete.
diff --git a/frysk-core/frysk/proc/Isa.java b/frysk-core/frysk/proc/Isa.java
index 4380708..59a150b 100644
--- a/frysk-core/frysk/proc/Isa.java
+++ b/frysk-core/frysk/proc/Isa.java
@@ -119,15 +119,6 @@ public interface Isa
    */
   boolean isAtSyscallSigReturn(Task task);
 
-  /**
-   * Return an array of ByteBuffers for accessing the register
-   * banks. It's possible for different elements of the array to be
-   * shared.
-   *
-   * @returns array of ByteBuffer objects.
-   */
-  ByteBuffer[] getRegisterBankBuffers(int pid);
-  
   /** @return Syscall[] return system call list for this Linux<ISA>. */
   Syscall[] getSyscallList ();
   /** @return HashMap return a HashMap for unknown system calls. */
diff --git a/frysk-core/frysk/proc/IsaFactory.java b/frysk-core/frysk/proc/IsaFactory.java
index ec73600..f48a0d0 100644
--- a/frysk-core/frysk/proc/IsaFactory.java
+++ b/frysk-core/frysk/proc/IsaFactory.java
@@ -43,8 +43,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.Hashtable;
 import java.io.File;
-import frysk.Config;
-
 import lib.dwfl.Elf;
 import lib.dwfl.ElfCommand;
 import lib.dwfl.ElfEHeader;
@@ -58,36 +56,17 @@ public class IsaFactory
   static final Logger logger = Logger.getLogger(ProcLogger.LOGGER_ID);
   private Hashtable isaHash;
     
-  IsaFactory() 
-  {
-    isaHash = new Hashtable();
-    isaHash.put(Integer.valueOf(ElfEMachine.EM_X86_64),
-		LinuxX8664.isaSingleton());
-    isaHash.put(Integer.valueOf(ElfEMachine.EM_PPC64),
-		LinuxPPC64.isaSingleton());
-    // XXX: This should not be looking at the configuration target
-    // string when selecting the ISA.
-    if (Config.getTargetCpuXXX().equals ("x86_64")) 
-      {
-	isaHash.put(Integer.valueOf(ElfEMachine.EM_386),
-		    LinuxIa32On64.isaSingleton());
-      }
-    else
-      {
+    IsaFactory() {
+	isaHash = new Hashtable();
+	isaHash.put(Integer.valueOf(ElfEMachine.EM_X86_64),
+		    LinuxX8664.isaSingleton());
+	isaHash.put(Integer.valueOf(ElfEMachine.EM_PPC64),
+		    LinuxPPC64.isaSingleton());
 	isaHash.put(Integer.valueOf(ElfEMachine.EM_386),
 		    LinuxIa32.isaSingleton());
-      }
-    if (Config.getTargetCpuXXX().equals("powerpc64"))
-      {
-	isaHash.put(Integer.valueOf(ElfEMachine.EM_PPC),
-		    LinuxPPC32On64.isaSingleton());
-      }
-    else
-      {
 	isaHash.put(Integer.valueOf(ElfEMachine.EM_PPC),
 		    LinuxPPC32.isaSingleton());
-      }
-  }
+    }
   
   public static IsaFactory getSingleton()
   {
diff --git a/frysk-core/frysk/proc/IsaIA32.java b/frysk-core/frysk/proc/IsaIA32.java
index 2b7303d..3010a4c 100644
--- a/frysk-core/frysk/proc/IsaIA32.java
+++ b/frysk-core/frysk/proc/IsaIA32.java
@@ -42,12 +42,7 @@ package frysk.proc;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import inua.eio.ByteOrder;
 import inua.eio.ByteBuffer;
-import frysk.sys.Ptrace.RegisterSet;
-import frysk.sys.Ptrace.AddressSpace;
-import frysk.proc.live.RegisterSetByteBuffer;
-import frysk.proc.live.AddressSpaceByteBuffer;
 import frysk.isa.IA32Registers;
 
 public class IsaIA32 implements Isa
@@ -55,20 +50,6 @@ public class IsaIA32 implements Isa
   private static final Instruction IA32Breakpoint
     = new Instruction(new byte[] { (byte)0xcc }, false);
   
-  public ByteBuffer[] getRegisterBankBuffers(int pid) 
-  {
-      ByteBuffer[] bankBuffers = new ByteBuffer[] {
-	  new RegisterSetByteBuffer(pid, RegisterSet.REGS),
-	  new RegisterSetByteBuffer(pid, RegisterSet.FPREGS),
-	  new RegisterSetByteBuffer(pid, RegisterSet.FPXREGS),
-	  new AddressSpaceByteBuffer(pid, AddressSpace.USR)
-    };
-    for (int i = 0; i < bankBuffers.length; i++) {
-	  bankBuffers[i].order(ByteOrder.LITTLE_ENDIAN);
-    }
-    return bankBuffers;
-  }
-  
     public long pc(Task task) {
 	return task.getRegister(IA32Registers.EIP);
     }
diff --git a/frysk-core/frysk/proc/IsaPowerPC.java b/frysk-core/frysk/proc/IsaPowerPC.java
index 46537bb..b5126fa 100644
--- a/frysk-core/frysk/proc/IsaPowerPC.java
+++ b/frysk-core/frysk/proc/IsaPowerPC.java
@@ -42,10 +42,7 @@ package frysk.proc;
 import java.util.LinkedList;
 import java.util.List;
 import inua.eio.ByteBuffer;
-import frysk.proc.live.AddressSpaceByteBuffer;
-import frysk.sys.Ptrace.AddressSpace;
 import frysk.isa.Register;
-import inua.eio.ByteOrder;
 
 abstract class IsaPowerPC implements Isa {
     private final Register PC;
@@ -148,10 +145,4 @@ abstract class IsaPowerPC implements Isa {
     return false;
   }
 
-  public ByteBuffer[] getRegisterBankBuffers(int pid) 
-  {
-      ByteBuffer registers = new AddressSpaceByteBuffer(pid, AddressSpace.USR);
-      registers.order(ByteOrder.BIG_ENDIAN);
-      return new ByteBuffer[] { registers };
-  }
- }
+}
diff --git a/frysk-core/frysk/proc/IsaX8664.java b/frysk-core/frysk/proc/IsaX8664.java
index b3f3521..b35c2a9 100644
--- a/frysk-core/frysk/proc/IsaX8664.java
+++ b/frysk-core/frysk/proc/IsaX8664.java
@@ -42,12 +42,7 @@ package frysk.proc;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import inua.eio.ByteOrder;
 import inua.eio.ByteBuffer;
-import frysk.sys.Ptrace.RegisterSet;
-import frysk.sys.Ptrace.AddressSpace;
-import frysk.proc.live.RegisterSetByteBuffer;
-import frysk.proc.live.AddressSpaceByteBuffer;
 import frysk.isa.X8664Registers;
 
 public class IsaX8664 implements Isa
@@ -185,16 +180,4 @@ public class IsaX8664 implements Isa
     return Syscall.iterateSyscallByName (name, LinuxX8664Syscall.syscallList);
   }
 
-  public ByteBuffer[] getRegisterBankBuffers(int pid) 
-  {
-      ByteBuffer[] bankBuffers = new ByteBuffer[] {
-	  new RegisterSetByteBuffer(pid, RegisterSet.REGS),
-	  new RegisterSetByteBuffer(pid, RegisterSet.FPREGS),
-	  new AddressSpaceByteBuffer(pid, AddressSpace.USR)
-      };
-      for (int i = 0; i < bankBuffers.length; i++) {
-	  bankBuffers[i].order(ByteOrder.LITTLE_ENDIAN);
-      }
-      return bankBuffers;
-  }
 }
diff --git a/frysk-core/frysk/proc/LinuxIa32On64.java b/frysk-core/frysk/proc/LinuxIa32On64.java
deleted file mode 100644
index 1bb820d..0000000
--- a/frysk-core/frysk/proc/LinuxIa32On64.java
+++ /dev/null
@@ -1,93 +0,0 @@
-// This file is part of the program FRYSK.
-//
-// Copyright 2006, 2007 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
-// the Free Software Foundation; version 2 of the License.
-//
-// FRYSK is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-
-package frysk.proc;
-
-import inua.eio.ByteBuffer;
-
-/**
- * Class for IA32 processes running on 64 bit machines.
- *
- * For the purposes of ptrace, Linux treats a 32 bit process like a 64
- * bit process, with the same user area and register layout that a 32
- * bit process would have; the 32 bit IA32 registers are stored in the
- * corresponding slots in the 64 bit structures. In order to debug a
- * 32 bit process we use a LinuxIa32 class with new overriding methods
- * that access registers,  but otherwise things "just work;" for
- * example, reading and writing memory is fine because the process has
- * the 32 bit memory map, memory will be read / written in 32 bit
- * chunks because the Isa work length is 32 bits, but the
- * PtraceByteBuffer class knows to access memory in 64 bit chunks.
- */
-class LinuxIa32On64
-extends LinuxIa32
-{
-  private static LinuxIa32On64 isa;
-
-  /**
-   * Returns the Isa singleton object. Note that the return type is
-   * not LinuxIa32On64 because that would cause a conflict with the
-   * isaSingleton method in the superclass.
-   *
-   * @return the Isa singleton object.
-   */
-  static LinuxIa32 isaSingleton()
-  {
-    if (isa == null)
-      isa = new LinuxIa32On64();
-    return isa;
-  }
-  // The Isa object used to actually access registers in the target.
-  private final IsaX8664 isa64 = new IsaX8664();
-
-  /**
-   * Get the buffers used to access registers in the different
-   * banks. This Isa has just one register bank -- the USR area
-   * of the x8664 -- even though Ia32 has 3.
-   *
-   * @return the <code>ByteBuffer</code>s used to access registers.
-   */
-  public ByteBuffer[] getRegisterBankBuffers(int pid) 
-  {
-    return isa64.getRegisterBankBuffers(pid);
-  }
-  
-}
-
-  
diff --git a/frysk-core/frysk/proc/LinuxPPC32On64.java b/frysk-core/frysk/proc/LinuxPPC32On64.java
deleted file mode 100644
index a4e8869..0000000
--- a/frysk-core/frysk/proc/LinuxPPC32On64.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file is part of the program FRYSK.
-//
-// Copyright 2006 IBM Corp.
-//
-// FRYSK is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// FRYSK is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-//
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-
-package frysk.proc;
-
-class LinuxPPC32On64
-  extends LinuxPPC32
-{
-  private static LinuxPPC32On64 isa;
-
-    static LinuxPPC32 isaSingleton () {
-	if (isa == null)
-	    isa = new LinuxPPC32On64 ();
-	return isa;
-    }
-}
diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
index 2bbd2ad..124aaac 100644
--- a/frysk-core/frysk/util/ChangeLog
+++ b/frysk-core/frysk/util/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-21  Andrew Cagney  <cagney@redhat.com>
+
+	* TestCoredumpAction.java (getArch(String)): Delete.
+	(getIsa(Proc)): Delete.
+	(testElfCoreHeader()): Use getISA.
+
 2007-12-10  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* TestFCore.java: Rename to TestCoredumpAction.java
diff --git a/frysk-core/frysk/util/TestCoredumpAction.java b/frysk-core/frysk/util/TestCoredumpAction.java
index c694a9c..61fce34 100644
--- a/frysk-core/frysk/util/TestCoredumpAction.java
+++ b/frysk-core/frysk/util/TestCoredumpAction.java
@@ -54,7 +54,6 @@ import lib.dwfl.ElfKind;
 import frysk.event.Event;
 import frysk.event.RequestStopEvent;
 import frysk.proc.Auxv;
-import frysk.proc.Isa;
 import frysk.proc.Manager;
 import frysk.proc.MemoryMap;
 import frysk.proc.Proc;
@@ -92,7 +91,6 @@ public class TestCoredumpAction
     assertTrue("Checking core file " + coreFileName + " exists.",
                testCore.exists());
 
-    Isa arch = getIsa(ackProc);
     ISA isa = getISA(ackProc);
     ByteOrder order = isa.order();
 
@@ -125,45 +123,30 @@ public class TestCoredumpAction
     assertEquals("Checking Header type is ET_CORE", header.type,
                  ElfEHeader.PHEADER_ET_CORE);
 
-    // Get machine architecture
-    String arch_test = getArch(arch);
-
     // Check machine and class
-    if (arch_test.equals("frysk.proc.LinuxIa32"))
-      {
+    if (isa == ISA.IA32) {
         assertEquals("Checking header machine type", header.machine,
                      ElfEMachine.EM_386);
         assertEquals("Checking elf class", header.ident[4],
                      ElfEHeader.PHEADER_ELFCLASS32);
-      }
-    if (arch_test.equals("frysk.proc.LinuxPPC64"))
-      {
+    } else if (isa == ISA.PPC64BE) {
         assertEquals("Checking header machine type", header.machine,
                      ElfEMachine.EM_PPC64);
         assertEquals("Checking elf class", header.ident[4],
                      ElfEHeader.PHEADER_ELFCLASS64);
-      }
-    if (arch_test.equals("frysk.proc.LinuxPPC32On64"))
-      {
+    } else if (isa == ISA.PPC32BE) {
         assertEquals("Checking header machine type", header.machine,
                      ElfEMachine.EM_PPC);
         assertEquals("Checking elf class", header.ident[4],
                      ElfEHeader.PHEADER_ELFCLASS32);
-      }
-    if (arch_test.equals("frysk.proc.LinuxX8664"))
-      {
+    } else if (isa == ISA.X8664) {
         assertEquals("Checking header machine type", header.machine,
                      ElfEMachine.EM_X86_64);
         assertEquals("Checking elf class", header.ident[4],
                      ElfEHeader.PHEADER_ELFCLASS64);
-      }
-    if (arch_test.equals("frysk.proc.LinuxIa32On64"))
-      {
-        assertEquals("Checking header machine type", header.machine,
-                     ElfEMachine.EM_386);
-        assertEquals("Checking elf class", header.ident[4],
-                     ElfEHeader.PHEADER_ELFCLASS32);
-      }
+    } else {
+	fail("unknown isa: " + isa);
+    }
 
     testCore.delete();
   }
@@ -461,23 +444,6 @@ public class TestCoredumpAction
     return ackProc.getMainTask().getProc();
   }
   
-  
-  /**
-   * Return a string representing the architecture of the given ISA. Really need
-   * to make a better ISA arch test.
-   * 
-   * @param isa - Isa to test
-   * @return String - a string corresponding to the arch.
-   */
-  private String getArch (Isa isa)
-  {
-    String arch_test = isa.toString();
-    String type = arch_test.substring(0, arch_test.lastIndexOf("@"));
-
-    return type;
-  }
-
-  
     /**
      * Returns the ISA that corresponds to the given Proc
      * 
@@ -487,12 +453,6 @@ public class TestCoredumpAction
     private ISA getISA (Proc proc) {
 	return proc.getMainTask().getISA();
     }
-  private Isa getIsa (Proc proc)
-  {
-    Isa arch = null;
-    arch = proc.getMainTask().getIsa();
-    return arch;
-  }
   
   private Elf getElf(String coreFileName)
   {


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]