idea中debug相关
debug中的@
this 当前对象,就是指的 HiServlet这个对象,@后面相当于对象id(debug和VM进行通信的对象id,只有Debug的时候才会有)
java文档 JDWP中 对这个id的描述:
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.
唯一标识目标VM中的对象。在JDWP命令和应答中,一个特定的对象在其整个生命周期内(或直到该对象被显式释放)将由一个objectID标识。ObjectID不会被重用来标识不同的对象,除非它已被显式释放,无论引用的对象是否已被垃圾收集。objectID为0表示空对象。
请注意,对象ID的存在并不会阻止对象的垃圾收集。任何使用对象ID访问垃圾收集对象的尝试都将导致无效的对象错误代码。可以使用DisableCollection命令禁用垃圾收集,但通常不需要这样做。
debug调试技巧
先下一个断点,然后右键点evaluate
切换代码模式和表达式模式
- Tips:idea的debug数据是简化版的,想看完整版需要去掉这个对勾
- 想查看空值的话去掉这个对勾
本文来自博客园,作者:紫英626,转载请注明原文链接:https://www.cnblogs.com/recorderM/p/15973305.html