You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/en/jad.html

432 lines
14 KiB
HTML

6 years ago
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jad &mdash; Arthas 3.0.6-SNAPSHOT documentation</title>
6 years ago
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="classloader" href="classloader.html" />
<link rel="prev" title="dump" href="dump.html" />
<script src="_static/center_page.js"></script>
6 years ago
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/github.min.css">
6 years ago
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Arthas
</a>
<div class="version">
3.0.6-SNAPSHOT
6 years ago
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="quick-start.html">Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-use.html">Advanced usage</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="commands.html">Commands</a><ul class="current">
6 years ago
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="thread.html">thread</a></li>
<li class="toctree-l2"><a class="reference internal" href="jvm.html">jvm</a></li>
<li class="toctree-l2"><a class="reference internal" href="sysprop.html">sysprop</a></li>
<li class="toctree-l2"><a class="reference internal" href="sysenv.html">sysenv</a></li>
6 years ago
<li class="toctree-l2"><a class="reference internal" href="getstatic.html">getstatic</a></li>
<li class="toctree-l2"><a class="reference internal" href="ognl.html">ognl</a></li>
6 years ago
<li class="toctree-l2"><a class="reference internal" href="sc.html">sc</a></li>
<li class="toctree-l2"><a class="reference internal" href="sm.html">sm</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html">dump</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">jad</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#options">Options</a></li>
6 years ago
<li class="toctree-l3"><a class="reference internal" href="#usage">Usage</a><ul>
6 years ago
<li class="toctree-l4"><a class="reference internal" href="#decompile-java-lang-string">Decompile <tt class="docutils literal">java.lang.String</tt></a></li>
6 years ago
<li class="toctree-l4"><a class="reference internal" href="#decompile-the-specified-method">Decompile the specified method</a></li>
<li class="toctree-l4"><a class="reference internal" href="#decompile-with-specified-classloader">Decompile with specified classLoader</a></li>
</ul>
</li>
6 years ago
</ul>
</li>
6 years ago
<li class="toctree-l2"><a class="reference internal" href="classloader.html">classloader</a></li>
<li class="toctree-l2"><a class="reference internal" href="redefine.html">redefine</a></li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="watch.html">watch</a></li>
<li class="toctree-l2"><a class="reference internal" href="trace.html">trace</a></li>
<li class="toctree-l2"><a class="reference internal" href="stack.html">stack</a></li>
<li class="toctree-l2"><a class="reference internal" href="tt.html">tt</a></li>
<li class="toctree-l2"><a class="reference internal" href="options.html">options</a></li>
6 years ago
<li class="toctree-l2"><a class="reference internal" href="commands.html#basic-arthas-commands">Basic Arthas Commands</a></li>
6 years ago
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Auser-case">User cases</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered">Questions and answers</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas">Fork me at GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md">CONTRIBUTING</a></li>
6 years ago
<li class="toctree-l1"><a class="reference internal" href="release-notes.html">Release Notes</a></li>
6 years ago
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Arthas</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
6 years ago
<li><a href="commands.html">All Commands</a> &raquo;</li>
6 years ago
<li>jad</li>
<li class="wy-breadcrumbs-aside">
6 years ago
<a href="https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/en/jad.md" class="fa fa-github"> Edit on GitHub</a>
6 years ago
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="jad">
<span id="jad"></span><h1>jad<a class="headerlink" href="#jad" title="Permalink to this headline"></a></h1>
6 years ago
<blockquote>
6 years ago
<div>Decompile the specified classes.</div></blockquote>
6 years ago
<p><tt class="docutils literal">jad</tt> helps to decompile the byte code running in JVM to the source code to assist you to understand the logic behind better.</p>
6 years ago
<ul class="simple">
6 years ago
<li>The decompiled code is syntax highlighted for better readability in Arthas console.</li>
<li>It is possible that theres grammar error in the decompiled code, but it should not affect your interpretation.</li>
6 years ago
</ul>
<div class="section" id="options">
<span id="options"></span><h2>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<table border="1" class="docutils">
<thead>
<tr>
<th align="right">Name</th>
<th align="left">Specification</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right"><em>class-pattern</em></td>
<td align="left">pattern for the class name</td>
</tr>
<tr>
6 years ago
<td align="right"><code>[c:]</code></td>
<td align="left">hashcode of the class loader that loads the class</td>
6 years ago
</tr>
<tr>
6 years ago
<td align="right"><code>[E]</code></td>
<td align="left">turn on regex match while the default is wildcard match</td>
6 years ago
</tr>
</tbody>
</table></div>
<div class="section" id="usage">
<span id="usage"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
6 years ago
<div class="section" id="decompile-java-lang-string">
6 years ago
<span id="decompile-java-lang-string"></span><h3>Decompile <tt class="docutils literal">java.lang.String</tt><a class="headerlink" href="#decompile-java-lang-string" title="Permalink to this headline"></a></h3>
<div class="highlight-java notranslate"><div class="highlight hljs"><pre class="java">$ jad java.lang.String
ClassLoader:
Location:
/*
* Decompiled with CFR 0_132.
*/
package java.lang;
import java.io.ObjectStreamField;
...
public final class String
implements Serializable,
Comparable&lt;String&gt;,
CharSequence {
private final char[] value;
private int hash;
private static final long serialVersionUID = -6849794470754667710L;
private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];
public static final Comparator&lt;String&gt; CASE_INSENSITIVE_ORDER = new CaseInsensitiveComparator();
public String(byte[] arrby, int n, int n2) {
String.checkBounds(arrby, n, n2);
this.value = StringCoding.decode(arrby, n, n2);
}
...
6 years ago
</pre></div>
</div>
</div>
<div class="section" id="decompile-the-specified-method">
<span id="decompile-the-specified-method"></span><h3>Decompile the specified method<a class="headerlink" href="#decompile-the-specified-method" title="Permalink to this headline"></a></h3>
6 years ago
<div class="highlight-java notranslate"><div class="highlight hljs"><pre class="java">$ jad demo.MathGame main
6 years ago
ClassLoader:
+-sun.misc.Launcher$AppClassLoader@3d4eac69
+-sun.misc.Launcher$ExtClassLoader@66350f69
Location:
/private/tmp/arthas-demo.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
do {
game.run();
TimeUnit.SECONDS.sleep(1L);
} while (true);
}
Affect(row-cnt:1) cost in 228 ms.
</pre></div>
</div>
</div>
<div class="section" id="decompile-with-specified-classloader">
<span id="decompile-with-specified-classloader"></span><h3>Decompile with specified classLoader<a class="headerlink" href="#decompile-with-specified-classloader" title="Permalink to this headline"></a></h3>
6 years ago
<blockquote>
6 years ago
<div>If the target class is loaded by multiple classloaders, <tt class="docutils literal">jad</tt> outputs the <tt class="docutils literal">hashcode</tt> of the corresponding classloaders, then you can re-run <tt class="docutils literal">jad</tt> and specify <tt class="docutils literal">-c <hashcode></tt> to decompile the target class from the specified classloader.</div></blockquote>
<div class="highlight-java notranslate"><div class="highlight hljs"><pre class="java">$ jad org.apache.log4j.Logger
6 years ago
6 years ago
Found more than one class for: org.apache.log4j.Logger, Please use jad -c hashcode org.apache.log4j.Logger
HASHCODE CLASSLOADER
6 years ago
69dcaba4 +-monitor&#x27;s ModuleClassLoader
6 years ago
6e51ad67 +-java.net.URLClassLoader@6e51ad67
+-sun.misc.Launcher$AppClassLoader@6951a712
+-sun.misc.Launcher$ExtClassLoader@6fafc4c2
6 years ago
2bdd9114 +-pandora-qos-service&#x27;s ModuleClassLoader
4c0df5f8 +-pandora-framework&#x27;s ModuleClassLoader
6 years ago
Affect(row-cnt:0) cost in 38 ms.
$ jad org.apache.log4j.Logger -c 69dcaba4
ClassLoader:
6 years ago
+-monitor&#x27;s ModuleClassLoader
6 years ago
Location:
6 years ago
/Users/admin/app/log4j-1.2.14.jar
6 years ago
package org.apache.log4j;
import org.apache.log4j.spi.*;
public class Logger extends Category
{
private static final String FQCN;
protected Logger(String name)
{
super(name);
}
6 years ago
...
6 years ago
Affect(row-cnt:1) cost in 190 ms.
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="classloader.html" class="btn btn-neutral float-right" title="classloader" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="dump.html" class="btn btn-neutral" title="dump" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Alibaba Middleware Group, and contributors.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'3.0.6-SNAPSHOT',
6 years ago
LANGUAGE:'en',
6 years ago
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/alibaba/arthas">Fork me at GitHub</a>
</div>
</div>
<script type="text/javascript" src="_static/add_badges.js"></script>
6 years ago
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.5.0/highlightjs-line-numbers.min.js"></script>
<script>
document.querySelectorAll('div.hljs > pre').forEach(function(block) {
hljs.highlightBlock(block);
hljs.lineNumbersBlock(block);
});
</script>
6 years ago
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>