From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2411 invoked by alias); 19 Nov 2007 11:43:05 -0000 Received: (qmail 2378 invoked by uid 9112); 19 Nov 2007 11:43:04 -0000 Date: Mon, 19 Nov 2007 11:43:00 -0000 Message-ID: <20071119114304.2363.qmail@sourceware.org> From: mark@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: frysk-core/frysk/stack/ChangeLog X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 549835f8c32000e9cae1b45dd50012fb9c7762e0 X-Git-Newrev: bbf660ad5f803e000274503ad878040f4d604fef 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/msg00395.txt.bz2 The branch, master has been updated via bbf660ad5f803e000274503ad878040f4d604fef (commit) from 549835f8c32000e9cae1b45dd50012fb9c7762e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit bbf660ad5f803e000274503ad878040f4d604fef Author: Mark Wielaard Date: Mon Nov 19 12:42:54 2007 +0100 frysk-core/frysk/stack/ChangeLog 2007-11-19 Mark Wielaard * LibunwindFrame.java (getAddress): Don't do a proc name lookup, use new Cursor.getIP(). frysk-imports/libunwind/ChangeLog 2007-11-19 Mark Wielaard * src/mi/Gget_reg.c (unw_get_reg): Use cached value from cursor when looking for UNW_REG_IP. frysk-sys/lib/unwind/ChangeLog 2007-11-19 Mark Wielaard * Cursor.java (getIP): New method. (unwind): Check current ip. * Unwind.java (getIP): New method. * cni/UnwindH.hxx (getIP): Likewise. (getContext): Check for null elfImage. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/stack/ChangeLog | 6 ++++++ frysk-core/frysk/stack/LibunwindFrame.java | 9 +-------- frysk-imports/libunwind/ChangeLog | 5 +++++ frysk-imports/libunwind/src/mi/Gget_reg.c | 7 +++++++ frysk-sys/lib/unwind/ChangeLog | 9 +++++++++ frysk-sys/lib/unwind/Cursor.java | 8 ++++++-- frysk-sys/lib/unwind/Unwind.java | 1 + frysk-sys/lib/unwind/cni/UnwindH.hxx | 14 ++++++++++++++ 8 files changed, 49 insertions(+), 10 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog index f5bce74..110edfe 100644 --- a/frysk-core/frysk/stack/ChangeLog +++ b/frysk-core/frysk/stack/ChangeLog @@ -1,4 +1,10 @@ +2007-11-19 Mark Wielaard + + * LibunwindFrame.java (getAddress): Don't do a proc name lookup, + use new Cursor.getIP(). + 2007-11-13 Jose Flavio Aguilar Paulino + * LibunwindAddressSpace.java: Add PowerPC32/64 unwinder classes to the constructors. diff --git a/frysk-core/frysk/stack/LibunwindFrame.java b/frysk-core/frysk/stack/LibunwindFrame.java index 080df12..64e9c28 100644 --- a/frysk-core/frysk/stack/LibunwindFrame.java +++ b/frysk-core/frysk/stack/LibunwindFrame.java @@ -44,7 +44,6 @@ import frysk.isa.Register; import java.util.logging.Logger; import lib.unwind.Cursor; import lib.unwind.ProcInfo; -import lib.unwind.ProcName; import frysk.isa.ISA; import frysk.proc.Task; import frysk.symtab.Symbol; @@ -92,13 +91,7 @@ class LibunwindFrame extends Frame * Returns the current program counter of this Frame. */ public long getAddress() { - ProcInfo myInfo = cursor.getProcInfo(); - ProcName myName = cursor.getProcName(0); - - if (myInfo.getError() != 0 || myName.getError() != 0) - return 0; - - return myInfo.getStartIP() + myName.getOffset(); + return cursor.getIP(); } /** diff --git a/frysk-imports/libunwind/ChangeLog b/frysk-imports/libunwind/ChangeLog index af994a5..74d2fbf 100644 --- a/frysk-imports/libunwind/ChangeLog +++ b/frysk-imports/libunwind/ChangeLog @@ -1,3 +1,8 @@ +2007-11-19 Mark Wielaard + + * src/mi/Gget_reg.c (unw_get_reg): Use cached value from cursor + when looking for UNW_REG_IP. + 2007-10-13 Mark Wielaard * config/.cvsignore: New. Ignore generated files. diff --git a/frysk-imports/libunwind/src/mi/Gget_reg.c b/frysk-imports/libunwind/src/mi/Gget_reg.c index 23b72be..5179a88 100644 --- a/frysk-imports/libunwind/src/mi/Gget_reg.c +++ b/frysk-imports/libunwind/src/mi/Gget_reg.c @@ -30,5 +30,12 @@ unw_get_reg (unw_cursor_t *cursor, int regnum, unw_word_t *valp) { struct cursor *c = (struct cursor *) cursor; + // No need to go look up the IP value since it is cached in the cursor. + if (regnum == UNW_REG_IP) + { + *valp = c->dwarf.ip; + return 0; + } + return tdep_access_reg (c, regnum, valp, 0); } diff --git a/frysk-sys/lib/unwind/ChangeLog b/frysk-sys/lib/unwind/ChangeLog index 4ccd677..ebe978e 100644 --- a/frysk-sys/lib/unwind/ChangeLog +++ b/frysk-sys/lib/unwind/ChangeLog @@ -1,4 +1,13 @@ +2007-11-19 Mark Wielaard + + * Cursor.java (getIP): New method. + (unwind): Check current ip. + * Unwind.java (getIP): New method. + * cni/UnwindH.hxx (getIP): Likewise. + (getContext): Check for null elfImage. + 2007-11-13 Jose Flavio Aguilar Paulino + * UnwindPPC32.cxx: New. To support powerpc32. 2007-11-09 Jose Flavio Aguilar Paulino diff --git a/frysk-sys/lib/unwind/Cursor.java b/frysk-sys/lib/unwind/Cursor.java index 190e315..6433ace 100644 --- a/frysk-sys/lib/unwind/Cursor.java +++ b/frysk-sys/lib/unwind/Cursor.java @@ -81,6 +81,10 @@ public class Cursor bytes, start); } + public long getIP() { + return unwinder.getIP(cursor); + } + public long getSP() { return unwinder.getSP(cursor); } @@ -110,8 +114,8 @@ public class Cursor public Cursor unwind() { logger.log(Level.FINE, "{0}, unwind\n", this); - //XXX: Don't unwind if no more frames. - if (step == 0) + //XXX: Don't unwind if no more, or unknown frames. + if (step == 0 || getIP() == 0) return null; Cursor newCursor = new Cursor(addressSpace, diff --git a/frysk-sys/lib/unwind/Unwind.java b/frysk-sys/lib/unwind/Unwind.java index 23181ec..8e9d3d3 100644 --- a/frysk-sys/lib/unwind/Unwind.java +++ b/frysk-sys/lib/unwind/Unwind.java @@ -70,6 +70,7 @@ public abstract class Unwind abstract void setRegister(RawDataManaged cursor, int regNum, long offset, int length, byte[] word, int start); + public abstract long getIP(RawDataManaged cursor); public abstract long getSP(RawDataManaged cursor); abstract RawDataManaged copyCursor(RawDataManaged cursor); diff --git a/frysk-sys/lib/unwind/cni/UnwindH.hxx b/frysk-sys/lib/unwind/cni/UnwindH.hxx index c13576c..f48494e 100644 --- a/frysk-sys/lib/unwind/cni/UnwindH.hxx +++ b/frysk-sys/lib/unwind/cni/UnwindH.hxx @@ -402,6 +402,17 @@ lib::unwind::TARGET::getSP(gnu::gcj::RawDataManaged* cursor) return sp; } +jlong +lib::unwind::TARGET::getIP(gnu::gcj::RawDataManaged* cursor) +{ + unw_word_t ip; + int status = unw_get_reg((::unw_cursor_t *) cursor, UNW_REG_IP, &ip); + if (status < 0) + return 0; // bottom of stack. + else + return ip; +} + jint lib::unwind::TARGET::getContext(gnu::gcj::RawDataManaged* context) @@ -445,6 +456,9 @@ lib::unwind::TARGET::createProcInfoFromElfImage(lib::unwind::AddressSpace* addre jboolean needUnwindInfo, lib::unwind::ElfImage* elfImage) { + if (elfImage == NULL) + return new lib::unwind::ProcInfo(UNW_ENOINFO); + unw_proc_info_t *procInfo = (::unw_proc_info_t *) JvAllocBytes(sizeof (::unw_proc_info_t)); hooks/post-receive -- frysk system monitor/debugger