There is a article in MSDN which provides the procedure: http://msdn.microsoft.com/en-us/library/aa295838(VS.60).aspx#_core_setting_a_breakpoint_when_a_register_expression_is_true
But it seems that i tis for visual studio 6 ... Actually I can not find the "Breakpoint" entry under "Edit" Menu...
Do you know how to do that? I want to break when EAX changes to an error code so I can find the place where this error is开发者_开发百科 returned.
Assuming you are using Visual Studio 2008, you can find it in its own Debug menu.
You need to create a breakpoint. In the Breakpoint Windows ( Debug->Windows->Breakpoint ) right-click the BP and select condition.
In the condition-field you can just type the expression ( "eax == ebx" ).
Just to be explicit about what @DarthCoder said:
- First create a plain breakpoint, so there's something to edit
- Then Debug->Windows->Breakpoint brings up the list of breakpoints, including the one you just made
- Right-click on the breakpoint, pick "Condition"
- Enter the condition, such as eax==ebx
精彩评论