Hi all, The attached patch implements a new option --return-child-result. This option causes GDB to return the return value of the last child (inferior) program to run. The patch assumes that the batch-silent patch has already been applied. Note that 'quit ' still works as expected. Also, any exit through a mechanism other than quit_force (i.e. errors) gives the same exit code as it did before. Batch mode has been adjusted to exit through quit_force in order to ensure it give the right result. I am not sure that this has been implemented in the best way. The declaration of extern variables probably ought to be moved to a header file somewhere, but I'm not sure which is best. It has also been suggested that it ought to use the value stored in the existing $_exitcode convenience variable. Thanks Andrew Stubbs