Jump to Location

You can use Jump to Location commands to jump over a section of code that may be causing problems, without executing that code. However, jumping over implicit function calls such as constructors or destructors may produce umpredictable results.

Consider the following code excerpt:

    MyType a=func1();           
    MyType b=func2();           
    a+=b;                       
    if (a.mem==True) {          
       // ...                   
    } else {                    
       // ...                   
    }                           

Suppose you have noted that the addition of object b to object a is resulting in the execution of the if block, whereas you expected the else block to execute. You suspect that the statement a+=b; may be in error (or perhaps that the operator+= you have defined is not working as expected). To test your theory, you want to see whether skipping over the addition of b to a solves the problem. This is called jumping over, because the code you jump over does not get executed. To jump over the statement a+=b;do the following:

  1. Step over the definitions and assignments for a and b.
  2. Click mouse button 2 over the if statement. A popup menu appears.
  3. Select the object, and, from the cascading menu, Jump to This Statement.

The if statement is now the next statement to be executed, but the statement a+=b;was not executed. From here you can determine whether the suspect statement was indeed causing the problem.



Summary of Step Commands


Jump over Code without Executing It
Step over a Function