public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Restore old behavior; use this.outer.getSP() to construct FrameIdentifier.
@ 2007-12-03 16:42 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2007-12-03 16:42 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  7ac95a41f7d7ef6137687c6b882369dd71764a3c (commit)
      from  d0b09b68212a743402612f1cc83647ee153cc8e5 (commit)

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

- Log -----------------------------------------------------------------
commit 7ac95a41f7d7ef6137687c6b882369dd71764a3c
Author: Andrew Cagney <cagney@redhat.com>
Date:   Mon Dec 3 11:42:11 2007 -0500

    Restore old behavior; use this.outer.getSP() to construct FrameIdentifier.
    
    frysk-core/frysk/stack/ChangeLog
    2007-12-03  Andrew Cagney  <cagney@redhat.com>
    
    	* LibunwindFrame.java: Revert <<Get CFA from cursor>>; add more
    	comments.

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

Summary of changes:
 frysk-core/frysk/stack/ChangeLog           |    5 +++++
 frysk-core/frysk/stack/LibunwindFrame.java |   23 ++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog
index 2755651..9656b93 100644
--- a/frysk-core/frysk/stack/ChangeLog
+++ b/frysk-core/frysk/stack/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-03  Andrew Cagney  <cagney@redhat.com>
+
+	* LibunwindFrame.java: Revert <<Get CFA from cursor>>; add more
+	comments.
+
 2007-12-03  Mark Wielaard  <mwielaard@redhat.com>
 
 	* LibunwindFrame.java (getFrameIdentifier): Get CFA from cursor.
diff --git a/frysk-core/frysk/stack/LibunwindFrame.java b/frysk-core/frysk/stack/LibunwindFrame.java
index 6d8f09e..1495aa5 100644
--- a/frysk-core/frysk/stack/LibunwindFrame.java
+++ b/frysk-core/frysk/stack/LibunwindFrame.java
@@ -132,19 +132,32 @@ class LibunwindFrame extends Frame
   
     /**
      * Return this frame's FrameIdentifier.
-     * The frame identifier is the combination of the current
-     * symbols (function) start address and the call frame address
-     * of the cursor (frame).
+     *
+     * The frame identifier is the combination of the current symbols
+     * (function) start address and the more outer frame's inner most
+     * address.
      */
     public FrameIdentifier getFrameIdentifier () {
 	if (frameIdentifier == null) {
 	  long functionAddress = getSymbol().getAddress();
-	  long cfa = cursor.getCFA();
+	  // Note, cursor.getCFA is wrong here; libunwind returns the
+	  // CFA used as part of computing the location of registers
+	  // in the current cursor and not the "CFA" of this frame;
+	  // effectively this frame's stack-pointer (in fact often
+	  // getCFA() == getSP()).
+	  long cfa = 0;
+	  Frame outer = getOuter();
+	  if (outer != null)
+	      // Need an address that is constant through out the
+	      // lifetime of the frame (in particular when the stack
+	      // grows).  Use the outer-to-this frame's inner most
+	      // stack address a.k.a. the stack-pointer..
+	      cfa = ((LibunwindFrame)outer).cursor.getSP();
 	  frameIdentifier = new FrameIdentifier(functionAddress, cfa);
 	}
 	return this.frameIdentifier;
     }
-  
+
     /**
      * Returns whether or not this frame's execution was interrupted by
      * a signal.


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


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

only message in thread, other threads:[~2007-12-03 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 16:42 [SCM] master: Restore old behavior; use this.outer.getSP() to construct FrameIdentifier 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).