This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] First fixes to contrib/ari scripts


  The current CVS scripts in gdb/contrib/ari generate
several warnings and are obsolete regarding some rules due to
the addition of common subdirectory and moves of some
code to that directory.
  The patch below fixes some of those warnings,
and also removes gdbtk directory from the list of files
in gdb_find.sh script.

  Again, my questions are mainly about ChangeLog formatting...
I am not entirely happy about its content,
but I don't know how to describe the changes better.

  Comments on possible improvements of the ChangeLog entry 
are welcomed.

  If I get no remarks, as Joel stated, I will free to commit
the patch without further approval.

Pierre Muller
as ARI maintainer.


2012-11-07  Pierre Muller  <muller@sourceware.org>

        * contrib/ari/gdb_ari.sh (LANG, LC_ALL): Use C instead of C
        as default language.
        (AWK): Use = instead of == for sh test to avoid warning.
        (Linux rule): Correct [:digit] into [[:digit:]].
        (__func__ rule): Adapt to "gdb_assert.h" move to common
subdirectory.
        (vasprintf rule): Adapt to common subdirectory moves.
        (xasprintf rule): Idem.
        (xvasprintf rule): Idem.
        (var_boolean rule): Accept occurence in == or != test.

        * contrib/ari/gdb_find.sh: Also prune gdbtk directory.


Index: contrib/ari/gdb_ari.sh
===================================================================
RCS file: /cvs/src/src/gdb/contrib/ari/gdb_ari.sh,v
retrieving revision 1.3
diff -u -p -r1.3 gdb_ari.sh
--- contrib/ari/gdb_ari.sh      2 Nov 2012 18:19:36 -0000       1.3
+++ contrib/ari/gdb_ari.sh      7 Nov 2012 16:04:49 -0000
@@ -22,8 +22,8 @@
 # Make certain that the script is not running in an internationalized
 # environment.

-LANG=c ; export LANG
-LC_ALL=c ; export LC_ALL
+LANG=C ; export LANG
+LC_ALL=C ; export LC_ALL

 # Permanent checks take the form:

@@ -130,7 +130,7 @@ do
     errors="${errors} error[ari_${e}]  = 1;"
 done

-if [ "$AWK" == "" ] ; then
+if [ "$AWK" = "" ] ; then
   AWK=awk
 fi

@@ -268,7 +268,7 @@ Do not use `Linux'\'', instead use `Linu
 && !/(^|[^_[:alnum:]])Linux\[sic\]([^_[:alnum:]]|$)/ \
 && !/(^|[^_[:alnum:]])GNU\/Linux([^_[:alnum:]]|$)/ \
 && !/(^|[^_[:alnum:]])Linux kernel([^_[:alnum:]]|$)/ \
-&& !/(^|[^_[:alnum:]])Linux [:digit:]\.[:digit:]+)/ {
+&& !/(^|[^_[:alnum:]])Linux [[:digit:]]\.[[:digit:]]+)/ {
     fail("GNU/Linux")
 }

@@ -479,7 +479,7 @@ Do not use PARAMS(), ISO C 90 implies pr
 BEGIN { doc["__func__"] = "\
 Do not use __func__, ISO C 90 does not support this macro"
     category["__func__"] = ari_regression
-    fix("__func__", "gdb/gdb_assert.h", 1)
+    fix("__func__", "common/gdb_assert.h", 1)
 }
 /(^|[^_[:alnum:]])__func__([^_[:alnum:]]|$)/ {
     fail("__func__")
@@ -1120,7 +1120,7 @@ Do not use asprintf(), instead use xstrp

 BEGIN { doc["vasprintf"] = "\
 Do not use vasprintf(), instead use xstrvprintf"
-    fix("vasprintf", "gdb/utils.c", 1)
+    fix("vasprintf", "common/common-utils.c", 1)
     category["vasprintf"] = ari_regression
 }
 /(^|[^_[:alnum:]])vasprintf[[:space:]]*\(/ {
@@ -1129,8 +1129,8 @@ Do not use vasprintf(), instead use xstr

 BEGIN { doc["xasprintf"] = "\
 Do not use xasprintf(), instead use xstrprintf"
-    fix("xasprintf", "gdb/defs.h", 1)
-    fix("xasprintf", "gdb/utils.c", 1)
+    fix("xasprintf", "common/common-utils.h", 1)
+    fix("xasprintf", "common/common-utils.c", 1)
     category["xasprintf"] = ari_regression
 }
 /(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ {
@@ -1139,8 +1139,8 @@ Do not use xasprintf(), instead use xstr

 BEGIN { doc["xvasprintf"] = "\
 Do not use xvasprintf(), instead use xstrvprintf"
-    fix("xvasprintf", "gdb/defs.h", 1)
-    fix("xvasprintf", "gdb/utils.c", 1)
+    fix("xvasprintf", "common/common-utils.h", 1)
+    fix("xvasprintf", "common/common-utils.c", 1)
     category["xvasprintf"] = ari_regression
 }
 /(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ {
@@ -1244,7 +1244,8 @@ Replace var_boolean with add_setshow_boo
     fix("var_boolean", "cli/cli-decode.c", 2)
 }
 /(^|[^_[:alnum:]])var_boolean([^_[:alnum:]]|$)/ {
-    if ($0 !~ /(^|[^_[:alnum:]])case *var_boolean:/) {
+    if (($0 !~ /(^|[^_[:alnum:]])case *var_boolean:/) \
+        && ($0 !~ /(^|[^_[:alnum:]])[=!]= *var_boolean/)) {
        fail("var_boolean")
     }
 }
Index: contrib/ari/gdb_find.sh
===================================================================
RCS file: /cvs/src/src/gdb/contrib/ari/gdb_find.sh,v
retrieving revision 1.3
diff -u -p -r1.3 gdb_find.sh
--- contrib/ari/gdb_find.sh     2 Nov 2012 18:19:36 -0000       1.3
+++ contrib/ari/gdb_find.sh     7 Nov 2012 16:04:49 -0000
@@ -32,6 +32,7 @@ LC_ALL=C ; export LC_ALL
 find "$@" \
     -name testsuite -prune -o \
     -name gdbserver -prune -o \
+    -name gdbtk -prune -o \
     -name gnulib -prune -o \
     -name osf-share -prune -o \
     -name '*-stub.c' -prune -o \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]