[SCM] master: Remove BaseTypes.java.

scox@sourceware.org scox@sourceware.org
Tue Nov 20 22:05:00 GMT 2007


The branch, master has been updated
       via  e9a2510db6ab13d940120d232caa347cdabc6b93 (commit)
       via  dfc486258b2df2dd8e4c5f1fa146017a21f7422e (commit)
      from  f81881effcd7fc9c9d35bc20fbac346ca4eaa088 (commit)

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

- Log -----------------------------------------------------------------
commit e9a2510db6ab13d940120d232caa347cdabc6b93
Author: Stan Cox <scox@redhat.com>
Date:   Tue Nov 20 17:00:21 2007 -0500

    Remove BaseTypes.java.
    
    * BaseTypes.java: Remove.

commit dfc486258b2df2dd8e4c5f1fa146017a21f7422e
Author: Stan Cox <scox@redhat.com>
Date:   Tue Nov 20 16:53:44 2007 -0500

    Remove BaseTypes.java.
    
    * TypeEntry.java (getType): Remove reference to DwarfDie.getBaseType().
    * BaseTypes.java: Remove.
    * DwarfDie.java (getBaseType): Remove.
    * cni/DwarfDie.cxx (DwarfDie:::get_base_type): Remove

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

Summary of changes:
 frysk-core/frysk/debuginfo/ChangeLog      |    4 +
 frysk-core/frysk/debuginfo/TypeEntry.java |   67 +++++--------
 frysk-sys/lib/dwfl/BaseTypes.java         |  156 -----------------------------
 frysk-sys/lib/dwfl/ChangeLog              |    6 +
 frysk-sys/lib/dwfl/DwarfDie.java          |   31 +-----
 frysk-sys/lib/dwfl/cni/DwarfDie.cxx       |   59 -----------
 6 files changed, 38 insertions(+), 285 deletions(-)
 delete mode 100644 frysk-sys/lib/dwfl/BaseTypes.java

First 500 lines of diff:
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 76f2ed8..a088723 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-20  Stan Cox  <scox@redhat.com>
+
+	* TypeEntry.java (getType): Remove reference to DwarfDie.getBaseType().
+
 2007-11-20  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* ObjectDeclarationSearchEngine.java (getVariable): Now throws
diff --git a/frysk-core/frysk/debuginfo/TypeEntry.java b/frysk-core/frysk/debuginfo/TypeEntry.java
index 8e7444a..0af1b45 100644
--- a/frysk-core/frysk/debuginfo/TypeEntry.java
+++ b/frysk-core/frysk/debuginfo/TypeEntry.java
@@ -63,9 +63,9 @@ import inua.eio.ByteOrder;
 import java.util.ArrayList;
 import java.util.HashMap;
 
-import lib.dwfl.BaseTypes;
 import lib.dwfl.DwAccess;
 import lib.dwfl.DwAt;
+import lib.dwfl.DwAte;
 import lib.dwfl.DwAttributeNotFoundException;
 import lib.dwfl.DwTag;
 import lib.dwfl.DwarfDie;
@@ -333,8 +333,8 @@ public class TypeEntry
 	case DwTag.ENUMERATION_TYPE_: {
 	    DwarfDie subrange = type.getChild();
 	    EnumType enumType = new EnumType(typeDie.getName(),
-					     byteorder, 
-					     type.getAttrConstant(DwAt.BYTE_SIZE));
+					     byteorder,
+					     getByteSize(type));
 	    while (subrange != null) {
 		enumType.addMember(subrange.getName(), subrange
 			.getAttrConstant(DwAt.CONST_VALUE));
@@ -351,49 +351,31 @@ public class TypeEntry
 	    returnType = new ConstType(getType(type.getType()));
 	    break;
 	}
