User Tools

Site Tools


java

This is an old revision of the document!


<markdown>

# Build

```bash

hg clone http://hg.openjdk.java.net/jdk8u/jdk8u/
cd jdk8u
sh ./get_source.sh
sh ./configure --with-debug-level=slowdebug --disable-zip-debug-info

```

# Options

- -XX:+UnlockExperimentalVMOptions - -Xprintflags - -XX+PrintFlagsWithComments - -XX:+PrintFlagsInitial - -XX:+PrintFlagsFinal - -XX:+CountBytecodes - -XX:+PrintBytecodeHistogram - -XX:+Printinterpreter - -XX:+TraceBytecodes - -XX:StopInterpreterAt=<num printed by -XX:+TraceBytecodes>

  1. set `b breakpoint` at GDB

- -XX:CompileCommand=“break <className:method>” - -XX:CompileCommand=“print <className:method>”

# Template Intepreter

This requires hsdis:

```bash

cd hotspot/src/share/tools/hsdis/
wget http://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.xz
tar xvf binutils-2.33.1.tar.xz
make all64 BINUTILS=binutils-2.33.1
cp build/linux-amd64/hsdis-amd64.so /same/path/to/libjvm.so
./java -XX:+PrintInterpreter Hello

```

# GDB

- `call help()` - `call pns($sp, $rbp, $pc)`

# Reference

http://www.progdoc.de/papers/JavaOne2014/javaone2014_con3138.html

</markdow n>

java.1601137792.txt.gz · Last modified: by ealmr

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki