gdb-gdb.py: SyntaxError: Missing parentheses in call to 'print'
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 22 Feb 2016 16:15:14 +0000 (17:15 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 22 Feb 2016 16:15:14 +0000 (17:15 +0100)
After building GDB
--with-python=/usr/bin/python3
and for example stripping ./gdb and running:
./gdb -data-directory data-directory/ -iex "add-auto-load-safe-path $PWD/gdb-gdb.gdb" -iex "add-auto-load-safe-path $PWD/gdb-gdb.
py" ./gdb
I get:
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
  File "/home/jkratoch/redhat/gdb-test-python3/gdb/gdb-gdb.py", line 91
    print "Warning: Cannot find enum type_flag_value type."
  ^
SyntaxError: Missing parentheses in call to 'print'
(top-gdb) q

gdb/ChangeLog
2016-02-22  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb-gdb.py (class TypeFlagsPrinter): Use parentheses for print.

gdb/ChangeLog
gdb/gdb-gdb.py

index 92f1873e161c584dcfb97f9b4907217f0af74c32..eac5e5c66a036fad316c7196d13a010fc251e265 100644 (file)
@@ -1,3 +1,7 @@
+2016-02-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb-gdb.py (class TypeFlagsPrinter): Use parentheses for print.
+
 2016-02-22  Yao Qi  <yao.qi@linaro.org>
 
        * arm-tdep.c: Fix code format issues.
index 4f3ac1ca370755fc436953a60bee33c10d936dd5..9a12baf4b6b33035b87c83479a5b68033bccf262 100644 (file)
@@ -88,14 +88,14 @@ class TypeFlagsPrinter:
         try:
             flags = gdb.lookup_type("enum type_flag_value")
         except:
-            print "Warning: Cannot find enum type_flag_value type."
-            print "         `struct type' pretty-printer will be degraded"
+            print("Warning: Cannot find enum type_flag_value type.")
+            print("         `struct type' pretty-printer will be degraded")
             return
         try:
             iflags = gdb.lookup_type("enum type_instance_flag_value")
         except:
-            print "Warning: Cannot find enum type_instance_flag_value type."
-            print "         `struct type' pretty-printer will be degraded"
+            print("Warning: Cannot find enum type_instance_flag_value type.")
+            print("         `struct type' pretty-printer will be degraded")
             return
         # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED,
         # so exclude it from the list we are building.