From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7915 invoked by alias); 22 Nov 2007 21:49:42 -0000 Received: (qmail 7888 invoked by uid 9561); 22 Nov 2007 21:49:42 -0000 Date: Thu, 22 Nov 2007 21:49:00 -0000 Message-ID: <20071122214942.7871.qmail@sourceware.org> From: swagiaal@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: swagiaal: Added check for static vs. dynamic member functions. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 35cc78c82c7872b85563e4981c8e0603b5bd8893 X-Git-Newrev: 210928258af6f0eaeb957a812b39eee1a7e61553 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2007-q4/txt/msg00438.txt.bz2 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 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 + + * 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 + * TypeEntry.java (getGccStructOrClassType): Now checks for static + member functions. + (hasArtifitialParameter): New. + +2007-11-22 Sami Wagiaalla + * 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