提交 401f09eb 编写于 作者: N Ning Yu

packcore: let runGDB.sh accepts extra gdb arguments

runGDB.sh is a convenient helper script to load the coredump, now we
allow passing extra gdb arguments to it via cmdline like below:

    ./runGDB.sh --batch -ex 'bt'

This makes it more friendly in automated scripts.

Also refactored the code to use python multiline string instead of
multiple prints.

(cherry picked from commit 0ab035be)
上级 0d85e83e
...@@ -157,11 +157,17 @@ def _copyFilePath(src, dst): ...@@ -157,11 +157,17 @@ def _copyFilePath(src, dst):
def _generateGDBScript(b, c): def _generateGDBScript(b, c):
with open('runGDB.sh', 'w') as f1: with open('runGDB.sh', 'w') as f1:
print >>f1, '#!/bin/bash' print >>f1, '''\
print >>f1, 'unset PYTHONHOME' #!/bin/bash
print >>f1, 'unset PYTHONPATH' unset PYTHONHOME
print >>f1, 'curDIR=`pwd`' unset PYTHONPATH
print >>f1, '/usr/bin/gdb --eval-command="set sysroot $curDIR" --eval-command="core %s" %s' % (c, b) curDIR=`pwd`
/usr/bin/gdb \\
--eval-command="set sysroot $curDIR" \\
--eval-command="core {core}" \\
{binary} \\
"$@"
'''.format(core=c, binary=b)
os.chmod('runGDB.sh', 0755) os.chmod('runGDB.sh', 0755)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册