2006-04-14 07:05:35 +00:00
|
|
|
Index: gdb-6.3/gdb/gstack.sh
|
2006-05-27 07:34:28 +00:00
|
|
|
===================================================================
|
|
|
|
--- gdb-6.3.orig/gdb/gstack.sh 2006-02-14 17:21:05.000000000 -0200
|
|
|
|
+++ gdb-6.3/gdb/gstack.sh 2006-04-14 03:17:12.000000000 -0300
|
|
|
|
@@ -17,17 +17,17 @@ fi
|
2006-04-14 07:05:35 +00:00
|
|
|
backtrace="bt"
|
|
|
|
if test -d /proc/$1/task ; then
|
|
|
|
# Newer kernel; has a task/ directory.
|
|
|
|
- if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
|
|
|
|
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
|
|
|
backtrace="thread apply all bt"
|
|
|
|
fi
|
|
|
|
elif test -f /proc/$1/maps ; then
|
|
|
|
# Older kernel; go by it loading libpthread.
|
|
|
|
- if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
|
|
|
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
|
|
|
backtrace="thread apply all bt"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
-GDB=${GDB:-gdb}
|
|
|
|
+GDB=${GDB:-/usr/bin/gdb}
|
|
|
|
|
|
|
|
if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
|
|
|
readnever=--readnever
|
2006-05-27 07:34:28 +00:00
|
|
|
@@ -39,7 +39,7 @@ fi
|
2006-04-14 07:05:35 +00:00
|
|
|
$GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 |
|
|
|
|
$backtrace
|
|
|
|
EOF
|
|
|
|
-sed -n \
|
|
|
|
+/bin/sed -n \
|
|
|
|
-e 's/^(gdb) //' \
|
|
|
|
-e '/^#/p' \
|
|
|
|
-e '/^Thread/p'
|