From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17446 invoked by alias); 5 Dec 2006 13:51:41 -0000 Received: (qmail 17426 invoked by uid 22791); 5 Dec 2006 13:51:39 -0000 X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO gbenson.demon.co.uk) (80.177.220.214) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Dec 2006 13:51:27 +0000 Received: from mambo.wire.rat ([192.168.1.6]) by gbenson.demon.co.uk with esmtp (Exim 3.36 #1) id 1Grahf-0002zA-00; Tue, 05 Dec 2006 13:51:23 +0000 Received: from mambo.wire.rat (localhost.localdomain [127.0.0.1]) by mambo.wire.rat (8.13.7/8.13.6) with ESMTP id kB5DpMwB016049; Tue, 5 Dec 2006 13:51:22 GMT Received: (from gary@localhost) by mambo.wire.rat (8.13.7/8.13.7/Submit) id kB5DpMNt016048; Tue, 5 Dec 2006 13:51:22 GMT Date: Tue, 05 Dec 2006 13:51:00 -0000 From: Gary Benson To: java-patches@gcc.gnu.org Subject: [ecj] VMStackWalker.getCallingClass() Message-ID: <20061205135118.GA24647@redhat.com> Mail-Followup-To: java-patches@gcc.gnu.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2006-q4/txt/msg00202.txt.bz2 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 168 Hi all, This commit makes VMStackWalker.getCallingClass() work when the caller is a compiled frame and the caller of the caller is an interpreted frame. Cheers, Gary --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Content-length: 1327 Index: ChangeLog =================================================================== --- ChangeLog (revision 119539) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2006-12-05 Gary Benson + + * gnu/classpath/natVMStackWalker.cc (getCallingClass): Unwind + the stack when the caller is a compiled frame and the caller + of the caller is an interpreted frame. + 2006-12-04 Adam Megacz * gnu/gcj/runtime/natSharedLibLoader.cc (init): add "::" to fix Index: gnu/classpath/natVMStackWalker.cc =================================================================== --- gnu/classpath/natVMStackWalker.cc (revision 119539) +++ gnu/classpath/natVMStackWalker.cc (working copy) @@ -42,9 +42,15 @@ _Jv_StackTrace::UpdateNCodeMap (); jclass klass = (jclass) _Jv_StackTrace::ncodeMap->get ((jobject) f); - // FIXME: If klass is null at this point, we need to use the - // unwinder machinery to scan the stack to find the real caller. - JvAssert (klass); + // If the caller is a compiled frame and the caller of the caller + // is an interpreted frame then klass will be null and we need to + // unwind the stack. + if (klass == NULL) + { + JArray *ctx = getClassContext (); + if (ctx->length >= 3) + klass = elements(ctx)[2]; + } return klass; } --9amGYk9869ThD9tj--