
UDI Services Overview
2-4
Universal Debugger Interface Specification
When a DFE starts up a new connection, it should always call
UDICreateProcess
. TIPs that support only raw machine debugging (type 0
TIPs) return a process ID (PId) of
UDIProcessProcessor
. TIPs that support
only program debugging (type 1 TIPs) must return a different PId. TIPs that
differentiate between program and machine resources (type 2 TIPs) should also
return a PId other than
UDIProcessProcessor
. TIPs that return process
UDIProcessProcessor
in response to a
UDICreate
call can still support OS
services. Note, also, that
UDICreateProcess
has the side effect of setting the
current process as the one created.
In most cases, the DFE downloads the program to be debugged. In all cases,
the program to be debugged is downloaded into a process space compatible
with the TIP. If the current process is
UDIProcessProcessor
, the DFE simply
sets the PC to the downloaded program's entry point and is ready to execute.
(A
UDIInitializeProcess
when the process is
UDIProcessProcessor
performs
a target reset).
If the current process is not
UDIProcessProcessor
, then the DFE should call
UDIInitializeProcess
. The TIP initializes the process so that the next
instruction to be executed is the first instruction in the process (i.e., the entry
point). The TIP determines what happens to any other
UDIInitializeProcess
parameters.
DFEs that debug programs rather than the raw machine can now inspect the
PC (using UDI PC space). If the PC is not at the entry point of the program,
the DFE sets a breakpoint at the entry point and executes up to it. Otherwise,
stepping the TIP may result in executing one or more instructions that the DFE
did not download, and this may confuse the DFE.
As stated earlier,
UDICreateProcess
also allows multi–tasking TIPs to create
a new process context. For TIPs that allow multiple processes, but do not allow
run–time creation of processes, this call would still be used to determine
whether a process can be debugged. A process is executed in the context of an
operating environment. When
UDIInitializeProcess
is called, command line
arguments for the process are passed. The TIP determines what to do with the
command line arguments.
Because
UDIStep
may possibly exclude calls to other functions and/or traps,
stepping may take a significant amount of time. As a result,
UDIStep
, like
UDIExecute
, returns as soon as stepping has begun. Both
UDIStep
and
UDIExecute
stop when a breakpoint is hit, when the TIP can no longer
continue executing the process, or when
UDIStop
is called.