public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: swagiaal: Added support for funciton lookup.
@ 2008-04-22 20:13 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-04-22 20:13 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  185ec8496473fb1b228db8216f9eac66d6f90fdb (commit)
      from  3221560a32ff46342a67f8ea70491c2a3b2bbfc7 (commit)

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

- Log -----------------------------------------------------------------
commit 185ec8496473fb1b228db8216f9eac66d6f90fdb
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Tue Apr 22 16:11:31 2008 -0400

    swagiaal: Added support for funciton lookup.
    
    frysk-core/frysk/debuginfo/ChangeLog
    +2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* TestObjectDeclarationSearchEngine.java: Added test for
    +	function search.
    +
    
    frysk-core/frysk/scopes/ChangeLog
    +2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* Scope.java: Now looks at NameScopes as well
    +	as variables.
    +
    
    frysk-sys/lib/dwfl/ChangeLog
    +2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* cni/DwarfDie.cxx(get_type): changed while
    +	loop to if.
    +

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

Summary of changes:
 frysk-core/frysk/debuginfo/ChangeLog               |    5 +++
 .../TestObjectDeclarationSearchEngine.java         |    8 +++++
 frysk-core/frysk/pkglibdir/funit-scopes.c          |    2 +-
 frysk-core/frysk/scopes/ChangeLog                  |    5 +++
 frysk-core/frysk/scopes/Scope.java                 |   29 ++++++++++++++++++-
 frysk-sys/lib/dwfl/ChangeLog                       |    5 +++
 frysk-sys/lib/dwfl/cni/DwarfDie.cxx                |    2 +-
 7 files changed, 52 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 54398b0..88209c7 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
+
+	* TestObjectDeclarationSearchEngine.java: Added test for
+	function search.
+
 2008-04-21  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* ObjectDeclarationSearchEngine.java(getSymbolDie): now
diff --git a/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java b/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java
index 6362746..a198550 100644
--- a/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java
+++ b/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java
@@ -140,6 +140,14 @@ public class TestObjectDeclarationSearchEngine extends TestLib{
 	verifyVariable(variableName, variableToken, fileName, srcPath);
     }
     
+    public void testFindFirstScopes(){
+	String variableName = "first"; 
+	String variableToken = "*this*"; 
+	String fileName = "funit-scopes";
+	File srcPath = getSrc(fileName + ".c");
+	
+	verifyVariable(variableName, variableToken, fileName, srcPath);
+    }    
     
     public void testFindFirstElfSymbols(){
 	String variableName = "first"; 
diff --git a/frysk-core/frysk/pkglibdir/funit-scopes.c b/frysk-core/frysk/pkglibdir/funit-scopes.c
index ce25c11..2c8dccf 100644
--- a/frysk-core/frysk/pkglibdir/funit-scopes.c
+++ b/frysk-core/frysk/pkglibdir/funit-scopes.c
@@ -5,7 +5,7 @@ inline void second(){
   a[0] = 0;
 }
 
-void first(){
+void first(){// *this* one should be found
   second();
 }
 
diff --git a/frysk-core/frysk/scopes/ChangeLog b/frysk-core/frysk/scopes/ChangeLog
index 0389deb..7903933 100644
--- a/frysk-core/frysk/scopes/ChangeLog
+++ b/frysk-core/frysk/scopes/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com> 
+
+	* Scope.java: Now looks at NameScopes as well
+	as variables.
+	
 2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* InlinedSubroutine.java: Renamed this...
diff --git a/frysk-core/frysk/scopes/Scope.java b/frysk-core/frysk/scopes/Scope.java
index e753ef2..d7afa2e 100644
--- a/frysk-core/frysk/scopes/Scope.java
+++ b/frysk-core/frysk/scopes/Scope.java
@@ -82,6 +82,7 @@ public class Scope
     
     final TypeFactory typeFactory;
     private final SourceLocation sourceLocation;
+    private LinkedList objectDeclarations;
     
   public Scope(DwarfDie die, TypeFactory typeFactory){
       this.die = die;
@@ -128,6 +129,30 @@ public class Scope
       return variables;
   }
 
+  public LinkedList getObjectDeclarations() {
+      if (this.objectDeclarations == null) {
+	  this.objectDeclarations = new LinkedList();
+	  DwarfDie die = this.die.getChild();
+	  
+	  while (die != null) {
+	      
+	      try{
+		  Scope scope = ScopeFactory.theFactory.getScope(die, typeFactory);
+		  if (scope instanceof NamedScope) {
+		      this.objectDeclarations.add(scope);
+		  }
+	      } catch (IllegalArgumentException e) {
+		    if (die.getTag().equals(DwTag.VARIABLE)) {
+			Variable variable = new Variable(die);
+			objectDeclarations.add(variable);
+		    }
+		}
+	      die = die.getSibling();
+	  }
+      }
+      return objectDeclarations;
+  }
+
   public SourceLocation getSourceLocation(){
       return this.sourceLocation;
   }
@@ -172,9 +197,9 @@ public class Scope
   public ObjectDeclaration getDeclaredObjectByName(String name){
       ObjectDeclaration objectDeclaration = null;
       
-      Iterator iterator = this.getVariables().iterator();
+      Iterator iterator = this.getObjectDeclarations().iterator();
       while (iterator.hasNext()) {
-	objectDeclaration = (Variable) iterator.next();
+	objectDeclaration = (ObjectDeclaration) iterator.next();
 	if(objectDeclaration.getName().equals(name)){
 	    return objectDeclaration;
 	}
diff --git a/frysk-sys/lib/dwfl/ChangeLog b/frysk-sys/lib/dwfl/ChangeLog
index 2097fd6..b00889e 100644
--- a/frysk-sys/lib/dwfl/ChangeLog
+++ b/frysk-sys/lib/dwfl/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
+
+	* cni/DwarfDie.cxx(get_type): changed while
+	loop to if.
+
 2008-04-21  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* DwarfDie.java: wrapped getEntryPC()
diff --git a/frysk-sys/lib/dwfl/cni/DwarfDie.cxx b/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
index 0d5a07e..5b82f52 100644
--- a/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
+++ b/frysk-sys/lib/dwfl/cni/DwarfDie.cxx
@@ -342,7 +342,7 @@ lib::dwfl::DwarfDie::get_type (jlong var_die, jboolean follow_type_def)
     {
       if (dwarf_formref_die (&type_attr, type_mem_die))
 	{
-	  while (dwarf_tag (type_mem_die) == DW_TAG_typedef && follow_type_def)
+	  if (dwarf_tag (type_mem_die) == DW_TAG_typedef && follow_type_def)
 	    {
 	      dwarf_attr_integrate (type_mem_die, DW_AT_type, &type_attr);
 	      dwarf_formref_die (&type_attr, type_mem_die);


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


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

only message in thread, other threads:[~2008-04-22 20:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-22 20:13 [SCM] master: swagiaal: Added support for funciton lookup 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).