mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-30 15:33:59 +00:00
fix typo
This commit is contained in:
1 parent
fb19520783
commit
dedbe2c3c5
5 files changed
+9
-9
No files matched your search
+1
-1
@@ -78,7 +78,7 @@ Tip: you can use `--versions` to list all available versions.
|
|||||||
## 开发者相关
|
## 开发者相关
|
||||||
|
|
||||||
* Arthas运行支持JDK6+
|
* Arthas运行支持JDK6+
|
||||||
* 编绎Arthas要求JDK7+,因为使用到了jdk7里的`java.lang.management.BufferPoolMXBean`。
|
* 编译Arthas要求JDK7+,因为使用到了jdk7里的`java.lang.management.BufferPoolMXBean`。
|
||||||
|
|
||||||
### 安装到本地
|
### 安装到本地
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jad
|
|||||||
|
|
||||||
### 使用参考
|
### 使用参考
|
||||||
|
|
||||||
#### 编绎`java.lang.String`
|
#### 编译`java.lang.String`
|
||||||
|
|
||||||
```java
|
```java
|
||||||
$ jad java.lang.String
|
$ jad java.lang.String
|
||||||
@@ -52,7 +52,7 @@ CharSequence {
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 反编绎指定的函数
|
#### 反编译指定的函数
|
||||||
|
|
||||||
```java
|
```java
|
||||||
$ jad demo.MathGame main
|
$ jad demo.MathGame main
|
||||||
@@ -75,7 +75,7 @@ public static void main(String[] args) throws InterruptedException {
|
|||||||
Affect(row-cnt:1) cost in 228 ms.
|
Affect(row-cnt:1) cost in 228 ms.
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 反编绎时指定ClassLoader
|
#### 反编译时指定ClassLoader
|
||||||
|
|
||||||
> 当有多个 `ClassLoader` 都加载了这个类时,`jad` 命令会输出对应 `ClassLoader` 实例的 `hashcode`,然后你只需要重新执行 `jad` 命令,并使用参数 `-c <hashcode>` 就可以反编译指定 ClassLoader 加载的那个类了;
|
> 当有多个 `ClassLoader` 都加载了这个类时,`jad` 命令会输出对应 `ClassLoader` 实例的 `hashcode`,然后你只需要重新执行 `jad` 命令,并使用参数 `-c <hashcode>` 就可以反编译指定 ClassLoader 加载的那个类了;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
mc
|
mc
|
||||||
===
|
===
|
||||||
|
|
||||||
> Memory Compiler/内存编绎器,编绎`.java`文件生成`.class`。
|
> Memory Compiler/内存编译器,编译`.java`文件生成`.class`。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mc /tmp/Test.java
|
mc /tmp/Test.java
|
||||||
@@ -19,4 +19,4 @@ mc -c 327a647b /tmp/Test.java
|
|||||||
mc -d /tmp/output /tmp/ClassA.java /tmp/ClassB.java
|
mc -d /tmp/output /tmp/ClassA.java /tmp/ClassB.java
|
||||||
```
|
```
|
||||||
|
|
||||||
编绎生成`.class`文件之后,可以结合[`redefine`](redefine.md)命令实现热更新代码。
|
编译生成`.class`文件之后,可以结合[`redefine`](redefine.md)命令实现热更新代码。
|
||||||
@@ -104,7 +104,7 @@ $ thread 1 | grep 'main('
|
|||||||
at demo.MathGame.main(MathGame.java:17)
|
at demo.MathGame.main(MathGame.java:17)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 5. 通过jad来反编绎Main Class
|
## 5. 通过jad来反编译Main Class
|
||||||
|
|
||||||
```java
|
```java
|
||||||
$ jad demo.MathGame
|
$ jad demo.MathGame
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ mc /tmp/UserController.java -d /tmp
|
|||||||
redefine /tmp/com/example/demo/arthas/user/UserController.class
|
redefine /tmp/com/example/demo/arthas/user/UserController.class
|
||||||
```
|
```
|
||||||
|
|
||||||
* jad命令反编绎,然后可以用其它编绎器,比如vim来修改源码
|
* jad命令反编译,然后可以用其它编译器,比如vim来修改源码
|
||||||
* mc命令来内存编绎修改过的代码
|
* mc命令来内存编译修改过的代码
|
||||||
* 用redefine命令加载新的字节码
|
* 用redefine命令加载新的字节码
|
||||||
|
|
||||||
### redefine的限制
|
### redefine的限制
|
||||||
|
|||||||
Reference in new issue
Block a user