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]

[RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON


  This patch to ss/gdb_ari.sh
would allow to turn off a specific rule
for a given file until it is, optionally turned on again.

  I had this idea after the discussion about editCase function rule,
for which it appeared that adding /*ARI: editCase function */
inside each declaration using mixed case was too
disturbing.
  We this new patch, we can disable all 8 warnings of windows-nat.c
by adding just two lines:
/* ARI_OFF: editCase function */
and
/* ARI_ON: editCase function */
at the start and the end of the list of
bad_MixedFunctionNameSameAsWindowsAPI
list.

  Comments?

Pierre Muller
Pascal language support maintainer for GDB
as ARI maintainer.



$ cvs diff -u -p gdb_ari.sh
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.104
diff -u -p -r1.104 gdb_ari.sh
--- gdb_ari.sh  4 May 2010 23:20:37 -0000       1.104
+++ gdb_ari.sh  10 May 2010 08:53:32 -0000
@@ -154,7 +154,7 @@ function fail(bug,supplement) {
        exit
     }

-    if (ARI_OK == bug) {
+    if ((ARI_OK == bug) ||(bug in ari_off)) {
        return
     }
     # Trim the filename down to just DIRECTORY/FILE so that it can be
@@ -217,6 +217,7 @@ END {

 BEGIN {
     ARI_OK = ""
+    delete ari_off
 }

 /\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// {
@@ -228,6 +229,20 @@ BEGIN {
     ARI_OK = ""
 }

+/\/\* ARI_OFF:[[:space:]]*(.*)[[:space:]]*\*\// {
+    off_bug = gensub(/^.*\/\*
ARI_OFF:[[:space:]]*(.*[^[:space:]])[[:space:]]*\*\/.*$/, "\\1", 1, $0)
+    # print "ARI_OFF \"" off_bug "\""
+    ari_off[off_bug] = 1
+}
+
+/\/\* ARI_ON:[[:space:]]*(.*)[[:space:]]*\*\// {
+    on_bug = gensub(/^.*\/\*
ARI_ON:[[:space:]]*(.*[^[:space:]])[[:space:]]*\*\/.*$/, "\\1", 1, $0)
+    # print "ARI_ON \"" on_bug "\""
+    if (on_bug in ari_off) {
+       delete ari_off[on_bug]
+    }
+}
+

 # Things in comments

Example of ARI editCase fix for windows-nat.c

Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- windows-nat.c       16 Apr 2010 07:49:35 -0000      1.208
+++ windows-nat.c       10 May 2010 09:00:00 -0000
@@ -2522,7 +2522,8 @@ _initialize_check_for_gdb_ini (void)
 }

 /* Define dummy functions which always return error for the rare cases
where
-   these functions could not be found. */
+   these functions could not be found.  */
+/* ARI_OFF: editCase function */
 static BOOL WINAPI
 bad_DebugActiveProcessStop (DWORD w)
 {
@@ -2569,6 +2570,7 @@ bad_OpenProcessToken (HANDLE w, DWORD x,
 {
   return FALSE;
 }
+/* ARI_ON: editCase function */

 /* Load any functions which may not be available in ancient versions
    of Windows. */


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