How to run GDB from PHP and pass it RUN and BACKTRACE commands?
<p>We write a Web Interface for C++ programming olympiad in our school. We call students's executables with <code>popen</code> and write to their inputs with <code>fprintf</code>. The output is redirected to a special file and we can read it without problems. But we cannot run GDB and pass it RUN and BACKTRACE commands using <code>popen</code> and <code>fprintf</code>. I mean <code>fprintf(gdb_handle, "%s", "backtrace")</code> and <code>fprintf(gdb_handle, "%s", "run")</code> don't work at all. Are there any special ways to pass RUN and BACKTRACE to GDB?</p>