From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22800 invoked by alias); 13 Feb 2012 18:44:28 -0000 Received: (qmail 22791 invoked by uid 22791); 13 Feb 2012 18:44:27 -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 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:44:14 +0000 Received: by eekc13 with SMTP id c13so2072145eek.0 for ; Mon, 13 Feb 2012 10:44:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.50.193 with SMTP id z41mr5566738eeb.19.1329158650962; Mon, 13 Feb 2012 10:44:10 -0800 (PST) Received: by 10.14.181.194 with HTTP; Mon, 13 Feb 2012 10:44:10 -0800 (PST) In-Reply-To: <1329124283.2783.15.camel@springer.wildebeest.org> References: <1329124283.2783.15.camel@springer.wildebeest.org> Date: Mon, 13 Feb 2012 18:44:00 -0000 Message-ID: Subject: Re: GDB and the OpenJDK JVM From: Daniel Jacobowitz To: Mark Wielaard Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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/msg00036.txt.bz2 On Mon, Feb 13, 2012 at 4:11 AM, Mark Wielaard wrote: > For SystemTap I wrote some hotspot heap introspection functions that > might be interesting. But, like Gary said, hotspot might have internal > debug accessor functions that you can use too. Systemtap cannot call > into the inferior so we needed some code that went through the java code > heap and stack unwind "by hand": > http://icedtea.classpath.org/hg/icedtea6/file/tip/tapset/jstack.stp.in > If you can make inferior function calls however (and know it is safe to > call them) then that will be much easier. The above systemtap tapset is > somewhat fragile since it depends on a lot of hotspot code generator > internals. Ooh, this is very interesting. Thanks! Overall, I would prefer not to call into the inferior. That's how I feel pretty much all the time, because (A) core dumps matter a great deal, (B) calling the inferior is fragile in its own ways, and (C) calling the inferior is slowwwwww. I'll do it if I have to, but I'd rather rely on the symbol table of the JDK and manually maintained code. -- Thanks, Daniel