public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Fix lookup where there is no symbol.
@ 2008-06-20  2:34 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-06-20  2:34 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  a9eb3c2804253d3206bc429404bffc78ecb83b4e (commit)
      from  c739492c8f74c2ac21aee9dd17f7bad43cd413c5 (commit)

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

- Log -----------------------------------------------------------------
commit a9eb3c2804253d3206bc429404bffc78ecb83b4e
Author: Andrew Cagney <cagney@redhat.com>
Date:   Thu Jun 19 22:34:21 2008 -0400

    Fix lookup where there is no symbol.
    
    frysk-core/frysk/symtab/ChangeLog
    2008-06-19  Andrew Cagney  <cagney@redhat.com>
    
    	* TestSymbol.java (testNoSymbolAfterGlobal()): Enable.
    	(testNoSymbolAfterLocal()): Enable.
    	(testAfterGlobalContiningSize0()): Enable.
    	(testAfterLocalContiningSize0()): Enable.
    
    frysk-imports/elfutils/libdwfl/ChangeLog
    2008-06-19  Andrew Cagney  <cagney@redhat.com>
    
    	* dwfl_module_addrsym.c (dwfl_module_addrsym): Correctly update
    	min_label.

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

Summary of changes:
 frysk-core/frysk/symtab/ChangeLog                  |    5 ++++
 frysk-core/frysk/symtab/TestSymbol.java            |    8 -------
 frysk-imports/elfutils/libdwfl/ChangeLog           |    5 ++++
 .../elfutils/libdwfl/dwfl_module_addrsym.c         |   21 +++++++++++++++----
 4 files changed, 26 insertions(+), 13 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/symtab/ChangeLog b/frysk-core/frysk/symtab/ChangeLog
index a7910a0..33bc6fb 100644
--- a/frysk-core/frysk/symtab/ChangeLog
+++ b/frysk-core/frysk/symtab/ChangeLog
@@ -1,5 +1,10 @@
 2008-06-19  Andrew Cagney  <cagney@redhat.com>
 
+	* TestSymbol.java (testNoSymbolAfterGlobal()): Enable.
+	(testNoSymbolAfterLocal()): Enable.
+	(testAfterGlobalContiningSize0()): Enable.
+	(testAfterLocalContiningSize0()): Enable.
+	
 	* TestSymbol.java: Re-number arg param so that matching
 	funit-symbols.S is easier.
 
diff --git a/frysk-core/frysk/symtab/TestSymbol.java b/frysk-core/frysk/symtab/TestSymbol.java
index a94c2ae..a0228b3 100644
--- a/frysk-core/frysk/symtab/TestSymbol.java
+++ b/frysk-core/frysk/symtab/TestSymbol.java
@@ -149,13 +149,9 @@ public class TestSymbol
     }
 
     public void testNoSymbolAfterGlobal() {
-        if (unresolved(5941))
-            return;
 	symbolTest(12, unknown, false, false);
     }
     public void testNoSymbolAfterLocal() {
-        if (unresolved(5941))
-            return;
 	symbolTest(13, unknown, false, false);
     }
 
@@ -195,13 +191,9 @@ public class TestSymbol
     }
 
     public void testAfterGlobalContiningSize0() {
-        if (unresolved(5941))
-            return;
 	symbolTest(24, unknown, false, false);
     }
     public void testAfterLocalContiningSize0() {
-        if (unresolved(5941))
-            return;
 	symbolTest(25, unknown, false, false);
     }
 }
diff --git a/frysk-imports/elfutils/libdwfl/ChangeLog b/frysk-imports/elfutils/libdwfl/ChangeLog
index ac95d68..e1d00f1 100644
--- a/frysk-imports/elfutils/libdwfl/ChangeLog
+++ b/frysk-imports/elfutils/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-19  Andrew Cagney  <cagney@redhat.com>
+
+	* dwfl_module_addrsym.c (dwfl_module_addrsym): Correctly update
+	min_label.
+
 2008-06-07  Andrew Cagney  <cagney@redhat.com>
 
 	* dwfl_module_getdwarf.c (open_elf): Don't align the module's load
diff --git a/frysk-imports/elfutils/libdwfl/dwfl_module_addrsym.c b/frysk-imports/elfutils/libdwfl/dwfl_module_addrsym.c
index c34a31b..77033a6 100644
--- a/frysk-imports/elfutils/libdwfl/dwfl_module_addrsym.c
+++ b/frysk-imports/elfutils/libdwfl/dwfl_module_addrsym.c
@@ -49,10 +49,13 @@
 
 #include "libdwflP.h"
 
+#include <stdio.h>
+
 const char *
 dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
 		     GElf_Sym *closest_sym, GElf_Word *shndxp)
 {
+  // fprintf(stderr, "looking up %lx\n", (long) addr);
   int syments = INTUSE(dwfl_module_getsymtab) (mod);
   if (syments < 0)
     return NULL;
@@ -116,15 +119,20 @@ dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
       GElf_Sym sym;
       GElf_Word shndx;
       const char *name = INTUSE(dwfl_module_getsym) (mod, i, &sym, &shndx);
+      // fprintf(stderr, "symbol %s at 0x%lx 0x%ld\n", name, (long) sym.st_value, (long) sym.st_size);
+      /* Even if we don't choose this symbol, its existence excludes
+	 any sizeless symbol (assembly label) that is below its upper
+	 bound.  */
+      if (name != NULL && sym.st_value <= addr
+	  && sym.st_value + sym.st_size > min_label) {
+	min_label = sym.st_value + sym.st_size;
+	// fprintf(stderr, "  min to %s size ends at %lx\n", name, (long) min_label);
+      }
       if (name != NULL
 	  && sym.st_value <= addr
 	  && (sym.st_size == 0 || addr - sym.st_value < sym.st_size))
 	{
-	  /* Even if we don't choose this symbol, its existence
-	     excludes any sizeless symbol (assembly label) that
-	     is inside its bounds.  */
-	  if (sym.st_value + sym.st_size > addr)
-	    min_label = sym.st_value + sym.st_size;
+	  // fprintf(stderr, "  candidate %s at 0x%lx 0x%ld\n", name, (long) sym.st_value, (long) sym.st_size);
 
 	  /* This symbol is a better candidate than the current one
 	     if it's a named symbol, not a section or file symbol,
@@ -140,6 +148,7 @@ dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
 		{
 		  if (sym.st_size != 0)
 		    {
+		      // fprintf(stderr, "  closest %s at %lx\n", name, (long)sym.st_value);
 		      *closest_sym = sym;
 		      closest_shndx = shndx;
 		      closest_name = name;
@@ -155,6 +164,7 @@ dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
                           || (sizeless_sym.st_value == sym.st_value
                               && strcmp(name, sizeless_name) < 0))
                         {
+			  // fprintf(stderr, "  sizeless %s at %lx\n", name, (long)sym.st_value);
                           sizeless_sym = sym;
                           sizeless_shndx = shndx;
                           sizeless_name = name;
@@ -171,6 +181,7 @@ dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
                            || (closest_sym->st_size == sym.st_size
                                && strcmp(name, closest_name) < 0)))
 		{
+		  // fprintf(stderr, "  alt closest %s at %lx\n", name, (long)sym.st_value);
 		  *closest_sym = sym;
 		  closest_shndx = shndx;
 		  closest_name = name;


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


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

only message in thread, other threads:[~2008-06-20  2:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-20  2:34 [SCM] master: Fix lookup where there is no symbol cagney

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