DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
sdb: symbolic debugger

Calling functions

It is possible to call any of the functions of the program from sdb. This feature is useful both for testing individual functions with different arguments and for calling a user-supplied function to print-structured data. There are two ways to call a function:

   *proc(arg1, arg2, ...)
   *proc(arg1, arg2, ...)/m
The first simply executes the function. The second is intended for calling functions. (It executes the function and prints the value that it returns.) The value is printed in decimal unless some other format is specified by m. Arguments to functions may be integer, character or string constants, or variables that are accessible from the current function.

An unfortunate bug in the current implementation is that if a function is called when the program is not stopped at a breakpoint (such as when a core image is being debugged) all variables are initialized before the function is started. This makes it impossible to use a function that formats data from a dump.

The above functionality requires that the user link with the -lg option; if this is not the case, sdb will print a warning message.


Next topic: Machine language debugging
Previous topic: Running the program

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003