In This Book

Changing the Environment

Commonly, you may need to change environment because you cannot access a variable or expression from the current point of execution. For example, setting a watchpoint on a variable fails and a not found in current environment message is displayed.

To change the environment, use one of the following methods:

 

 

Invoke one of the selections under the Visit menu.

 

 

 

 

 

 

You can specify a procedure name, a line number, or a ￿le name. Or you can

 

 

specify the environment by using the debugger location syntax described in

 

 

the online help.

 

 

 

Use Visit:PC to return to the current point of execution.

 

 

Use one of the up/down arrow buttons located next to the Stack Frame:

 

 

 

 

 

 

label above the source display.

 

 

These buttons allow you to change environment relative to frames on the

 

 

call/return stack.

 

 

 

Similar up/down arrow buttons are available from the Stack View dialog box

 

 

that you can invoke from Show:Stack .

 

 

Use the environment command and specify a location or a stack frame.

 

 

 

 

 

 

See the online help for the syntax to use when specifying a location.

 

 

The reserved identi￿er `env(+ n -n)is useful for changing environments

7

 

relative to frames on the call/return stack. See \Frame Block Quali￿ed

 

 

Names" for more information.

 

 

For example:

 

 

 

env 17

Changes environment to line 17 in the source code.

 

 

env

Changes environment to the procedure, print_average .

 

 

print_average

 

 

 

env `env(-1)

Changes environment up one frame (toward `main) on

 

 

 

the call/return stac k.

 

Identifying Program Objects 7-3