- Fix pretty printers regression in 7.0.1-40.fc12 (Phil Muldoon, BZ

582052).
This commit is contained in:
Jan Kratochvil 2010-04-14 10:41:48 +00:00
parent e20f36ceed
commit bdfd6d1b43
2 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,51 @@
+++ ./libstdc++-v3-python-r155978/libstdcxx/v6/printers.py 2010/01/15 22:52:16 155950
--- ./libstdc++-v3-python-r155978/libstdcxx/v6/printers.py 2010/01/15 23:36:58 155951
@@ -1,6 +1,6 @@
# Pretty-printers for libstc++.
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -529,10 +529,18 @@
class StdStringPrinter:
"Print a std::basic_string of some kind"
+ def __init__(self, encoding, val):
+ self.encoding = encoding
- def __init__(self, val):
self.val = val
def to_string(self):
+ # Look up the target encoding as late as possible.
+ encoding = self.encoding
+ if encoding == 0:
+ encoding = gdb.parameter('target-charset')
+ elif encoding == 1:
+ encoding = gdb.parameter('target-wide-charset')
+
# Make sure &string works, too.
type = self.val.type
if type.code == gdb.TYPE_CODE_REF:
@@ -554,7 +546,7 @@
reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
header = ptr.cast(reptype) - 1
len = header.dereference ()['_M_length']
+ return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
- return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
def display_hint (self):
return 'string'
@@ -687,7 +679,10 @@
# libstdc++ objects requiring pretty-printing.
# In order from:
# http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
+ pretty_printers_dict[re.compile('^std::basic_string<char(,.*)?>$')] = lambda val: StdStringPrinter(0, val)
+ pretty_printers_dict[re.compile('^std::basic_string<wchar_t(,.*)?>$')] = lambda val: StdStringPrinter(1, val)
+ pretty_printers_dict[re.compile('^std::basic_string<char16_t(,.*)?>$')] = lambda val: StdStringPrinter('UTF-16', val)
+ pretty_printers_dict[re.compile('^std::basic_string<char32_t(,.*)?>$')] = lambda val: StdStringPrinter('UTF-32', val)
- pretty_printers_dict[re.compile('^std::basic_string<.*>$')] = lambda val: StdStringPrinter(val)
pretty_printers_dict[re.compile('^std::bitset<.*>$')] = lambda val: StdBitsetPrinter("std::bitset", val)
pretty_printers_dict[re.compile('^std::deque<.*>$')] = lambda val: StdDequePrinter("std::deque", val)
pretty_printers_dict[re.compile('^std::list<.*>$')] = lambda val: StdListPrinter("std::list", val)

View File

@ -36,7 +36,7 @@ Version: 7.0.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: 43%{?_with_upstream:.upstream}%{dist}
Release: 44%{?_with_upstream:.upstream}%{dist}
License: GPLv3+
Group: Development/Debuggers
@ -491,6 +491,9 @@ Patch437: gdb-using-directive-leak.patch
# Fix dangling displays in separate debuginfo (BZ 574483).
Patch438: gdb-bz574483-display-sepdebug.patch
# Fix pretty printers regression in 7.0.1-40.fc12 (Phil Muldoon, BZ 582052).
Patch450: gdb-bz582052-libstdc++-compat.patch
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
BuildRequires: readline-devel%{?_isa}
@ -759,6 +762,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch431 -p1
%patch437 -p1
%patch438 -p1
%patch450 -p1
# Always verify their applicability.
%patch393 -p1
%patch335 -p1
@ -1084,6 +1088,9 @@ fi
%endif
%changelog
* Wed Apr 14 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.1-44.fc12
- Fix pretty printers regression in 7.0.1-40.fc12 (Phil Muldoon, BZ 582052).
* Wed Apr 7 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.1-43.fc12
- Fix gstack to print even the frame #0. New gdb.base/gstack.exp. (BZ 579793)