是否可以设置“数据断点”?关于返回值
场景是:有很深的调用层次,每次调用都会返回HRESULT。如果发生错误,函数将返回 S_FALSE 或 S_ERROR,如果调用返回错误,调用者将直接返回错误代码。通常所有函数都会返回S_OK。 因此,当调试一个问题时,我需要做很多次试验,看看哪个调用返回!S_OK,然后更深入,继续......直到找到导致错误的最终位置。
我想知道它是否能够在返回值(eax?)上创建“数据断点”,因此当返回值更改或返回值等于某个值时,程序可以停止......
The scenario is: there is a deep call hierarchy and each call will return HRESULT. If something bad happens, function will return S_FALSE or S_ERROR, and if a call return error, the caller will directly return the error code. normally all function will return S_OK.
So when debug an issue, I need to do many trials, see which call returns !S_OK, and go deeper, and go on... until I found the ultimate place which cause a error.
I am wondering is it able to create a "data breakpoint" on return value (eax?) So when return value changed or return value equal to some value, the program can stop ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不直接将返回值分配给变量,每当变量等于某个值时就在变量上设置一个断点(这称为条件断点),然后只返回变量而不是返回 S_FALSE/S_ERROR/S_OK 等?
例如:
编辑
如果您不想/无法更改代码,您可能需要查看此线程:
是否可以根据函数将要返回的内容在函数末尾设置条件断点?
Why not just assign the return value to a variable, set a break on the variable whenever it equals a certain value (this is known as a conditional breakpoint), and just return the variable instead of returning S_FALSE/S_ERROR/S_OK,etc.?
ex:
EDIT
If you don't want to/can't change the code, you may want to check out this thread:
Is it possible to set a conditional breakpoint at the end of a function based on what the function is about to return?