-	case DwTag.BASE_TYPE_: {
-	    switch (type.getBaseType()) {
-	    case BaseTypes.baseTypeLong:
-	        returnType = new SignedType(type.getName(), byteorder, 8);
+	case DwTag.BASE_TYPE_:
+	    switch (type.getAttrConstant(DwAt.ENCODING)) {
+	    case DwAte.SIGNED_:
+		returnType = new SignedType(type.getName(), byteorder,
+					    getByteSize(type));
+	    	break;
+	    case DwAte.SIGNED_CHAR_:
+		returnType = new CharType(type.getName(), byteorder,
+					  getByteSize(type), true);
 		break;
-	    case BaseTypes.baseTypeUnsignedLong:
-		returnType = new UnsignedType(type.getName(), byteorder, 8);
-		break;
-	    case BaseTypes.baseTypeInteger:
-		returnType = new SignedType(type.getName(), byteorder, 4);
-		break;
-	    case BaseTypes.baseTypeUnsignedInteger:
-		returnType = new UnsignedType(type.getName(), byteorder, 4);
-		break;
-	    case BaseTypes.baseTypeShort:
-		returnType = new SignedType(type.getName(), byteorder, 2);
-		break;
-	    case BaseTypes.baseTypeUnsignedShort:
-		returnType = new UnsignedType(type.getName(), byteorder, 2);
-		break;
-	    case BaseTypes.baseTypeByte:
-		returnType = new SignedType(type.getName(), byteorder, 1);
-		break;
-	    case BaseTypes.baseTypeUnsignedByte:
-		returnType = new UnsignedType(type.getName(), byteorder, 1);
-		break;
-	    case BaseTypes.baseTypeChar:
-		returnType = new CharType(type.getName(), byteorder, 
-			type.getAttrConstant(DwAt.BYTE_SIZE), false);
-		break;
-	    case BaseTypes.baseTypeUnsignedChar:
-		returnType = new CharType(type.getName(), byteorder, 
-			type.getAttrConstant(DwAt.BYTE_SIZE), true);
-		break;
-	    case BaseTypes.baseTypeFloat:
-		returnType = StandardTypes.getFloatType(byteorder);
-		break;
-	    case BaseTypes.baseTypeDouble:
-		returnType = StandardTypes.getDoubleType(byteorder);
+	    case DwAte.UNSIGNED_:
+		returnType = new UnsignedType(type.getName(), byteorder,
+					      getByteSize(type));
+	    	break;
+	    case DwAte.UNSIGNED_CHAR_: 
+		returnType = new CharType(type.getName(), byteorder,
+					  getByteSize(type), false);
 		break;
+	    case DwAte.FLOAT_:
+		if (getByteSize(type) == 4)
+		    returnType = StandardTypes.getFloatType(byteorder);
+		else if (getByteSize(type) == 8)
+			 returnType = StandardTypes.getDoubleType(byteorder);
 	    }
 	}
-	}
 
 	if (returnType != null) {
 	    dieHash.put(new Integer(type.getOffset()), returnType);
@@ -402,5 +384,4 @@ public class TypeEntry
 	else
 	    return new UnknownType(typeDie.getName());
     }
-
 }
