esolve
V2EX  ›  问与答

用 BTrace 查看 Java 进程,如果方法参数和返回类型是自定义类型怎么办?

  •  
  •   esolve · Mar 29, 2018 · 1514 views
    This topic created in 3034 days ago, the information mentioned may be changed or developed.

    譬如下面,参数类型和返回类型是基本类型 int,但是如果是自定义类型怎么办?

    @BTrace(unsafe = true)
    public class BtraceTest {
    @OnMethod(clazz = "Demo", method = "getResult", location = @Location(Kind.RETURN))
    public static void getParamAndResultByBtrace(int param1, int param2, @Return int result) {
    
      System.out.println("===========BTrace begin==================");
      System.out.println("the first param:" + param1);
      System.out.println("the second param:" + param2);
      System.out.println("result: " + result);
      System.out.println("===========BTrace end====================");
      }
    

    }

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1323 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 37fae26a · 22ms · UTC 16:51 · PVG 00:51 · LAX 09:51 · JFK 12:51
    ♥ Do have faith in what you're doing.