public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: swagiaal: Added check for static vs. dynamic member functions.
@ 2007-11-22 21:49 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2007-11-22 21:49 UTC (permalink / raw)
  To: frysk-cvs

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


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

only message in thread, other threads:[~2007-11-22 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-22 21:49 [SCM] master: swagiaal: Added check for static vs. dynamic member functions swagiaal

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