diff --git a/frysk-sys/lib/dwfl/BaseTypes.java b/frysk-sys/lib/dwfl/BaseTypes.java
deleted file mode 100644
index 448ae11..0000000
--- a/frysk-sys/lib/dwfl/BaseTypes.java
+++ /dev/null
@@ -1,156 +0,0 @@
-
-// This file is part of the program FRYSK.
-//
-// Copyright 2005, 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.
-
-/**
- * Location of a variable.
- */
-package lib.dwfl;
-
-// This is a good candidate for 1.5 enum
-public final class BaseTypes {
-  public final static int baseTypeByte = 1,
-  baseTypeUnsignedByte = 2,
-  baseTypeChar = 3,
-  baseTypeUnsignedChar = 4,
-  baseTypeShort = 5,
-  baseTypeUnsignedShort = 6,
-  baseTypeUnicode = 7,
-  baseTypeInteger = 8,
-  baseTypeUnsignedInteger = 9,
-  baseTypeLong = 10,
-  baseTypeUnsignedLong = 11,
-  baseTypeFloat = 12,
-  baseTypeDouble = 13,
-  baseTypeLongDouble = 14;
-      
-  public final static int getTypeSize(int type) 
-  {
-    switch (type)
-    {
-    case baseTypeByte:
-      return 1;
-    case baseTypeUnsignedByte:
-      return 1;
-    case baseTypeChar:
-      return 2;
-    case baseTypeUnsignedChar:
-      return 2;
-    case baseTypeShort:
-      return 2;
-    case baseTypeUnsignedShort:
-      return 2;
-    case baseTypeInteger:
-      return 4;
-    case baseTypeUnsignedInteger:
-      return 4;
-    case baseTypeLong:
-      return 8;
-    case baseTypeUnsignedLong:
-      return 8;
-    case baseTypeFloat:
-      return 4;
-    case baseTypeDouble:
-      return 8;
-    case baseTypeLongDouble:
-      return 16;
-    default:
-      return 0;
-    }
-  }
-      
-  /**
-   * @param type
-   * @return true if type is a byte, short, or int.
-   */
-  public final static boolean isInteger(int type)
-  {
-    switch (type)
-    {
-    case baseTypeByte:
-    case baseTypeUnsignedByte:
-    case baseTypeShort:
-    case baseTypeUnsignedShort:
-    case baseTypeInteger:
-    case baseTypeUnsignedInteger:
-      return true;
-    default:
-      return false;
-    }
-  }
-    
-  /**
-   * @param type
-   * @return true if type is a byte, short, int, or long.
-   */
-  public final static boolean isLong(int type)
-  {
-    switch (type)
-    {
-    case baseTypeByte:
-    case baseTypeUnsignedByte:
-    case baseTypeShort:
-    case baseTypeUnsignedShort:
-    case baseTypeInteger:
-    case baseTypeUnsignedInteger:
-    case baseTypeLong:
-    case baseTypeUnsignedLong:
-      return true;
-    default:
-      return false;
-    }
-  }
-
-  /**
-   * @param type
-   * @return true if type is a float or double.
-   */
-  public final static boolean isFloat(int type)
-  {
-    switch (type)
-    {
-    case baseTypeFloat:
-    case baseTypeDouble:
-    case baseTypeLongDouble:
-      return true;
-    default:
-      return false;
-    }
-  }
-}
diff --git a/frysk-sys/lib/dwfl/ChangeLog b/frysk-sys/lib/dwfl/ChangeLog
index 010d55b..7debe8b 100644
--- a/frysk-sys/lib/dwfl/ChangeLog
+++ b/frysk-sys/lib/dwfl/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-20  Stan Cox  <scox@redhat.com>
+
+	* BaseTypes.java: Remove.
+	* DwarfDie.java (getBaseType): Remove.
+	* cni/DwarfDie.cxx (DwarfDie:::get_base_type): Remove
+
 2007-11-15  Sami Wagiaalla  <swagiaal@toner.toronto.redhat.com>
 
 	* DwAttributeNotFoundException.java: New file.
diff --git a/frysk-sys/lib/dwfl/DwarfDie.java b/frysk-sys/lib/dwfl/DwarfDie.java
index 63e7cfe..0868d42 100644
--- a/frysk-sys/lib/dwfl/DwarfDie.java
+++ b/frysk-sys/lib/dwfl/DwarfDie.java
@@ -226,13 +226,6 @@ abstract public class DwarfDie {
 	return die;
     }
 
-    /**
-     * @return the scalar type for this type die.
-     */
-    public int getBaseType() {
-	return get_base_type(this.getPointer());
-    }
-  
     public boolean getAttrBoolean(DwAt attr) {
 	return get_attr_boolean(this.getPointer(), attr.hashCode());
     }
