DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using the UDK

Execution and Tracing Commands

dbx command debug command Description Notes
run [args] [< filename][>[> filename]] run [-p proc_list][-bfr][-u location] Run the current program being debugged Debug treats the run command also as continue, so by using run when the execution of a program has been halted will continue from that point. This is different from dbx's run as it restarts program. Note that the redirection symbols in debug can be used with any command. Debug also offers pipes.
rerun [args] [< filename][>[> filename]] create [-f none|procs|all][-dr][-l start_loc][command_line] Rerun the program and append the arguments to the previous arguments passed to the program Debug's create command (with no arguments) offers a similar functionality to dbx's rerun command. Note that debug does not append given arguments with the create command, but treats it as a request to debug a new program.
setenv name value set [-p proc_list] debug_or_user_var [=] expr [,expr]
export $username
Set the value of an environment variable in the environment of the debugged program. In debug, the set command must be used with a user variable to set the value and then exported to the environment of the debugged program with the export command. Note that this has to be done before the execution of the debugged program.
unsetenv name N/A Unset the value of the variable.  
trace [inst][in routine][if condition]
trace [inst] line-number|address [if condition]
trace routine [in routine2][if condition]
(various) Display source lines (or machine instructions) when executed, display the arguments and results of routines There are a number of ways of emulating the trace functionality. Aliases can be created on the variations of: <P>alias trace = onstop { step } <P>debug variables %func, %frame, etc.. can be used to determine the current execution location.
trace [inst][change] variable [in routine][if condition]
trace [inst] change address [in routine][if condition]
trace [inst] access variable [in routine][if condition]
trace [inst] access address [in routine][if condition]
(various) Display when changes (or accesses) are made to variables or memory locations. This functionality can be reasonably matched by debug's stop command used with expressions.
stop [inst] if condition
stop [inst] at line_number|address [if condition]
stop in routine [if condition]
stop [inst] [change] variable [if condition]
stop [inst] [change] address [if condition]
stop [inst] access variable [if condition]
stop [inst] access address [if condition]
stop [-p proc_list] [[-q] [-c count] stop_expr] Stop execution when execution reaches a given location, or when a variable or memory location is changed or accessed. All the various forms of the dbx stop command can be matched by the debug stop command used with expressions.
when [inst] at line_number|address [if condition] {command; [command; ... ]}
when in routine [if condition] {command; [command; ... ]}
when [inst] condition {command; [command; ... ]}
when [inst] change variable [if condition] {command; [command; ... ]}
when [inst] change address [if condition] {command; [command; ... ]}
when [inst] access variable [if condition] {command; [command; ... ]}
when [inst] access address [if condition] {command; [command; ... ]}
stop [-p proc_list] [[-q] [-c count] stop_expr [command]] Execute a series of commands when execution reaches a given location, when a condition is true, or when a variable or memory location is changed or accessed. All the various forms of dbx's when command can be matched by debug's stop command.

status [> filename] events [-p proc_list][event_num ...] List the user specified events for the current program (break points, etc..) and their current status. The debug events command also provides information about system calls, signals and exceptions)
delete event_num ... delete event_num ... The event corresponding to event_num is removed. Debug provides another variation of this command for deletion of event types.
disable event_num ... disable event_num ... Disable the specified events. Debug provides another variation of this command to disable event types.
enable event_num ... enable event_num ... Enable previously disabled events. Debug provides another variation of this command to enable event types.
catch number|signal_name signal -d [signal ....]
signal [-p proc_list][[-q] signal ... [cmd]]
Trap a specified signal. Debug offers greater control over signals. Refer to the relevant documentation.
ignore number|signal_name signal -d -i [signal ....]
signal [-p proc_list] [[-iq] signal ... [cmd]]
Stop trapping a specified signal. Debug offers greater control over signals. Refer to the relevant documentation. Note that the -i option can be also used to re-establish the default action for a signal.
cont integer run [-p proc_list][-bfr][-u location] Continue execution from where the program stopped.  

cont signal_name kill [-p proc_list][signal] followed by run [-p proc_list][-bfr][-u location] Process continues as though it received the given signal Debug needs to have the run command executed after the kill command is given.
skip [n] (alias) Continue execution from where stopped. If n is specified, that many breakpoints are ignored before the program stops. If n is not given, one breakpoint is skipped. This functionality can be emulated with debug's onstop command, e.g. <P>if ($# == 0) set $skip=1; else set $skip=$1 +0; onstop { if ($skip > 0) { set $skip=$skip - 1; run } else delete %thisevent}; run <P>Note that the "+0" is required when no parameters are passed to skip.
step [n] step [-p proc_list] [-bfq] [-c count] Execute a number of source lines (default is 1) Debug provides more control to the user for stepping.
next [n] step [-p proc_list] [-bfq] -o [-c count] Execute a number of source lines (default is 1). If a line contains a call to a procedure or function the command does not stop at the beginning of that block. Debug provides more control to the user for stepping. Note that there is a standard alias, next, for debug.
return [procedure] run -r Continue until a return to procedure is executed, or until the current procedure returns if none is specified. Debug's run -r continues execution until a the return address of the current function is reached. Note that you cannot specify a procedure name with the -r option.
call procedure(parameters) (various) Execute the object code associated with the named procedure or function. A call to a function or procedure under debug can be done using any command that allows an expression for an argument. For example: print procedure(a, b, c) or set $MYRET=function(a, b).
jump line_number jump [-p proc_list] location Continue until a return to procedure is executed, or until the current procedure returns if none is specified. Debug's jump command can be used with any valid location.
goto line_number run -u location Continue execution and stop before the fist instruction at the specified line number is executed. Debug's run command with the -u option can be used with any valid location.


Next topic: Printing Variables and Expressions
Previous topic: Debugger Variables

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004