问题
Ok, I have a php calling a shell script:
shell_exec("sh /home/u-pc/Downloads/coredumps/analyze.sh");
In the shell script (analyze.sh) I have:
...# Other setup code...
gzip -d coredump.gz
tar xvg symbols.gz
gdb -batch -ex "set logging on" -ex "bt" myprogram mycoredump -ex "set logging off"
Now php is able to execute the shell script but only until untar of symbols. It doesn't seem to run the gdb command. I get no stacktrace log file.
Interesting thing is, when I run the analyze.sh by itself, everything works fine and gdb.txt is created with the "bt" output. Any ideas? thanks
来源:https://stackoverflow.com/questions/48715364/run-gdb-batch-from-shell-script-through-shell-exec-in-php