Run gdb batch from shell script through shell_exec in php

[亡魂溺海] 提交于 2019-12-11 05:09:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!