ARI: Add detection of printf_vma and sprintf_vma
authorJoel Brobecker <brobecker@adacore.com>
Sat, 19 Nov 2016 18:40:17 +0000 (10:40 -0800)
committerJoel Brobecker <brobecker@adacore.com>
Sat, 19 Nov 2016 18:40:17 +0000 (10:40 -0800)
We shouldn't be using these, since their output goes straight to
stdout, which doesn't allow redirection. So this patch updates
the ARI to detect any such use.

gdb/ChangeLog:

        * contrib/ari/gdb_ari.sh: Add detection of printf_vma and
        sprintf_vma.

gdb/ChangeLog
gdb/contrib/ari/gdb_ari.sh

index 07d21a6f28a8edd3b011713eefb72c218de9c70c..3797e8beddf45f211d05b7df831e1ab75adc9c5a 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-19  Joel Brobecker  <brobecker@adacore.com>
+
+       * contrib/ari/gdb_ari.sh: Add detection of printf_vma and
+       sprintf_vma.
+
 2016-11-18  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in (%.o: $(srcdir)/gdbtk/generic/%.c): Fix typo.
index 7e639e33a5088f059da729e9c7eff0a64ed654dd..2ecc0d6651741b3850803b62d1a46dde3e97c1a6 100755 (executable)
@@ -1097,6 +1097,22 @@ Do not use vasprintf(), instead use xstrvprintf"
     fail("vasprintf")
 }
 
+BEGIN { doc["printf_vma"] = "\
+Do not use printf_vma, instead use paddress or phex_nz"
+    category["printf_vma"] = ari_code
+}
+/(^|[^_[:alnum:]])printf_vma[[:space:]]*\(/ {
+    fail("printf_vma")
+}
+
+BEGIN { doc["sprintf_vma"] = "\
+Do not use sprintf_vma, instead use paddress or phex_nz"
+    category["sprintf_vma"] = ari_code
+}
+/(^|[^_[:alnum:]])sprintf_vma[[:space:]]*\(/ {
+    fail("sprintf_vma")
+}
+
 # More generic memory operations
 
 BEGIN { doc["bzero"] = "\