From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5489 invoked by alias); 13 Feb 2012 18:39:30 -0000 Received: (qmail 5382 invoked by uid 22791); 13 Feb 2012 18:39:29 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_IB X-Spam-Check-By: sourceware.org Received: from mail-ee0-f41.google.com (HELO mail-ee0-f41.google.com) (74.125.83.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Feb 2012 18:39:13 +0000 Received: by eekc13 with SMTP id c13so2070682eek.0 for ; Mon, 13 Feb 2012 10:39:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.38.208 with SMTP id a56mr5549791eeb.53.1329158351846; Mon, 13 Feb 2012 10:39:11 -0800 (PST) Received: by 10.14.181.194 with HTTP; Mon, 13 Feb 2012 10:39:11 -0800 (PST) In-Reply-To: <1328822151.2294.12.camel@soleil> References: <20120209161612.GA7088@redhat.com> <1328818882.2213.9.camel@soleil> <1328822151.2294.12.camel@soleil> Date: Mon, 13 Feb 2012 18:39:00 -0000 Message-ID: Subject: Re: GDB and the OpenJDK JVM From: Daniel Jacobowitz To: Philippe Waroquiers Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00035.txt.bz2 On Thu, Feb 9, 2012 at 4:15 PM, Philippe Waroquiers wrote: > > I am not sure I fully understand the difference between bytecode > debugging/source level debugging of the code running on the VM > and e.g. > >> * Showing information about Java objects given JNI handles > >> * Interleaving Java frames in the stack trace > >> * Fabricating unwind information for JIT'd code It's primarily a matter of context. When you have a C++ debugger attached to the JVM, also communicating with it on a socket is quite tricky - we'd have to let the debug thread run, and hope it didn't deadlock with some other stopped thread. I want to expose the JVM details while intrusively debugging the encompassing program. Also I am not sure you can get things at the level of a JNI handle over JWDP; those don't exist when you're looking at inside the VM. We'd still need some way to associate the C++ jobject handles with VM entities. > You might also take a look at a recent version of hp wdb (hp modified > gdb). IIUC, it has some support for mixed Java and other lang debugging. > E.g. here is an extract of the manual: > > =A0"Using WDB to examine backtraces in JavaTM thread stacks > =A0 =A0 You can now use HP's debugger WDB 3.0.01 or later (the GNU Debugg= er GDB) to > =A0 =A0 examine backtraces containing mixed language frames (JavaTM and C= /C++) in JavaTM > =A0 =A0 thread stacks. This will simplify debugging the VM and JavaTM mix= ed-language > =A0 =A0 applications. Set the environment variable GDB_JAVA_UNWINDLIB to = the path name > =A0 =A0 of the JavaTM Unwind Shared Library libjunwind, which is in the J= DK." Yes, this is very closely related to what I want to do. I wonder if it requires changes to HP's JDK... I do not see references to libjunwind outside of HP-UX. -- Thanks, Daniel