int system(const char *command);
systemreturn value by calling
WEXITSTATUS(retval). In case /bin/sh could not be executed, 127 is returned.
gdb takes over the full task of calling the necessary host calls
to perform the
system call. The return value of
the host is simplified before it's returned
to the target. Any termination signal information from the child process
is discarded, and the return value consists
entirely of the exit status of the called command.
Due to security concerns, the
system call is by default refused
by gdb. The user has to allow this call explicitly with the
set remote system-call-allowed 1 command.
set remote system-call-allowed
systemcalls in the File I/O protocol for the remote target. The default is zero (disabled).
show remote system-call-allowed
systemcalls are allowed in the File I/O protocol.