]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(exval): Quote [ in pattern.
authorUlrich Drepper <drepper@redhat.com>
Thu, 4 Apr 2002 00:08:42 +0000 (00:08 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 4 Apr 2002 00:08:42 +0000 (00:08 +0000)
Adjust for new output format of the backtrace functions.

debug/catchsegv.sh

index 8e32ed44232c3e798a2dabe23a779c34d3e85b14..6781ac1aabf7eb626cc628a76fa2512957e73722 100755 (executable)
@@ -38,7 +38,7 @@ if test $# -eq 0; then
       ;;
     --v | --ve | --ver | --vers | --versi | --versio | --version)
       echo 'catchsegv (GNU libc) @VERSION@'
-      echo 'Copyright (C) 2001 Free Software Foundation, Inc.
+      echo 'Copyright (C) 2002 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 Written by Ulrich Drepper.'
@@ -87,17 +87,18 @@ if test -f "$segv_output"; then
   sed '/Backtrace/q' "$segv_output"
   sed '1,/Backtrace/d' "$segv_output" |
   (while read line; do
+     line=`echo $line | sed "s@^$prog\\(\\[.*\\)@\1@"`
      case "$line" in
-       [*) addr=`echo "$line" | sed 's/^\[\(.*\)\]$/\1/'`
-          complete=`addr2line -f -e "$prog" $addr 2>/dev/null`
-          if test $? -eq 0; then
-             echo "`echo "$complete"|sed 'N;s/\(.*\)\n\(.*\)/\2(\1)/;'`$line"
-           else
-             echo "$line"
-           fi
-           ;;
-        *) echo "$line"
-           ;;
+       \[*) addr=`echo "$line" | sed 's/^\[\(.*\)\]$/\1/'`
+           complete=`addr2line -f -e "$prog" $addr 2>/dev/null`
+           if test $? -eq 0; then
+             echo "`echo "$complete"|sed 'N;s/\(.*\)\n\(.*\)/\2(\1)/;'`$line"
+           else
+             echo "$line"
+           fi
+           ;;
+         *) echo "$line"
+           ;;
      esac
    done)
    rm -f "$segv_output"