From 61f3d9af1ef17c74650ff3c92617a7d4aac32974 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Tue, 12 Nov 2019 19:47:22 +0800 Subject: [PATCH] update doc. --- site/src/site/sphinx/en/redefine.md | 4 ++++ site/src/site/sphinx/redefine.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/site/src/site/sphinx/en/redefine.md b/site/src/site/sphinx/en/redefine.md index 046bb8766..b3f2c55a3 100644 --- a/site/src/site/sphinx/en/redefine.md +++ b/site/src/site/sphinx/en/redefine.md @@ -9,6 +9,10 @@ Reference: [Instrumentation#redefineClasses](https://docs.oracle.com/javase/8/do > The `reset` command is not valid for classes that have been processed by `redefine`. If you want to reset, you need `redefine` the original bytecode. + +> The `redefine` command will conflict with the `jad`/`watch`/`trace`/`monitor`/`tt` commands. After executing `redefine`, if you execute the above mentioned command, the bytecode of the class will be reset. +> The reason is that in the JDK `redefine` and `retransform` are different mechanisms. When two mechanisms are both used to update the bytecode, only the last modified will take effect. + ### Options |Name|Specification| diff --git a/site/src/site/sphinx/redefine.md b/site/src/site/sphinx/redefine.md index c4ab86155..4bcbf6428 100644 --- a/site/src/site/sphinx/redefine.md +++ b/site/src/site/sphinx/redefine.md @@ -9,6 +9,9 @@ redefine > `reset`命令对`redefine`的类无效。如果想重置,需要`redefine`原始的字节码。 +> `redefine`命令和`jad`/`watch`/`trace`/`monitor`/`tt`等命令会冲突。执行完`redefine`之后,如果再执行上面提到的命令,则会把`redefine`的字节码重置。 +> 原因是jdk本身redefine和Retransform是不同的机制,同时使用两种机制来更新字节码,只有最后修改的会生效。 + ### 参数说明 |参数名称|参数说明|