@@ -325,25 +318,11 @@ abstract public class DwarfDie {
     }
     
     public String toString() {
-	String typeStr;
+	StringBuilder stringBuilder= new StringBuilder();
 	DwarfDie type = getUltimateType();
-	if (type == null)
-	    typeStr = "void";
-	else if (type.getBaseType() == BaseTypes.baseTypeLong)
-	    typeStr = "long";
-	else if (type.getBaseType() == BaseTypes.baseTypeInteger)
-	    typeStr = "int";
-	else if (type.getBaseType() == BaseTypes.baseTypeShort)
-	    typeStr = "short";
-	else if (type.getBaseType() == BaseTypes.baseTypeByte)
-	    typeStr = "short";
-	else if (type.getBaseType() == BaseTypes.baseTypeFloat)
-	    typeStr = "float";
-	else if (type.getBaseType() == BaseTypes.baseTypeDouble)
-	    typeStr = "double";
-	else
-	    typeStr = "";
-	return typeStr;
+	stringBuilder.append(this.getTag() + " Name: " + this.getName());
+	stringBuilder.append(" Type: " + type.toString());
+	return stringBuilder.toString();
     }
   
     public StringBuilder toPrint(){
@@ -436,8 +415,6 @@ abstract public class DwarfDie {
   
     private native long get_sibling (long addr);
   
-    private native int get_base_type (long addr);
-
     private native boolean get_attr_boolean (long addr, int attr);
   
     private native int get_attr_constant (long addr, int attr);
diff --git a/frysk-sys/lib/dwfl/cni/DwarfDie.cxx b/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
index af9ab88..810882e 100644
--- a/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
+++ b/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
@@ -47,7 +47,6 @@
 #include <java/util/ArrayList.h>
 
 #include "lib/dwfl/DwarfDie.h"
-#include "lib/dwfl/BaseTypes.h"
 #include "lib/dwfl/DwarfDieFactory.h"
 #include "lib/dwfl/DwarfException.h"
 #include "lib/dwfl/DwAttributeNotFoundException.h"
@@ -399,64 +398,6 @@ lib::dwfl::DwarfDie::get_original_die (jlong var_die)
 }
 
 jint
-lib::dwfl::DwarfDie::get_base_type (jlong var_die)
-{
-  Dwarf_Die *type_die = (Dwarf_Die*) var_die;
-  Dwarf_Attribute type_attr;
-  while (type_die && (dwarf_tag (type_die) == DW_TAG_volatile_type
-		      || (dwarf_tag (type_die) == DW_TAG_const_type)))
-    {
-      dwarf_attr_integrate (type_die, DW_AT_type, &type_attr);
-      dwarf_formref_die (&type_attr, type_die);
-    }
-  
-  if (dwarf_tag (type_die) == DW_TAG_base_type)
-    {
-      Dwarf_Word byte_size;
-      Dwarf_Word encoding;
-      Dwarf_Attribute type_attr;
-      if (dwarf_attr_integrate (type_die, DW_AT_byte_size, &type_attr))
-	dwarf_formudata (&type_attr, &byte_size);
-      else return 0;
-      if (dwarf_attr_integrate (type_die, DW_AT_encoding, &type_attr))
-	dwarf_formudata (&type_attr, &encoding);
-      switch (byte_size)
-	{
-	case 1:
-	  switch (encoding)
-	    {
-	    case DW_ATE_signed: return lib::dwfl::BaseTypes::baseTypeByte;
-	    case DW_ATE_unsigned: return lib::dwfl::BaseTypes::baseTypeUnsignedByte;
-	    case DW_ATE_signed_char: return lib::dwfl::BaseTypes::baseTypeChar;
-	    case DW_ATE_unsigned_char: return lib::dwfl::BaseTypes::baseTypeUnsignedChar;
-	    }
-	case 2:
-	  switch (encoding)
-	    {
-	    case DW_ATE_signed: return lib::dwfl::BaseTypes::baseTypeShort;
-	    case DW_ATE_unsigned: return lib::dwfl::BaseTypes::baseTypeUnsignedShort;
-	    case DW_ATE_unsigned_char: return lib::dwfl::BaseTypes::baseTypeUnicode;
-	    }
-	case 4:
-	  switch (encoding)
-	    {
-	    case DW_ATE_signed: return lib::dwfl::BaseTypes::baseTypeInteger;
-	    case DW_ATE_unsigned: return lib::dwfl::BaseTypes::baseTypeUnsignedInteger;
-	    case DW_ATE_float: return lib::dwfl::BaseTypes::baseTypeFloat;
-	    }
-	case 8:
-	  switch (encoding)
-	    {
-	    case DW_ATE_signed: return lib::dwfl::BaseTypes::baseTypeLong;
-	    case DW_ATE_unsigned: return lib::dwfl::BaseTypes::baseTypeUnsignedLong;
-	    case DW_ATE_float: return lib::dwfl::BaseTypes::baseTypeDouble;
-	    }
-	}
-    }
-  return 0;
-}
-
-jint
 lib::dwfl::DwarfDie::get_tag (jlong die_p)
 {
   Dwarf_Die *die = (Dwarf_Die*)die_p;


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



More information about the Frysk-cvs mailing list