Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 18829 invoked from network); 20 Feb 2009 01:27:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2009 01:27:48 -0000 Received: (qmail 97419 invoked by uid 500); 20 Feb 2009 01:27:46 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 97389 invoked by uid 500); 20 Feb 2009 01:27:46 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 97378 invoked by uid 99); 20 Feb 2009 01:27:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2009 17:27:46 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of seanny2003@gmail.com designates 209.85.217.174 as permitted sender) Received: from [209.85.217.174] (HELO mail-gx0-f174.google.com) (209.85.217.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 01:27:38 +0000 Received: by gxk22 with SMTP id 22so591047gxk.12 for ; Thu, 19 Feb 2009 17:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=zMcZJKAzyufdsCyhxSTVfZqM4IIZGzvaP/Kf0ENBdAI=; b=U0Ns1CvcdBRy8qXozB7vBqTitKO0TcMIQvqY5WAz5t75MxlNP2casgnBwSm/NCx3Hk WHBbHc4l5f0eaEnmre63HlIU2MtW5fVz4vrMNanbNRvWcxe6M+Lz273XLRsRXKOHh1Kh 1AQE/55pkB2AsrNyvb54Txcv3gS/VTKXKjqh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=OFwTAB146dMpcqXc5SeB350ygd4HLajtRzSSbjCSXFZQnNLMQ4FvoejnvAhIHeJKmT 5xyp0Ud9UyLYDvrSTIbg9GzJLteWc0LEMN7YQz4BISSNvpb5+9aQ8SnyTHXGvz8U8uoN LsDb/6I3GjC2iKeeaOhUMPG68XaSumZWE7QgE= Received: by 10.110.105.10 with SMTP id d10mr305762tic.33.1235093236588; Thu, 19 Feb 2009 17:27:16 -0800 (PST) Received: from ?10.103.225.190? ([60.12.235.29]) by mx.google.com with ESMTPS id i6sm2468604tid.39.2009.02.19.17.27.14 (version=SSLv3 cipher=RC4-MD5); Thu, 19 Feb 2009 17:27:15 -0800 (PST) Message-ID: <499E06F1.8060200@gmail.com> Date: Fri, 20 Feb 2009 09:27:13 +0800 From: YixunZhou User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: How to use gdb to debug interpreter? References: <499CCFAA.6010800@gmail.com> <3db9f87f0902190016l25e4ac15jb4010e1de73a0af0@mail.gmail.com> In-Reply-To: <3db9f87f0902190016l25e4ac15jb4010e1de73a0af0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thank you, I'll try it~ > Hi YiXun > I think gdb scripts may help you for this problem > you can define a macro in .gdbinit file like this: > > define hsbreak main > run -Xem:interpreter $arg0 > break hysl_open_shared_library > continue > finish > disable > break jni.cpp:CallStaticVoidMethod > continue > break interpreter.cpp:Opcode_NEW #functions whatever you like > continue > dis > end > > then, you can use this macro "hs" in your gdb command to set the breakpoint > and debug. > > Thanks > Simon > > 2009/2/19 YixunZhou > > >> Hi all, >> >> I modified harmony to make it support ClassRedefine, but I got a >> segmentation fault when called new to create an instance of >> the new version class. I changed to interpreter mode, and found the problem >> happened when executing OPCODE_INVOKESPECIAL. >> >> case OPCODE_INVOKESPECIAL: >> // Next line marks the >> "P_TLS_vmthread->thread_exception" that an exception happened. >> Opcode_INVOKESPECIAL(frame); >> // get_current_thread_exception can not >> handle the exception properly and cause the segment fault. >> frame.exc = get_current_thread_exception(); >> >> I was using "printf" to locate the bug, but it is too complicated here. But >> when I use gdb to trace the execution, it cannot follow the function >> pointer "(*env)->CallStaticVoidMethod (env, cls, mid, args);" in main.c. >> >> So, how can I use gdb to debug the interpreter? Thanks. >> >> >> -- >> >> Best regard, >> Yixun Zhou >> seanny2003@gmail.com >> >> >> >> > > > -- Best regard, Yixun Zhou seanny2003@gmail.com