From owner-freebsd-java@FreeBSD.ORG Thu Feb 26 21:16:03 2009 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 027F11065673 for ; Thu, 26 Feb 2009 21:16:03 +0000 (UTC) (envelope-from Swamy.Venkataramanappa@Sun.COM) Received: from brmea-mail-1.sun.com (brmea-mail-1.Sun.COM [192.18.98.31]) by mx1.freebsd.org (Postfix) with ESMTP id 7427A8FC08 for ; Thu, 26 Feb 2009 21:16:02 +0000 (UTC) (envelope-from Swamy.Venkataramanappa@Sun.COM) Received: from fe-amer-10.sun.com ([192.18.109.80]) by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n1QLG2Nl021917 for ; Thu, 26 Feb 2009 21:16:02 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=ISO-8859-1 Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008)) id <0KFO00H00YO53K00@mail-amer.sun.com> for freebsd-java@freebsd.org; Thu, 26 Feb 2009 14:16:02 -0700 (MST) Received: from [129.150.18.228] ([unknown] [129.150.18.228]) by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008)) with ESMTPSA id <0KFO0098AZ2OVN70@mail-amer.sun.com>; Thu, 26 Feb 2009 14:16:01 -0700 (MST) Date: Thu, 26 Feb 2009 15:15:57 -0600 From: Swamy Venkataramanappa In-reply-to: <49A7017C.3020302@experts-exchange.com> Sender: Swamy.Venkataramanappa@Sun.COM To: Brian Gardner Message-id: <49A7068D.7050001@sun.com> References: <49A6F84E.1080504@experts-exchange.com> <49A6FD5C.3070107@sun.com> <49A7017C.3020302@experts-exchange.com> User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) Cc: bsd-port-dev@openjdk.java.net, freebsd-java@freebsd.org Subject: Re: gdb and java X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2009 21:16:03 -0000 Probably library path is not set correctly. So try this trick. public class PrintLibraryPath { public static void main(String[] args) { System.out.println(System.getProperty("java.library.path")); } } env LD_LIBRARY_PATH=`java PrintLibraryPath` gdb java .. -swamy Brian Gardner wrote: > Thanks Swamy, > Same thing happens using java directly. > > Swamy Venkataramanappa wrote: > >> jmap is actually a java program. jmap executable is simple launcher >> just like a java launcher. >> It launches java program and runs JMap.class from sa-jdi.jar or runs >> attach on demand >> code and attaches to the running jvm. SA based jmap can be run like this >> >> java -classpath /sa-jdi.jar sun.jvm.hotspot.tools.JMap >> -finalizerinfo >> >> -Swamy >> >> Brian Gardner wrote: >> >>> I've had success in debugging java using jdb, however this doesn't >>> seem to support native debugging. I'd like to use gdb but this >>> doesn't work with (the error is bellow). Currently I'm printing to >>> stderr from native code but this is less than ideal and time >>> consuming, any ideas? >>> >>> # gdb jmap >>> (gdb) run -finalizerinfo 118 >>> Starting program: >>> /usr/home/brian/openjdk6/freshv2.2/bsd-port6.modified/build/bsd-amd64/j2sdk-image/bin/jmap >>> -finalizerinfo 118 >>> (no debugging symbols found)...(no debugging symbols found)...[New >>> LWP 104363] >>> (no debugging symbols found)...(no debugging symbols found)...[New >>> Thread 0x800b01120 (LWP 104363)] >>> [New LWP 104363] >>> >>> Program received signal SIGTRAP, Trace/breakpoint trap. >>> [Switching to LWP 104363] >>> Cannot remove breakpoints because program is no longer writable. >>> It might be running in another process. >>> Further execution is probably impossible. >>> 0x000000080050d360 in ?? () from /libexec/ld-elf.so.1 >>> (gdb) >>> >>> >>> >>> >>> >> > >