public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Fix ftrace spurious warnings about breakpoint address mismatch
@ 2008-04-25 21:52 pmachata
  0 siblings, 0 replies; only message in thread
From: pmachata @ 2008-04-25 21:52 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  6479f1dc64b016f88287646c88eca9628f8732a8 (commit)
       via  84ac0985a57e4f1a34f8ba765b1c73c96f86333b (commit)
       via  cacf2720ab6de856853adec3fc6b820284ea75cc (commit)
       via  094d5954e47a4df67af152b300341f319dfdaac7 (commit)
       via  276f5316c14f3ca54f1f108da45888b28ac1964d (commit)
       via  f560ed41d23522091b0ed62c1567b0b8e4eb5a3e (commit)
       via  1f0befe2784302ff9db40c1b3f76f724a6a3dd1e (commit)
       via  6456418537da9e29f9610c0c195bb44d085cb531 (commit)
      from  7ec5eccf2b3df6cae57c60ff14a7bbc2b6803718 (commit)

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

- Log -----------------------------------------------------------------
commit 6479f1dc64b016f88287646c88eca9628f8732a8
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 21:05:25 2008 +0200

    Fix ftrace spurious warnings about breakpoint address mismatch

commit 84ac0985a57e4f1a34f8ba765b1c73c96f86333b
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 20:36:05 2008 +0200

    Nits

commit cacf2720ab6de856853adec3fc6b820284ea75cc
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 20:35:48 2008 +0200

    Use DwflDieBias for module public names
    
    * DwflModule yields list of biased Dies
    * Ctor of FunctionBreakpoint takes biased Die
    * Ctor of DwflSymbol takes biased Die
    * SymbolFactory was adjusted to above

commit 094d5954e47a4df67af152b300341f319dfdaac7
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 20:20:36 2008 +0200

    DwflDieBias has new method getEntryBreakpoints
    
    * it biases entry breakpoints fetched from underlying DwarfDie

commit 276f5316c14f3ca54f1f108da45888b28ac1964d
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 20:09:04 2008 +0200

    Nits in naming in BreakpointManager

commit f560ed41d23522091b0ed62c1567b0b8e4eb5a3e
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Apr 25 20:08:40 2008 +0200

    TaskTracer.traceSymbol should only log when tracing was actually requested

commit 1f0befe2784302ff9db40c1b3f76f724a6a3dd1e
Author: Petr Machata <pmachata@redhat.com>
Date:   Mon Apr 14 13:11:36 2008 +0200

    Manpage fixes

commit 6456418537da9e29f9610c0c195bb44d085cb531
Author: Petr Machata <pmachata@redhat.com>
Date:   Mon Apr 14 13:11:25 2008 +0200

    Support ^ in Glob class
    
    * necessary because [^]] actually forms a legal glob pattern.

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

Summary of changes:
 frysk-core/frysk/bindir/ftrace.xml-in       |   19 +++++-----
 frysk-core/frysk/ftrace/ChangeLog           |    9 +++++
 frysk-core/frysk/ftrace/TaskTracer.java     |   11 +++++-
 frysk-core/frysk/rt/BreakpointManager.java  |    6 ++--
 frysk-core/frysk/rt/ChangeLog               |    5 +++
 frysk-core/frysk/rt/FunctionBreakpoint.java |   24 ++++++------
 frysk-core/frysk/rt/PLTBreakpoint.java      |    2 +-
 frysk-core/frysk/rt/SymbolBreakpoint.java   |    3 +-
 frysk-core/frysk/symtab/ChangeLog           |    5 +++
 frysk-core/frysk/symtab/DwflSymbol.java     |   12 +++---
 frysk-core/frysk/symtab/SymbolFactory.java  |   17 +++++----
 frysk-core/frysk/util/ChangeLog             |    4 ++
 frysk-core/frysk/util/Glob.java             |    4 ++
 frysk-sys/lib/dwfl/ChangeLog                |   12 ++++++
 frysk-sys/lib/dwfl/DwflDieBias.java         |   16 ++++++++-
 frysk-sys/lib/dwfl/cni/DwflModule.cxx       |   49 +++++++++++++++++---------
 16 files changed, 138 insertions(+), 60 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ftrace.xml-in b/frysk-core/frysk/bindir/ftrace.xml-in
