为什么调试程序在使用方法入口调试时会减慢这么多? [英] Why does the debugged program slow down so much when using method entry debugging?

查看:138
本文介绍了为什么调试程序在使用方法入口调试时会减慢这么多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jdi接口来创建一个调试器,当我使用MethodEntryRequests来启用方法条目跟踪时,被调试的程序减慢了几十个。我已经为主线程设置过滤器,并将策略挂起到SUSPEND_EVENT_THREAD。 Classfilter是有限的,如果我打印任何收到的事件,它不会显示超过几十个,所以它不应该收到太多的它们。我正在本地进行调试,并在调试的java程序中遵循一种命令行:



-Xdebug -Xrunjdwp:transport = dt_socket,suspend = y,server = y,address = 1337

解决方案

简而言之,解释器设置方法条目时。我不认为这个有这样的...



以前在调试模式下运行的所有代码都是这样,但是它在1.4中被增强了... ...现在HotSpot适用于'full -speed'调试,除了方法入口和出口,观察点以及单步执行或包含断点的方法中。


I'm using jdi interfaces to create a debugger and when I use MethodEntryRequests to enable method entry tracing the debugged program slows down by factor of tens. I have set filter for main thread and suspend policy to SUSPEND_EVENT_THREAD. Classfilter is limited and if I print any received events it doesn't show more than couple of dozen of those so it shouldn't receive too much of them. I'm debugging locally and having followind kind of command-line with the debugged java program:

-Xdebug -Xrunjdwp:transport=dt_socket,suspend=y,server=y,address=1337

解决方案

The short answer is that execution runs through the interpreter when method entries are set. I don't think there is anyway around this...

This used to be the case for all code running in debug mode but it was enhanced in 1.4... now HotSpot works for 'full-speed' debugging except in the case of method entries and exits, watchpoints and when single stepping or in methods that contain breakpoints.

这篇关于为什么调试程序在使用方法入口调试时会减慢这么多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