Add convienient way for passing data to stdin
Let's say i have prog which reads data from stdin I run it using my shell's input redirection:
$ ./some-exec --foo --bar < redirected_file.txt
$ printf "some-string\ndupa\n" | ./some-exec --foo --bar
It would be nice if ugdb took stdin and passed it to debugged program so we could use it that way:
$ ugdb -- ./some-exec --foo --bar < redirected_file.txt
$ printf "some-string\ndupa\n" | ugdb -- ./some-exec --foo --bar
Sorry for taking so long to respond. I've been quite busy with work lately.
In general I like the idea and see how it would be useful to something to stdin via a script or something. I wonder about the best way to that, though. Consider that you might want to restart the debugging session after you've stepped over a critical function. When restarting the execution the program would possibly miss some part of the data passed via stdin.
What do you think about passing a script via commandline argument that would be executed to the program whenever it is started? Something like this
$ ugdb --stdin-script script.sh ./some-exec
where script.sh contains cat redirected_file.txt or printf "some-string\ndupa\n"?
Also sorry for taking so long to respond. I've had misconfigured github notfications.
Sorry for taking so long to respond. I've been quite busy with work lately. In general I like the idea and see how it would be useful to something to stdin via a script or something. I wonder about the best way to that, though. Consider that you might want to restart the debugging session after you've stepped over a critical function. When restarting the execution the program would possibly miss some part of the data passed via stdin.
Good point, I missed that.
What do you think about passing a script via commandline argument that would be executed to the program whenever it is started?
$ ugdb --stdin-script script.sh ./some-exec
where script.sh contains
cat redirected_file.txtorprintf "some-string\ndupa\n"?
Sounds good. If you pass stdin-script to shell (using something like popen() rather than fork/exec) it could be even used without writing separate script like that:
$ ugdb --stdin-script "curl something | tail" ./some-exec