citic / botNeumann

A metaphorized and gamified visualization of the von Neumann architecture for programming learning
1 stars 0 forks source link

Redirect standard input/output to files #122

Closed jeissonh closed 7 years ago

jeissonh commented 7 years ago

On Unix systems, GDB accepts to use a pseudoterminal to send input to the inferior, and capture its standard output and error, with set-tty commands (GDB manual 4.6). On Windows, the inferior's IO is done directly in the same tty that GDB uses. In any case, the standard input/output of the inferior can be redirect in the run command:

run < /tmp/sum_xy.input > /tmp/sum_xy.output

In all OS redirecting input to a file may be very convenient. [In the future this redirection may be disabled only when user runs his/her own code not linked to a botnu file].

Redirecting the standard output may be useful in Windows, but probably GDB manages it well. Standard input is the difficult one, at least in Gede and QtCreator.

jeissonh commented 7 years ago

On Unix systems standard input/output/error are redirected to the files of the test case. Implemented in commit 52f224f8786d526a1f998a118884e3291effb013