So how is this supposed to work?  Seems like there's a lot of cruft that
should either be fixed or deleted.  I'm not sure what's deprecated vs. just
broken though.  Nate?

# pushing a patch with bad whitespace among other things (see bottom)...
the style hook catches one of the errors
% hg qpush
applying style-test
invalid whitespace in /home/stever/hg/amd/hsa/gem5/src/mem/packet.cc:58
(a)bort, (i)gnore, or (f)ix? i
now at: style-test
% hg m5style packet.cc
# nada... like everything's OK when it's not
% hg m5format packet.cc
hg m5format: invalid arguments
hg m5format [FILE]...

(no help text available)

options:

    --mq  operate on patch repository

use "hg help m5format" to show the full help text
% python ../../util/style.py help
../../util/style.py fixwhite [-t <tabsize> ] <path> [...]
../../util/style.py chkwhite <path> [...]
../../util/style.py chkformat <path> [...]

% python ../../util/style.py fixwhite packet.cc
Traceback (most recent call last):
  File "../../util/style.py", line 536, in <module>
    fixwhite(filename, tabsize)
NameError: name 'fixwhite' is not defined
% python ../../util/style.py chkwhite packet.cc
Traceback (most recent call last):
  File "../../util/style.py", line 539, in <module>
    for line,num in checkwhite(filename):
NameError: name 'checkwhite' is not defined
% python ../../util/style.py chkformat packet.cc
Traceback (most recent call last):
  File "../../util/style.py", line 546, in <module>
    validate(filename, stats=stats, verbose=verbose, exit_code=code)
  File "../../util/style.py", line 366, in validate
    if cpp:
NameError: global name 'cpp' is not defined
# here's the patch: note that we have whitespace problems, a missing space
after 'if', and out-of-order includes,
# but only the whitespace problem is found by the style hook
% hg qdiff
diff --git a/src/mem/packet.cc b/src/mem/packet.cc
--- a/src/mem/packet.cc
+++ b/src/mem/packet.cc
@@ -51,11 +51,11 @@
 #include <cstring>
 #include <iostream>

+#include "mem/packet.hh"
 #include "base/cprintf.hh"
 #include "base/misc.hh"
 #include "base/trace.hh"
-#include "mem/packet.hh"
-
+
 using namespace std;

 // The one downside to bitsets is that static initializers can get ugly.
@@ -181,7 +181,7 @@
     Addr val_start  = addr;
     Addr val_end    = val_start + size - 1;

-    if (func_start > val_end || val_start > func_end) {
+    if(func_start > val_end || val_start > func_end) {
         // no intersection
         return false;
     }
diff --git a/util/style.py b/util/style.py
--- a/util/style.py
+++ b/util/style.py
@@ -78,7 +78,7 @@
             mod_regions &= m2
     else:
         mod_regions = Regions()
-        mod_regions.add(0, len(lines))
+        mod_regions.append(0, len(lines))

     return mod_regions
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to