gpt4 book ai didi

java - 调试 Java 时解密变量信息

转载 作者:搜寻专家 更新时间:2023-10-30 20:00:58 26 4
gpt4 key购买 nike

我正在使用 IntelliJ IDEA 8 调试一些 Java,但这个问题可能适用于所有 Java 调试器。在变量列表中,它们显示为:

myVariable = {some.package.SomeClass@12345}

我很好奇类名后面的数字。确切的数字是多少?如果两个变量引用的是同一个底层对象,那么两个变量的编号是否相同?

提前致谢。

最佳答案

即JVM上报的objectId,详情请见JDWP specification .

Uniquely identifies an object in the target VM. A particular object will be identified by exactly one objectID in JDWP commands and replies throughout its lifetime (or until the objectID is explicitly disposed). An ObjectID is not reused to identify a different object unless it has been explicitly disposed, regardless of whether the referenced object has been garbage collected. An objectID of 0 represents a null object. Note that the existence of an object ID does not prevent the garbage collection of the object. Any attempt to access a a garbage collected object with its object ID will result in the INVALID_OBJECT error code. Garbage collection can be disabled with the DisableCollection command, but it is not usually necessary to do so.

关于java - 调试 Java 时解密变量信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2322903/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com