From fb74e3a7491e022a894c2c438c4e1f6c565b3580 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Jun 27 2016 21:24:13 +0000 Subject: Test 'info type-printers' Python error (RH BZ 1350436). --- diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch new file mode 100644 index 0000000..278bc2c --- /dev/null +++ b/gdb-rhbz1350436-type-printers-error.patch @@ -0,0 +1,73 @@ +Typo in Python support breaks info type-printers command +https://bugzilla.redhat.com/show_bug.cgi?id=1350436 + +[testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers +https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html + +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc 2016-06-27 22:57:58.168642470 +0200 +@@ -31,6 +31,12 @@ templ s; + + basic_string bs; + ++class Other ++{ ++}; ++ ++Other ovar; ++ + int main() + { + return 0; +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp 2016-06-27 22:58:13.846785208 +0200 +@@ -51,3 +51,7 @@ gdb_test_no_output "enable type-printer + gdb_test "whatis bs" "string" "whatis with enabled printer" + + gdb_test "whatis s" "templ" ++ ++gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \ ++ "info type-printers for other" ++gdb_test "whatis ovar" "type = Another" +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py 2016-06-27 22:57:58.169642479 +0200 +@@ -15,7 +15,7 @@ + + import gdb + +-class Recognizer(object): ++class StringRecognizer(object): + def __init__(self): + self.enabled = True + +@@ -30,6 +30,26 @@ class StringTypePrinter(object): + self.enabled = True + + def instantiate(self): +- return Recognizer() ++ return StringRecognizer() + + gdb.type_printers.append(StringTypePrinter()) ++ ++class OtherRecognizer(object): ++ def __init__(self): ++ self.enabled = True ++ ++ def recognize(self, type_obj): ++ if type_obj.tag == 'Other': ++ return 'Another' ++ return None ++ ++class OtherTypePrinter(object): ++ def __init__(self): ++ self.name = 'other' ++ self.enabled = True ++ ++ def instantiate(self): ++ return OtherRecognizer() ++ ++import gdb.types ++gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter()) diff --git a/gdb.spec b/gdb.spec index e920398..1dcfc22 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 75%{?dist} +Release: 76%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -538,6 +538,9 @@ Patch927: gdb-python-gil.patch # Fix jit-reader.h for multi-lib. Patch978: gdb-jit-reader-multilib.patch +# Test 'info type-printers' Python error (RH BZ 1350436). +Patch992: gdb-rhbz1350436-type-printers-error.patch + # Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). Patch1053: gdb-bz1219747-attach-kills.patch @@ -870,6 +873,7 @@ find -name "*.info*"|xargs rm -f %patch925 -p1 %patch927 -p1 %patch978 -p1 +%patch992 -p1 %patch1053 -p1 %patch1056 -p1 %patch1073 -p1 @@ -1403,6 +1407,9 @@ then fi %changelog +* Mon Jun 27 2016 Jan Kratochvil - 7.11.1-76.fc24 +- Test 'info type-printers' Python error (RH BZ 1350436). + * Mon Jun 6 2016 Jan Kratochvil - 7.11.1-75.fc24 - Rebase to released FSF GDB 7.11.1.