index cda22db..f43fb9e 100644
--- a/frysk-core/frysk/bindir/ftrace.xml-in
+++ b/frysk-core/frysk/bindir/ftrace.xml-in
@@ -245,7 +245,7 @@
     following process takes place.  Initial working set is empty.
     Rules, if present, are then enumerated from left to right, and set
     is modified depending on the rules.  Rules are delimited by a
-    colon.  Syntax of each rule is following:</para>
+    comma.  Syntax of each rule is following:</para>
 
     <para>[-][#]<replaceable>pattern</replaceable></para>
 
@@ -263,15 +263,16 @@
 
     <para>All three components, <replaceable>symbol</replaceable>,
     <replaceable>soname</replaceable> and
-    <replaceable>version</replaceable>, are written using extended
-    regular expression syntax.  Any of the components can be omitted,
-    missing component is then wild card matching anything.  By
-    extension, empty pattern matches all symbols of all versions in
-    all libraries and in the executable itself.</para>
+    <replaceable>version</replaceable>, are written using glob
+    expression syntax.  Any of the components can be omitted, missing
+    component is then wild card matching anything.  By extension,
+    empty pattern matches all symbols of all versions in all libraries
+    and in the executable itself.</para>
 
     <para><replaceable>symbol</replaceable> component is matched
-    against name of symbol associated with PLT slot under
-    consideration.  Whole symbol name has to match.</para>
+    against the name of symbol under consideration (or symbol
+    associated with PLT slot in case of -plt option).  Whole symbol
+    name has to match.</para>
 
     <para><replaceable>soname</replaceable> component is matched
     against a soname of a library in which we wish to track the call.
@@ -379,7 +380,7 @@
 
   <refsect1>
     <title>SEE ALSO</title>
-    <para>frysk(7)</para>
+    <para>frysk(7), glob(7)</para>
   </refsect1>
   
   <!-- refsect1>
diff --git a/frysk-core/frysk/ftrace/ChangeLog b/frysk-core/frysk/ftrace/ChangeLog
index cd81538..eb2f46b 100644
--- a/frysk-core/frysk/ftrace/ChangeLog
+++ b/frysk-core/frysk/ftrace/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* TaskTracer.java: Only warn about breakpoint address mismatch if
+	the breakpoint falls outside the borders of the traced symbol.
+
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* TaskTracer.java: Fix logging.
+
 2008-04-17  Andrew Cagney  <cagney@redhat.com>
 
 	* TestMappingGuard.java: Use frysk.config.Prefix.
diff --git a/frysk-core/frysk/ftrace/TaskTracer.java b/frysk-core/frysk/ftrace/TaskTracer.java
index b2625dc..d7c0589 100644
--- a/frysk-core/frysk/ftrace/TaskTracer.java
+++ b/frysk-core/frysk/ftrace/TaskTracer.java
@@ -70,6 +70,7 @@ class TaskTracer
     implements Ftrace.Driver
 {
     static private final Log fine = LogFactory.fine(TaskTracer.class);
+    static private final Log finest = LogFactory.finest(TaskTracer.class);
     static private final Log warning = LogFactory.warning(TaskTracer.class);
 
     // Map<Long(address), FunctionReturnObserver>
@@ -242,7 +243,11 @@ class TaskTracer
 	}
 
     	public void updateHit(SourceBreakpoint breakpoint, Task task, long address) {
-	    if (!isPlt && sym.getAddress() != address)
+	    if (!isPlt
+		&& (address < sym.getAddress()
+		    // Some symbols are reported with size 0, and for
+		    // these we want to allow addr == getAddr + getSize
+		    || address > sym.getAddress() + sym.getSize()))
 		warning.log("Breakpoint requested for", sym.getAddress(),
 			    "hits at", address, "for symbol", sym);
 
@@ -296,14 +301,16 @@ class TaskTracer
 	if (alreadyTracing.contains(sym))
 	    return;
 
-	fine.log("Request for tracing symbol", sym);
 	if (sym.isFunctionSymbol() && sym.getAddress() != 0) {
+	    fine.log("Request for tracing symbol", sym, "at", sym.getAddress());
 	    alreadyTracing.add(sym);
 	    BreakpointManager bpManager = Ftrace.steppingEngine.getBreakpointManager();
 	    final SymbolBreakpoint bp = bpManager.addSymbolBreakpoint(sym);
 	    bp.addObserver(new FunctionEnterObserver(sym));
 	    bpManager.enableBreakpoint(bp, task);
 	}
+	else
+	    finest.log("Ignoring request for tracing undefined or non-functional symbol", sym);
     }
 
     public void tracePLTEntry(Task task, PLTEntry entry)
diff --git a/frysk-core/frysk/rt/BreakpointManager.java b/frysk-core/frysk/rt/BreakpointManager.java
index 8582d3c..3a70760 100644
--- a/frysk-core/frysk/rt/BreakpointManager.java
+++ b/frysk-core/frysk/rt/BreakpointManager.java
@@ -167,7 +167,7 @@ public class BreakpointManager extends Observable {
     /**
      * Create a symbol breakpoint not associated with any process
      * @param symbol the symbol to breakpoint at
-     * @return FunctionBreakpoint object
+     * @return SymbolBreakpoint object
      */
     public SymbolBreakpoint addSymbolBreakpoint(DwflSymbol symbol) {
 	SymbolBreakpoint sourceBreakpoint =
@@ -196,9 +196,9 @@ public class BreakpointManager extends Observable {
      * performed.
      * @return FunctionBreakpoint object
      */
-    public FunctionBreakpoint addFunctionBreakpoint(String name, ObjectDeclaration die) {
+    public FunctionBreakpoint addFunctionBreakpoint(String name, ObjectDeclaration decl) {
 	FunctionBreakpoint sourceBreakpoint =
-	    new FunctionBreakpoint(CountManager.getNextId(), name, die);
+	    new FunctionBreakpoint(CountManager.getNextId(), name, decl);
 	addBreakpoint(sourceBreakpoint);
 	return sourceBreakpoint;
     }
diff --git a/frysk-core/frysk/rt/ChangeLog b/frysk-core/frysk/rt/ChangeLog
index a979da0..4dbc66f 100644
--- a/frysk-core/frysk/rt/ChangeLog
+++ b/frysk-core/frysk/rt/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* FunctionBreakpoint.java: Use DwflDieBias instead of DwarfDie to
+	record the `die' type.
+
 2008-04-23  Teresa Thomas  <tthomas@redhat.com>
 
 	* Breakpoint.java (updateHit): 
diff --git a/frysk-core/frysk/rt/FunctionBreakpoint.java b/frysk-core/frysk/rt/FunctionBreakpoint.java
index 4a3ead8..26c8a61 100644
--- a/frysk-core/frysk/rt/FunctionBreakpoint.java
+++ b/frysk-core/frysk/rt/FunctionBreakpoint.java
@@ -10,11 +10,11 @@
 // WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU General Public License
 // along with FRYSK; if not, write to the Free Software Foundation,
 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
+//
 // In addition, as a special exception, Red Hat, Inc. gives You the
 // additional right to link the code of FRYSK with code not covered
 // under the GNU General Public License ("Non-GPL Code") and to
@@ -46,7 +46,7 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.ListIterator;
 
-import lib.dwfl.DwarfDie;
+import lib.dwfl.DwflDieBias;
 import lib.dwfl.die.InlinedSubroutine;
 import frysk.proc.Task;
 import frysk.scopes.ConcreteInlinedFunction;
@@ -58,7 +58,7 @@ import frysk.value.ObjectDeclaration;
 public class FunctionBreakpoint
   extends SourceBreakpoint {
     protected final String name;
-    protected final DwarfDie die;
+    protected final DwflDieBias die;
 
     private boolean containsInlineInstances = false;
     private Function function;
@@ -66,7 +66,7 @@ public class FunctionBreakpoint
     /**
      * Set a breakpoint based on a DwarfDie or just a name.
      */
-    public FunctionBreakpoint(int id, String name, DwarfDie die) {
+    public FunctionBreakpoint(int id, String name, DwflDieBias die) {
         super(id);
         this.name = name;
         this.die = die;
@@ -80,7 +80,7 @@ public class FunctionBreakpoint
     }
 
     public LinkedList getBreakpointRawAddresses(Task task) {
-	
+
 	if (function != null) {
 	    if (function instanceof OutOfLineFunction) {
 		long address = ((OutOfLineFunction) function).getBreakPointAddress();
@@ -88,7 +88,7 @@ public class FunctionBreakpoint
 		addrs.add(new Long(address));
 		return addrs;
 	    }
-	    
+
 	    if (function instanceof frysk.scopes.InlinedFunction) {
 		LinkedList inlinedInstances = ((frysk.scopes.InlinedFunction)function).getInlinedInstances();
 		Iterator iterator = inlinedInstances.iterator();
@@ -99,15 +99,15 @@ public class FunctionBreakpoint
 		}
 		return addrs;
 	    }
-	    
-	    
+
+
 	}
-	
+
 	if (die != null) {
 	    ArrayList entryAddrs = die.getEntryBreakpoints();
 	    ArrayList inlineDies = null;
-	    if (die.isInlineDeclaration()) {
-		inlineDies = die.getInlinedInstances();
+	    if (die.die.isInlineDeclaration()) {
+		inlineDies = die.die.getInlinedInstances();
 	    }
 	    LinkedList addrs;
 	    if (entryAddrs == null)
diff --git a/frysk-core/frysk/rt/PLTBreakpoint.java b/frysk-core/frysk/rt/PLTBreakpoint.java
index e1ee76a..9a86874 100644
--- a/frysk-core/frysk/rt/PLTBreakpoint.java
+++ b/frysk-core/frysk/rt/PLTBreakpoint.java
@@ -51,7 +51,7 @@ public class PLTBreakpoint
     private final PLTEntry entry;
 
     /**
-     * Set a breakpoint based on a DwflSymbol.
+     * Set a breakpoint based on a PLTEntry.
      */
     public PLTBreakpoint(int id, PLTEntry entry) {
 	super (id, entry.getSymbol().getName(), entry.getSymbol().getDie());
diff --git a/frysk-core/frysk/rt/SymbolBreakpoint.java b/frysk-core/frysk/rt/SymbolBreakpoint.java
index aff607b..a8a63b3 100644
--- a/frysk-core/frysk/rt/SymbolBreakpoint.java
+++ b/frysk-core/frysk/rt/SymbolBreakpoint.java
@@ -64,13 +64,14 @@ public class SymbolBreakpoint
 	if (die != null)
 	    return super.getBreakpointRawAddresses(task);
 	else {
-            // Filter any null values that have sneaked in.
 	    ModuleMatcher matcher = new ModuleMatcher() {
 		    public boolean moduleMatches(String moduleName) {
 			return moduleName.equals(symbol.getModule().getName());
 		    }
 		};
             LinkedList addrs = SymbolFactory.getAddresses(task, name, matcher);
+
+            // Filter any null values that have sneaked in.
             Long nullVal = new Long(0);
             while (addrs.remove(nullVal)) {
             }
diff --git a/frysk-core/frysk/symtab/ChangeLog b/frysk-core/frysk/symtab/ChangeLog
index 93c64fb..76b0007 100644
--- a/frysk-core/frysk/symtab/ChangeLog
+++ b/frysk-core/frysk/symtab/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* SymbolFactory.java: Use DwflDieBias.
+	* DwflSymbol.java: Likewise.
+
 2008-04-10  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	Changed ObjectDeclaration from abstract class to interface
diff --git a/frysk-core/frysk/symtab/DwflSymbol.java b/frysk-core/frysk/symtab/DwflSymbol.java
index 69e372a..d4861ce 100644
--- a/frysk-core/frysk/symtab/DwflSymbol.java
+++ b/frysk-core/frysk/symtab/DwflSymbol.java
@@ -45,21 +45,21 @@ package frysk.symtab;
  */
 
 import lib.dwfl.ElfSymbolType;
-import lib.dwfl.DwarfDie;
+import lib.dwfl.DwflDieBias;
 import lib.dwfl.DwflModule;
 
 public class DwflSymbol
     extends Symbol
 {
-    private final DwarfDie dwarfDie;
+    private final DwflDieBias dieBias;
     private final DwflModule dwflModule;
 
     // package private constructor.
     DwflSymbol(long address, long size, String name,
-	       ElfSymbolType type, DwarfDie die, DwflModule module)
+	       ElfSymbolType type, DwflDieBias dieBias, DwflModule module)
     {
 	super (address, size, name, type);
-	this.dwarfDie = die;
+	this.dieBias = dieBias;
 	this.dwflModule = module;
     }
 
@@ -67,7 +67,7 @@ public class DwflSymbol
 	return this.dwflModule;
     }
 
-    public DwarfDie getDie() {
-	return this.dwarfDie;
+    public DwflDieBias getDie() {
+	return this.dieBias;
     }
 }
diff --git a/frysk-core/frysk/symtab/SymbolFactory.java b/frysk-core/frysk/symtab/SymbolFactory.java
index 6a90891..38f6280 100644
--- a/frysk-core/frysk/symtab/SymbolFactory.java
+++ b/frysk-core/frysk/symtab/SymbolFactory.java
@@ -54,6 +54,7 @@ import frysk.rsl.LogFactory;
 
 import lib.dwfl.DwarfDie;
 import lib.dwfl.Dwfl;
+import lib.dwfl.DwflDieBias;
 import lib.dwfl.DwflModule;
 import lib.dwfl.SymbolBuilder;
 
@@ -113,8 +114,8 @@ public class SymbolFactory
     private static Map getPublicTable(final DwflModule module) {
 	final Map dwSymbols = new HashMap();
 	for (Iterator it = module.getPubNames().iterator(); it.hasNext(); ) {
-	    DwarfDie die = (DwarfDie)it.next();
-	    dwSymbols.put(die.getName(), die);
+	    DwflDieBias dieBias = (DwflDieBias)it.next();
+	    dwSymbols.put(dieBias.die.getName(), dieBias);
 	}
 	return dwSymbols;
     }
@@ -130,13 +131,14 @@ public class SymbolFactory
 				   lib.dwfl.ElfSymbolBinding bind,
 				   lib.dwfl.ElfSymbolVisibility visibility)
 		{
-		    DwarfDie die = publicTable == null ? null
-			: (DwarfDie)publicTable.get(name);
+		    DwflDieBias dieBias = publicTable == null ? null
+			: (DwflDieBias)publicTable.get(name);
 		    int index;
 		    if ((index = name.indexOf('@')) != -1)
 			name = name.substring(0, index);
 		    DwflSymbol sym
-			= new DwflSymbol(value, size, name, type, die, module);
+			= new DwflSymbol(value, size, name, type,
+					 dieBias, module);
 		    table.put(name, sym);
 		}
 	};
@@ -148,14 +150,15 @@ public class SymbolFactory
 	    Map.Entry entry = (Map.Entry)it.next();
 	    String name = (String)entry.getKey();
 	    if (!table.containsKey(name)) {
-		DwarfDie die = (DwarfDie)entry.getValue();
+		DwflDieBias dieBias = (DwflDieBias)entry.getValue();
+		DwarfDie die = dieBias.die;
 		ArrayList entries = die.getEntryBreakpoints();
 		if (entries != null) {
 		    long addr = ((Long)entries.get(0)).longValue();
 		    long size = die.getHighPC() - die.getLowPC();
 		    lib.dwfl.ElfSymbolType type = null; // XXX fixme
 		    table.put(name, new DwflSymbol(addr, size, die.getName(),
-						   type, die, module));
+						   type, dieBias, module));
 		}
 	    }
 	}
diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
index abfa081..11e965d 100644
--- a/frysk-core/frysk/util/ChangeLog
+++ b/frysk-core/frysk/util/ChangeLog
@@ -2,6 +2,10 @@
 
 	* TestCommandlineParser.java: Use frysk.config.Prefix.
 
+2008-04-14  Petr Machata  <pmachata@redhat.com>
+
+	* Glob.java (matchBrack): Support ^ for complement.
+
 2008-04-06  Petr Machata  <pmachata@redhat.com>
 
 	* ArchFormatter.java: New file.  Code moved from
diff --git a/frysk-core/frysk/util/Glob.java b/frysk-core/frysk/util/Glob.java
index acf93d3..49d36e7 100644
--- a/frysk-core/frysk/util/Glob.java
+++ b/frysk-core/frysk/util/Glob.java
@@ -62,6 +62,10 @@ public class Glob {
 	// On first character, both [ and ] are legal.  But when [ is
 	// foolowed with :, it's character class.
 	int i = from + 1;
+
+	if (glob.charAt(i) == '^') // Complement operator.
+	    ++i;
+
 	if (glob.charAt(i) == '[' && glob.charAt(i + 1) == ':')
 	    i = matchCharacterClass(glob, i) + 1;
 	else
diff --git a/frysk-sys/lib/dwfl/ChangeLog b/frysk-sys/lib/dwfl/ChangeLog
index b00889e..5e79324 100644
--- a/frysk-sys/lib/dwfl/ChangeLog
+++ b/frysk-sys/lib/dwfl/ChangeLog
@@ -1,3 +1,15 @@
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* cni/DwflModule.cxx (each_pubname_context): New struct.
+	(each_pubname): Moved to anonymous namespace.  Now yields
+	DwflDieBias objects.  Uses each_pubname_context to keep track of
+	things.
+	(get_pubnames): Adjust to above.
+
+2008-04-25  Petr Machata  <pmachata@redhat.com>
+
+	* DwflDieBias.java (getEntryBreakpoints): New method.
+
 2008-04-22  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* cni/DwarfDie.cxx(get_type): changed while
diff --git a/frysk-sys/lib/dwfl/DwflDieBias.java b/frysk-sys/lib/dwfl/DwflDieBias.java
index fb3bcda..ecc2876 100644
--- a/frysk-sys/lib/dwfl/DwflDieBias.java
+++ b/frysk-sys/lib/dwfl/DwflDieBias.java
@@ -39,9 +39,21 @@
 
 package lib.dwfl;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+
 public class DwflDieBias
 {
-  public DwarfDie die;
+    public DwarfDie die;
+    public long bias;
 
-  public long bias;
+    public ArrayList getEntryBreakpoints() {
+	ArrayList bps = die.getEntryBreakpoints();
+	ArrayList biased = new ArrayList();
+	for (Iterator it = bps.iterator(); it.hasNext(); ) {
+	    Long l = (Long)it.next();
+	    biased.add(new Long(l.longValue() + bias));
+	}
+	return biased;
+    }
 }
diff --git a/frysk-sys/lib/dwfl/cni/DwflModule.cxx b/frysk-sys/lib/dwfl/cni/DwflModule.cxx
index f77d180..b0b8c1f 100644
--- a/frysk-sys/lib/dwfl/cni/DwflModule.cxx
+++ b/frysk-sys/lib/dwfl/cni/DwflModule.cxx
@@ -57,6 +57,7 @@
 #include "lib/dwfl/ElfSymbolVisibility.h"
 #include "lib/dwfl/DwarfDieFactory.h"
 #include "lib/dwfl/Dwfl.h"
+#include "lib/dwfl/DwflDieBias.h"
 #include "lib/dwfl/DwException.h"
 
 #include "java/util/LinkedList.h"
@@ -389,34 +390,48 @@ lib::dwfl::DwflModule::getDebuginfo()
   return getName();                 	               		      
 }    
 
-static int
-each_pubname (Dwarf *dwarf, Dwarf_Global *gl, void* thisObject)
-{
+namespace {
+  struct each_pubname_context {
+    lib::dwfl::DwflModule* const dwflModule;
+    Dwarf_Addr const bias;
 
-  lib::dwfl::DwflModule* dwflModule = (lib::dwfl::DwflModule*)thisObject;
-  lib::dwfl::Dwfl* dwfl = dwflModule->parent;
-  
-  Dwarf_Die *die = (Dwarf_Die*)JvMalloc(sizeof(Dwarf_Die));
-  
-  if (dwarf_offdie (dwarf, gl->die_offset, die) == NULL){
+    each_pubname_context(lib::dwfl::DwflModule* m, Dwarf_Addr b)
+      : dwflModule(m), bias(b)
+    {}
+  };
+
+  int
+  each_pubname (Dwarf *dwarf, Dwarf_Global *gl, void* data)
+  {
+    each_pubname_context const* context = static_cast<each_pubname_context*>(data);
+    lib::dwfl::Dwfl* dwfl = context->dwflModule->parent;
+
+    Dwarf_Die* die = (Dwarf_Die*)JvMalloc(sizeof(Dwarf_Die));
+
+    if (dwarf_offdie (dwarf, gl->die_offset, die) == NULL)
       throw new lib::dwfl::DwarfException(JvNewStringUTF("failed to get object die"));
-  }else{        
-    lib::dwfl::DwarfDie* dwarfDie = dwfl->factory->makeDie((jlong)die, dwflModule);  
-    dwflModule->pubNames->add(dwarfDie);
-    


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


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

only message in thread, other threads:[~2008-04-25 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-25 21:52 [SCM] master: Fix ftrace spurious warnings about breakpoint address mismatch pmachata

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