[OS]/Embedded&Linux

gdb로 core파일 trace해서 파일로 저장해주는 스크립트

하늘을닮은호수M 2006. 3. 21. 22:34
반응형
#!/bin/sh
#
# ./moncore.sh > /dev/null 2>&1 & (sh)
# ./moncore.sh >& /dev/null & (csh)
#
#
#debugger=dbx
debugger=/opt/langtools/bin/gdb
while :
do
if [ -f core ]
then
now=`date '+%Y%m%d-%H%M%S'`
appname=`file core | sed "s/.*'(.*)'.*/1/g"`
newcore=core.$appname.$now.core
mv core $newcore
text=core.$appname.$now.txt
(
echo ""
echo ""
echo ""
echo "where"
echo "quit"
) | $debugger $appname $newcore > $text
fi
sleep 5
done
반응형

'[OS] > Embedded&Linux' 카테고리의 다른 글

vi manual  (0) 2006.04.22
gdb 사용법  (0) 2006.03.21
[네트워크 이야기] 넌 딱 걸렸어, log ③  (0) 2006.03.21
Single Unix Specification : version3  (0) 2006.03.10
커널 업그레이드 2.4 -> 2.6  (0) 2006.03.03