Some missing parentheses and one itertools.imap (Py2) vs map (Py3) issue.
gdb/ChangeLog:
* python/lib/gdb/command/unwinders.py: Add parentheses.
gdb/testsuite/ChangeLog:
* gdb.python/py-framefilter.py (ErrorFilter.filter): Use map function
if itertools.imap is not present.
* gdb.python/py-objfile.exp: Add parentheses.
* gdb.python/py-type.exp: Same.
* gdb.python/py-unwind-maint.py: Same.
+2015-04-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * python/lib/gdb/command/unwinders.py: Add parentheses.
+
2015-04-15 Yao Qi <yao.qi@linaro.org>
* arm-linux-tdep.c (arm_linux_copy_svc): Update debug message.
"""
if not unwinders:
return
- print title
+ print(title)
for unwinder in unwinders:
if name_re.match(unwinder.name):
print(" %s%s" % (unwinder.name,
+2015-04-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.python/py-framefilter.py (ErrorFilter.filter): Use map function
+ if itertools.imap is not present.
+ * gdb.python/py-objfile.exp: Add parentheses.
+ * gdb.python/py-type.exp: Same.
+ * gdb.python/py-unwind-maint.py: Same.
+
2015-04-15 Yao Qi <yao.qi@linaro.org>
* gdb.dwarf2/dynarr-ptr.exp (assemble): Use $ptr_size instead
gdb.frame_filters [self.name] = self
def filter(self, frame_iter):
- return itertools.imap(ErrorInName, frame_iter)
+ # Python 3.x moved the itertools.imap functionality to map(),
+ # so check if it is available.
+ if hasattr(itertools, "imap"):
+ return itertools.imap (ErrorInName, frame_iter)
+ else:
+ return map(ErrorInName, frame_iter)
FrameFilter()
FrameElider()
return -1
}
-gdb_test "python print objfile.filename" "None" \
+gdb_test "python print(objfile.filename)" "None" \
"objfile.filename after objfile is unloaded"
-gdb_test "python print objfile.username" "None" \
+gdb_test "python print(objfile.username)" "None" \
"objfile.username after objfile is unloaded"
# Now build another copy of the testcase, this time without debug info.
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
-gdb_test "python print gdb.lookup_type('char').array(1, 0)" \
+gdb_test "python print(gdb.lookup_type('char').array(1, 0))" \
"char \\\[0\\\]"
-gdb_test "python print gdb.lookup_type('char').array(1, -1)" \
+gdb_test "python print(gdb.lookup_type('char').array(1, -1))" \
"Array length must not be negative.*"
with_test_prefix "lang_c" {
super(TestGlobalUnwinder, self).__init__("global_unwinder")
def __call__(self, unwinder_info):
- print "%s called" % self.name
+ print("%s called" % self.name)
return None
class TestProgspaceUnwinder(Unwinder):
super(TestProgspaceUnwinder, self).__init__("%s_ps_unwinder" % name)
def __call__(self, unwinder_info):
- print "%s called" % self.name
+ print("%s called" % self.name)
return None
class TestObjfileUnwinder(Unwinder):
super(TestObjfileUnwinder, self).__init__("%s_obj_unwinder" % name)
def __call__(self, unwinder_info):
- print "%s called" % self.name
+ print("%s called" % self.name)
return None
gdb.unwinder.register_unwinder(None, TestGlobalUnwinder(), replace=True)
gdb.unwinder.register_unwinder(gdb.current_progspace(),
TestProgspaceUnwinder("py_unwind_maint"))
-print "Python script imported"
+print("Python script imported")