forked from omnister/piglet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpig
executable file
·41 lines (32 loc) · 866 Bytes
/
pig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# run piglet in the GNU debugger to catch the wiley coyote
stty sane
echo "pig is a script that runs pig.bin under the"
echo "gdb gnu debugger... don't worry about next two lines:"
(
cat <<!
handle SIGINT noprint pass
handle SIGTSTP noprint pass
handle all
set detach-on-fork on
run
bt
quit
yes
quit
yes
!
) > pig.tmp.$$
gdb --batch -q -command pig.tmp.$$ pig.bin | tee pigtrace
cat pigtrace | col -b > pig.trace.$$
mv pig.trace.$$ pigtrace
chmod 666 pigtrace
# check for abnormal exit, ask user for bug report
if ! grep "exited normally" pigtrace > /dev/null
then
echo "Piglet has crashed. Please send a description of what you were doing"
echo "plus the last 100 lines of the file named \"pigtrace\" to"
echo "<walker@omnisterra.com>. Thanks! - Rick Walker"
else
rm pigtrace
fi
rm pig.tmp.*