remote debugging Graal, and similar use cases
Gilles Duboscq
gilwooden at gmail.com
Sun Aug 4 12:06:49 PDT 2013
Hello Miguel,
For (2) you can also use
./mx.sh -d unittest <your-unit-test-of-choice>
if you need a different port that 8000 there is also -dbg <port> instead of
-d
I use (3) most of the time so it should definitely work.
This kind of errors usually indicate a JVM which was not build with Graal
support.
You shouldn't need to add graal.jar, since it should already be in the
"Alternate JRE".
I usually set things up like described on
https://wiki.openjdk.java.net/display/Graal/Eclipse in the "Graal as an
alternate JRE" section
-Gilles
On Sun, Aug 4, 2013 at 12:31 PM, Garcia Gutierrez Miguel Alfredo <
miguelalfredo.garcia at epfl.ch> wrote:
>
> After trying out different ways to debug a running Graal instance, two of
> them worked out of the box (summarized below) but a third didn't.
>
> First what worked:
>
> (1) Ideal Graph Visualizer, which shows snapshots of choice indicated
> via Debug.dump
>
> (2) remote debug connection (e.g. from an IDE where breakpoints are set)
> to a running Graal vm, for example started with
>
> ./mx.sh unittest <your-unit-test-of-choice> @-Xdebug
> @-Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y
>
> (Instead of unittest, one can launch a Java app of choice, the above
> is frequent use-case).
>
> Looks like for the above to work one should import beforehand the
> .launch file created by "mx build" (I don't remember if the remote launch
> option is available before importing it).
>
> The .launch file is imported into Eclipse via File > Import >
> Run/Debug > Launch configuration
> After importing it, launch first the listener via the command-line
> above, then from Eclipse Run > Debug > Attach remote Java app
>
> (3) A third approach didn't work, comments as to why are welcome:
>
> (3.a) First, I created an Eclipse debug configuration for a Java
> application.
> (3.b) For that debug configuration, I specified an "Alternate JRE" as
> follows:
>
> ~/graal/jdk1.7.0_21/product/
>
> (3.c) added graal.jar (located in jre/lib of the product Graal JVM above)
>
> However, the native methods needed by Graal aren't available. For example:
>
> java.lang.UnsatisfiedLinkError:
> com.oracle.graal.api.runtime.Graal.initializeRuntime()Lcom/oracle/graal/api/runtime/GraalRuntime;
>
> Is this approach supposed to work, and if so what am I missing? (I realize
> that option (2) above already covers the same use-cases that one could
> exercise via (3), but still puzzled as to what's missing).
>
>
> Miguel
> http://magarciaepfl.github.io/scala/
>
>
> --
> Miguel Garcia
> Swiss Federal Institute of Technology
> EPFL - IC - LAMP1 - INR 328 - Station 14
> CH-1015 Lausanne - Switzerland
> http://lamp.epfl.ch/~magarcia/
>
More information about the graal-dev
mailing list