简体   繁体   中英

Visual Studio 2008 - Debugging tips/tricks - Continue “until next function” or “until next file”

Is there any way to tell the debugger to just continue until the next file is accessed, and/or until the next (developer written) function is accessed, without setting debug points ahead of time? I'm kind of new to VS debugging so all I use right now are f5, f10, and f11.

There is currently no way to do what you are asking. The main ways of telling VS to go until something happens are the following

  • Hit F5 and VS will go until the next user breakpoint or ,depending on your settings and where it occurs, the next exception is raised
  • Right click and select "Run to cursor"
  • Shift-F11 breaks out of the current method

Run to cursor doesn't require an explicit break point but it does require that you know where you want to break next.

You can right-click and select "run to cursor" if you just want to run to a specific line ahead in the execution stream.

Another one is Shift-F11 which finishes the current method and breaks again when you get back to the caller.

似乎没有办法做我想做的事

Actually, there is a way to set conditional break points.

  1. Click in the left margin on the line where you want to break, as usual. (or F9)
  2. Right-click on the red dot. In the context menu, click on "Condition...."
  3. In the dialog, set your condition, eg, fileName == "foo"
  4. Hit F5 and go until the conditional break is hit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM