Hi all, I have a quick problem that I am sure someone here has an
elegant solution for.
I have a ruby script that runs in a loop an external linux process via
gdb:
…
until checks.empty? do
…
begin
Timeout::timeout(5) {
system("/usr/bin/gdb --args #{proc} 2>/dev/null")}
rescue Timeout::Error
end
…
end
…
What I am trying to do is have gdb terminate after 5 seconds of activity
and move on to debugging the next task. What I am finding however is
that after 5 seconds, my ruby script quits and returns to the command
line and the gdb and debugged processes are left running in the
background.
I can then hit fg and it will start again but this is not what I want; I
want my script to execute gdb and launch it to debug a program, after 5
seconds to terminate debugging and move on to the next binary to debug.
much regards