Inferior calls¶
The print
and call
commands take an expression to evaluate, and this
may include calls to functions in the program being debugged. These are known
as inferior calls. For example:
99% 1,168,376> print table_contains(table, 999)
$1 = true
The print
command takes an expression in the language of the program being
debugged, so that, for example, you can perform arithmetic on the result of the
inferior call:
99% 1,168,376> print (char *)strerror(13) + 3
$2 = 0x7ffff7f6f900 "mission denied"
Volatile mode¶
UDB runs inferior calls in volatile mode, that is, in a temporary process which is discarded when the call completes. This means that changes to program state are reverted after the inferior call completes, are not written into the event log, and do not appear in the Undo recording.
Side effects¶
The only side effects that are defined are writes to the standard output and error streams, provided that the program has at no point closed the corresponding file descriptors.
Note
UDB currently has an issue (#4695) in which standard output and error are closed for inferior calls in replay mode if they are not TTYs. This means writes to these streams will fail in this case. Contact Undo Support if this is affecting your usage of UDB.