Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 39051 invoked from network); 26 Feb 2008 09:40:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 09:40:16 -0000 Received: (qmail 93126 invoked by uid 500); 26 Feb 2008 09:40:10 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 93102 invoked by uid 500); 26 Feb 2008 09:40:10 -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 93093 invoked by uid 99); 26 Feb 2008 09:40:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 01:40:10 -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 gshimansky@gmail.com designates 64.233.184.239 as permitted sender) Received: from [64.233.184.239] (HELO wr-out-0506.google.com) (64.233.184.239) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 09:39:35 +0000 Received: by wr-out-0506.google.com with SMTP id 50so3630634wra.18 for ; Tue, 26 Feb 2008 01:39:44 -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:sender; bh=WFMwxN/9euYt5HP0xiQHed/9f+80OmD2Mo0xstcBdn0=; b=JRpIlvNHhKZj52oqq7AjbcV7GdSaxVQlX56rdRpUmmoEWebDovbXaP1XS6wvdJiBxb+998cU1J3CMR71+ScyBZRDP5+J8iFXIfSPRzfbUUeJPKZSaY9Pyh4vHwUNDgXbVV6sQXGGi8hQH+RftCsifatF98BLGQar60xuMqZvucU= 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:sender; b=eu9Ze1SkHaSFE/4SInZyFHwycVOd4QCbl/y+pfoQ3OyKgau3J1yeowZvGwzzn5Op/JE3umvmBNBvsa50iM4oi3vLGJU1PhSp2Z1D4ZROlVVDYjFW7tk7eYkHQrmUp5E2kpzgGorJROpwnvi0c7COA+OOFUsJG0yxd+ipFLExhqA= Received: by 10.114.37.1 with SMTP id k1mr5114053wak.6.1204018783282; Tue, 26 Feb 2008 01:39:43 -0800 (PST) Received: from ?127.0.0.1? ( [140.211.11.9]) by mx.google.com with ESMTPS id m27sm11418293wag.50.2008.02.26.01.39.41 (version=SSLv3 cipher=RC4-MD5); Tue, 26 Feb 2008 01:39:42 -0800 (PST) Message-ID: <47C3DE58.4040100@apache.org> Date: Tue, 26 Feb 2008 12:39:36 +0300 From: Gregory Shimansky User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [jdktools][JDWP]using portlib to support JDWP transport/agent? References: <5c8e69f0802242256x4a907e93k3ee9b7ce8a966755@mail.gmail.com> <5c8e69f0802260115y226ad9b8t7db5d745bcbf172@mail.gmail.com> In-Reply-To: <5c8e69f0802260115y226ad9b8t7db5d745bcbf172@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Gregory Shimansky X-Virus-Checked: Checked by ClamAV on apache.org Jimmy,Jing Lv said the following on 26.02.2008 12:15: > Hi, > > 2008/2/26, Ivan Popov : >> JDWP agent and transport implementation was developed independent on >> Harmony's drlvm and classlib implementations in order to be run easily >> on top on any JVM. That's why it does not use any portlib support for >> platform dependent code. >> >> I agree, however, it would be better to re-use platform dependent >> support from portlib to facilitate porting jdwp code to other >> platforms. The only such code is TCP/IP sockets api used in dt_socket >> transport and loading transport DLL in the agent itself. All other >> code is based on standard JVMTI api and thus is platform independent. >> > > I notice the DLL loading as well. I have an idea here that shall we > start with java-level lib loading process? For Java code it may be > quite easy to do such work as: > System.loadLibrary("libname"); > > We can do similar things. What does native code do in this > "System.loadLibrary", does vm/classlib native code support such API > for work? If so, we may > 1) directly call that API to load lib and avoid platform differences > If no, we may > 2) create a java class to do the such work, reflect in the native > TransportManager. Though it may be a little strange and slower in > performance, it may also works. > > Any VM guru know what's happening in the System.loadLibrary()? Would > it be used without java-level call? I am not sure that using Java is possible here. First, agent's initialization happens in ON_LOAD phase [1] where VM doesn't allow to execute any Java code yet. Second, even if you make a call to System.loadLibrary (Java or underlying native function) you'd need the library handle to obtain (with a platform dependent function) function pointers from it. [1] http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#GetPhase -- Gregory