From e32f96fe44d17b6ab5b198783e2390b0658b0f1b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 18 Sep 2015 20:57:42 +0200 Subject: [PATCH] Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). --- gdb-pahole-python3fix.patch | 43 +++++++++++++++++++++++++++++++++++++ gdb.spec | 9 +++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gdb-pahole-python3fix.patch diff --git a/gdb-pahole-python3fix.patch b/gdb-pahole-python3fix.patch new file mode 100644 index 0000000..607af26 --- /dev/null +++ b/gdb-pahole-python3fix.patch @@ -0,0 +1,43 @@ +commit f0ee78c5ccefe388a64273353ecd5c99dae62558 +Author: Jan Kratochvil +Date: Fri Sep 18 20:54:22 2015 +0200 + + pahole.py: Fix the Python3 port. + - https://bugzilla.redhat.com/show_bug.cgi?id=1264532 + +diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py +index dee04f5..e08eaf5 100644 +--- a/gdb/python/lib/gdb/command/pahole.py ++++ b/gdb/python/lib/gdb/command/pahole.py +@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are.""" + fieldsize = 8 * ftype.sizeof + + # TARGET_CHAR_BIT +- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))) ++ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "") + bitpos = bitpos + fieldsize + + if ftype.code == gdb.TYPE_CODE_STRUCT: + self.pahole (ftype, level + 1, field.name) + else: +- print (' ' * (2 + 2 * level)) ++ print (' ' * (2 + 2 * level), end = "") + print ('%s %s' % (str (ftype), field.name)) + + if level == 0: + self.maybe_print_hole(bitpos, 8 * type.sizeof) + +- print (' ' * (14 + 2 * level)) ++ print (' ' * (14 + 2 * level), end = "") + print ('} %s' % name) + + def invoke (self, arg, from_tty): +@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are.""" + type = type.strip_typedefs () + if type.code != gdb.TYPE_CODE_STRUCT: + raise (TypeError, '%s is not a struct type' % arg) +- print (' ' * 14) ++ print (' ' * 14, end = "") + self.pahole (type, 0, '') + + Pahole() diff --git a/gdb.spec b/gdb.spec index 90c8b03..ff67e70 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 7.10 # 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: 22%{?dist} +Release: 23%{?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 @@ -543,6 +543,9 @@ Patch1030: gdb-probes-based-interface-robust-2of2.patch # [ppc64le] Use skip_entrypoint for skip_trampoline_code (RH BZ 1260558). Patch1031: gdb-rhbz1260558-ppc64le-skip_trampoline_code.patch +# Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). +Patch1044: gdb-pahole-python3fix.patch + %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -841,6 +844,7 @@ find -name "*.info*"|xargs rm -f %patch1029 -p1 %patch1030 -p1 %patch1031 -p1 +%patch1044 -p1 %patch848 -p1 %if 0%{!?el6:1} @@ -1350,6 +1354,9 @@ then fi %changelog +* Fri Sep 18 2015 Jan Kratochvil - 7.10-23.fc23 +- Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). + * Sun Sep 13 2015 Jan Kratochvil - 7.10-22.fc23 - Fix gstack to use gdb from $PATH (bugreport by Frank Hirtz, RH BZ 1262589).