Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 40100 invoked from network); 26 Feb 2008 09:45:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 09:45:30 -0000 Received: (qmail 99691 invoked by uid 500); 26 Feb 2008 09:45:23 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 99667 invoked by uid 500); 26 Feb 2008 09:45:23 -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 99658 invoked by uid 99); 26 Feb 2008 09:45:23 -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:45:23 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of liyilei1979@gmail.com designates 209.85.128.186 as permitted sender) Received: from [209.85.128.186] (HELO fk-out-0910.google.com) (209.85.128.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 09:44:49 +0000 Received: by fk-out-0910.google.com with SMTP id 18so2692921fks.4 for ; Tue, 26 Feb 2008 01:44:57 -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:to:subject:in-reply-to:mime-version:content-type:references; bh=rPKKTCirhyHh0Xx/oH9GJa8cwyz+4mZ0IGlCMCgyav4=; b=eXMC+bOyRPQic4Xviw5DaOUwFtYR9T3dg/f9zQCchS/FfNCAZYRlbSTj7Yk5z9X1/tgfSsWAYYxO7m7tBJaYmIsSxB+Vf0eMMTiHQAfrH+aBl3ay/AafZLHaV+XxjUbpIU0Xc2hV5mfYCxMMSnXNrAzEjXJYNWE1sW08wokSryw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Q1rt+2MOUK3pWuSZ7148TcBNU9AgyF8ghN6VVFHbT43CGCc9LPKgiNsV1Zg8HuKsGeVc6FeKTkCPkeih/WxfrxdpG9dW8kmvTZ7iTv7EYnWS9jiYlI9x9E/YdlOrQ7573Y3LfGad7wkSeBO9hJRPT/2VtaPjDFShYQcIzMHJm/w= Received: by 10.82.147.6 with SMTP id u6mr8364918bud.6.1204019097368; Tue, 26 Feb 2008 01:44:57 -0800 (PST) Received: by 10.82.183.16 with HTTP; Tue, 26 Feb 2008 01:44:57 -0800 (PST) Message-ID: Date: Tue, 26 Feb 2008 17:44:57 +0800 From: "Leo Li" To: dev@harmony.apache.org Subject: Re: [jdktools][JDWP]using portlib to support JDWP transport/agent? In-Reply-To: <47C3DE58.4040100@apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13719_24547109.1204019097376" References: <5c8e69f0802242256x4a907e93k3ee9b7ce8a966755@mail.gmail.com> <5c8e69f0802260115y226ad9b8t7db5d745bcbf172@mail.gmail.com> <47C3DE58.4040100@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_13719_24547109.1204019097376 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/26/08, Gregory Shimansky wrote: > > 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. Agree, System.loadLibrary, in my opinion is not so appropriate in this case. > [1] http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#GetPhase > > -- > Gregory > > -- Good luck! Leo Li ------=_Part_13719_24547109.1204019097376--