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: swagiaal: Added check for static vs. dynamic member functions.


The branch, master has been updated
       via  210928258af6f0eaeb957a812b39eee1a7e61553 (commit)
      from  35cc78c82c7872b85563e4981c8e0603b5bd8893 (commit)

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

- Log -----------------------------------------------------------------
commit 210928258af6f0eaeb957a812b39eee1a7e61553
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Nov 22 16:10:29 2007 -0500

    swagiaal: Added check for static vs. dynamic member functions.
    
    frysk-core/frysk/debuginfo/ChangeLog
    +2007-11-22  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +       * TypeEntry.java (getGccStructOrClassType): Now checks for static
    +       member functions.
    +       (hasArtifitialParameter): New.
    +

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

Summary of changes:
 frysk-core/frysk/debuginfo/ChangeLog      |    6 +++++
 frysk-core/frysk/debuginfo/TypeEntry.java |   32 +++++++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 2 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 33d0db3..868dcd0 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,5 +1,11 @@
 2007-11-22  Sami Wagiaalla  <swagiaal@redhat.com>
 
+	* TypeEntry.java (getGccStructOrClassType): Now checks for static
+	member functions.
+	(hasArtifitialParameter): New.
+
+2007-11-22  Sami Wagiaalla  <swagiaal@redhat.com>
+
 	* TestTypeEntry.java (testClassWithStaticMembers): Added test for static
 	and dynamic data members and member functions.
 	(getGccStructOrClassType): Added Check for static data members.
diff --git a/frysk-core/frysk/debuginfo/TypeEntry.java b/frysk-core/frysk/debuginfo/TypeEntry.java
index a33b6a1..2e8d01f 100644
--- a/frysk-core/frysk/debuginfo/TypeEntry.java
+++ b/frysk-core/frysk/debuginfo/TypeEntry.java
@@ -154,8 +154,11 @@ public class TypeEntry
 	    
 	    if (member.getTag() == DwTag.SUBPROGRAM) {
 		Value v = getSubprogramValue(member);
-		classType.addMember(member.getName(), v.getType(), offset,
-			access);
+		if(hasArtifitialParameter(member)){
+		    classType.addMember(member.getName(), v.getType(), offset, access);
+		}else{
+		    classType.addStaticMember(member.getName(), v.getType(), offset, access);
+		}
 		continue;
 	    }
 	    
@@ -203,6 +206,31 @@ public class TypeEntry
 	return classType;
     }
 
+    /**
+     * Return true of the given die represents a 
+     * subprogram or inlined subroutine
+     * @param die
+     * @return 
+     */
+    private boolean hasArtifitialParameter(DwarfDie die){
+	if (die == null
+		|| !(die.getTag().equals(DwTag.SUBPROGRAM) ||
+		die.getTag().equals(DwTag.INLINED_SUBROUTINE))) {
+	    throw new IllegalArgumentException("Die [" + die + "] is not" +
+	    		" a subprogram or inlined subroutine die");
+	}
+
+	DwarfDie param = die.getChild();
+	while (param != null
+		&& param.getTag().equals(DwTag.FORMAL_PARAMETER)) {
+	    if (param.getAttrBoolean((DwAt.ARTIFICIAL)) == true) {
+		return true;
+	    }       
+	    param = param.getSibling();
+	}
+	return false;
+    }
+    
     // ??? Reduce getGccStructOrClassType/getUnionType duplication
     public UnionType getUnionType(DwarfDie classDie, String name) {
 	dumpDie("unionDie=", classDie);


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]