Don't close thread handles provided by WaitForDebugEvent
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index 4e4cc827b895ccbd518130007ebbd14b65584a54..e297b1c56a09b4fb63874f34a4ad818ec010b629 100755 (executable)
 LANG=C ; export LANG
 LC_ALL=C ; export LC_ALL
 
-
-compare_new ()
-{
-    file=$1
-    if test ! -r "${file}"
-    then
-       echo "${file} missing? cp new-${file} ${file}" 1>&2
-    elif diff -u "${file}" "new-${file}"
-    then
-       echo "${file} unchanged" 1>&2
-    else
-       echo "${file} has changed? cp new-${file} ${file}" 1>&2
-    fi
-}
-
-
 # Format of the input table
 read="class returntype function formal actual staticdefault predefault postdefault invalid_p print garbage_at_eol"
 
@@ -50,6 +34,7 @@ do_read ()
     # On some SH's, 'read' trims leading and trailing whitespace by
     # default (e.g., bash), while on others (e.g., dash), it doesn't.
     # Set IFS to empty to disable the trimming everywhere.
+    # shellcheck disable=SC2162
     while IFS='' read line
     do
        if test "${line}" = ""
@@ -75,7 +60,7 @@ ${line}
 EOF
            IFS="${OFS}"
 
-           if test -n "${garbage_at_eol}"
+           if test -n "${garbage_at_eol:-}"
            then
                echo "Garbage at end-of-line in ${line}" 1>&2
                kill $$
@@ -93,19 +78,19 @@ EOF
            done
 
            case "${class}" in
-               m ) staticdefault="${predefault}" ;;
+               m ) staticdefault="${predefault:-}" ;;
                M ) staticdefault="0" ;;
                * ) test "${staticdefault}" || staticdefault=0 ;;
            esac
 
            case "${class}" in
            F | V | M )
-               case "${invalid_p}" in
+               case "${invalid_p:-}" in
                "" )
                    if test -n "${predefault}"
                    then
                        #invalid_p="gdbarch->${function} == ${predefault}"
-                       predicate="gdbarch->${function} != ${predefault}"
+                       predicate="gdbarch->${function:-} != ${predefault}"
                    elif class_is_variable_p
                    then
                        predicate="gdbarch->${function} != 0"
@@ -139,7 +124,7 @@ EOF
 
 fallback_default_p ()
 {
-    { [ -n "${postdefault}" ] && [ "x${invalid_p}" != "x0" ]; } \
+    { [ -n "${postdefault:-}" ] && [ "x${invalid_p}" != "x0" ]; } \
        || { [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ]; }
 }
 
@@ -1202,11 +1187,11 @@ EOF
 #
 # The .log file
 #
-exec > new-gdbarch.log
+exec > gdbarch.log
 function_list | while do_read
 do
     cat <<EOF
-${class} ${returntype} ${function} ($formal)
+${class} ${returntype:-} ${function} (${formal:-})
 EOF
     for r in ${read}
     do
@@ -1238,7 +1223,6 @@ EOF
 done
 
 exec 1>&2
-compare_new gdbarch.log
 
 
 copyright ()
@@ -1266,17 +1250,7 @@ cat <<EOF
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* This file was created with the aid of \`\`gdbarch.sh''.
-
-   The Bourne shell script \`\`gdbarch.sh'' creates the files
-   \`\`new-gdbarch.c'' and \`\`new-gdbarch.h and then compares them
-   against the existing \`\`gdbarch.[hc]''.  Any differences found
-   being reported.
-
-   If editing this file, please also run gdbarch.sh and merge any
-   changes into that script. Conversely, when making sweeping changes
-   to this file, modifying gdbarch.sh and using its output may prove
-   easier.  */
+/* This file was created with the aid of \`\`gdbarch.sh''.  */
 
 EOF
 }
@@ -1694,8 +1668,8 @@ gdbarch_num_cooked_regs (gdbarch *arch)
 #endif
 EOF
 exec 1>&2
-#../move-if-change new-gdbarch.h gdbarch.h
-compare_new gdbarch.h
+../move-if-change new-gdbarch.h gdbarch.h
+rm -f new-gdbarch.h
 
 
 #
@@ -2119,7 +2093,7 @@ do
        fi
        printf "  if (gdbarch_debug >= 2)\n"
        printf "    fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
-       if [ "x${actual}" = "x-" ] || [ "x${actual}" = "x" ]
+       if [ "x${actual:-}" = "x-" ] || [ "x${actual:-}" = "x" ]
        then
            if class_is_multiarch_p
            then
@@ -2604,5 +2578,5 @@ EOF
 
 # close things off
 exec 1>&2
-#../move-if-change new-gdbarch.c gdbarch.c
-compare_new gdbarch.c
+../move-if-change new-gdbarch.c gdbarch.c
+rm -f new-gdbarch.c
This page took 0.031328 seconds and 4 git commands to generate.