所有运行时变量访问的 java 跟踪
我需要记录对任何变量或对象的所有运行时访问 我当前的方向是用修改后的字节码标记类文件 性能目前不是问题
BCEL 看起来很不错,可以向字节码中的每个相关操作码添加一些跟踪指令
但是,我还想从源文件中添加一些语义信息 例如这个变量是一个for循环计数器 这需要一些 AST/解析树操作。
那么 ASM / JavaAssist 是更好的选择吗???
记录变量的使用是关键要求 - 因此字节码看起来是处理此问题的正确级别。 但最终我将不得不访问源解析树以获取更多语义信息
有什么想法吗?
PS这将是一个大型长期项目
I need to log all run-time access to any variable or object
My current direction is to markup the classfile with modified bytecode
Performance is not currently an issue
BCEL looks nice to add some trace instructions to each relevant opcode in the bytecode
However, i would also like to add some semantic information from the source file
e.g. this variable is a for-loop counter
This would require some AST / parsing tree manipulation.
So are ASM / JavaAssist better choices ???
Logging the variable-usage is the key requirement - so bytecode looks like the right level to handle this.
But eventually i will have to access the source parse tree to get more semantic information
Any thoughts ?
p.s. this will be a large prolonged project
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 JavaSnoop (https://www.aspectsecurity.com/research/appsec_tools/javasnoop/)。它将帮助您监视函数调用。
Look into JavaSnoop (https://www.aspectsecurity.com/research/appsec_tools/javasnoop/). It will help you monitor function calls.