call

Call a function in the debuggee.

Syntax

call expression (parmlist)

Parameters

expression

Expression denoting a function.

parmlist

List of parameters.

Description

Specify the function as if you were calling it from within the application. If the function has no parameters, specify empty parentheses (()).

For multithreaded applications, the debugger calls the function in the context of the current thread. For C++ applications, when you set the $overloadmenu debugger variable to 1 and call an overloaded function, the debugger lists the overloaded functions and calls the function you specify. For class methods, you also need to specify the class instance. For example:

call classInstance.methodName( parmlist )

When the function you call completes normally, the debugger restores the stack and the current context that existed before the function was called.

The call command executes the specified function with the parameters you supply and then returns control to the debugger prompt when the function returns. The call command discards the return value of the function. If you embed the function call in the expression parameter of a print command, the debugger prints the return value after the function returns.

While the program counter is saved and restored, calling a function does not shield the program state from alteration if the function you call allocates memory or alters global variables. If the function affects global program variables, for instance, those variables will be changed permanently.

Note iconNote

Functions compiled without the debugger option to include debugging information may lack important parameter information and are less likely to yield consistent results when called.

Example

The following example, the call command results in the return value being discarded while the embedded call passes the return value of the function to the print command, which in turn prints the value.

(idb) call earth->distance()
(idb) print earth->distance()
149600

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.