Hi all, The attached patch implements a new option --eval-command (-ex for short) which works similarly to the --command option except that it passes the command itself, rather than a file name containing commands. In most cases, this eliminates the need for temporary files or messing around with stdin when running programs via the debugger. For example: gdb hello.exe --batch -ex 'target sim' -ex load -ex run This option may be used in conjunction with the existing --command (-x) command and the order of the options is honoured. It is still necessary to use a script file if define/if/while, or any other nested construct, is required. Suggestions on how to deal with this would be welcome. Note that the patch assumes that the batch-silent and return-child-result patches have already been applied (although the implementation in no way depends on those features). Thanks Andrew Stubbs