These functions control the connection to the target. For remote targets this may mean establishing and tearing down links using protocols such as TCP/IP. For native targets, these functions will be more concerned with setting flags describing the state.
to_open
. This function is invoked by the
GDB target command. Any additional
arguments (beyond the name of the target being invoked) are
passed to this function. to_open
should
establish the communications with the target. It should
establish the state of the target (is it already running for
example), and initialize data structures appropriately.
This function should not start the target
running if it is not currently running—that is the job of
the functions (to_create_inferior
and
to_resume
) invoked by the GDB
run command.
to_xclose
and
to_close
. Both these functions should close
the remote connection. to_close
is the
legacy function. New implementations should use
to_xclose
which should also free any memory
allocated for this target.
to_attach
. For targets which can run
without a debugger connected, this function attaches the
debugger to a running target (which should first have been
opened).
to_detach
. Function to detach from a
target, leaving it running.
to_disconnect
. This is similar to
to_detach
, but makes no effort to inform
the target that the debugger is detaching. It should just drop
the connection to the target.
to_terminal_inferior
. This function
connects the target's terminal I/O to the local terminal. This
functionality is not always available with remote targets.
to_rcmd
. If the target is capable of
running commands, then this function requests that command to be
run on the target. This is of most relevance to remote targets.