re PR libstdc++/68448 (Python Pretty Printers get disabled on libstdc++ reload by GDB)

PR libstdc++/68448
	* python/hook.in: Call register_libstdcxx_printers.
	* python/libstdcxx/v6/__init__.py: Wrap it to
	register_libstdcxx_printers.

From-SVN: r230669
This commit is contained in:
Jan Kratochvil 2015-11-20 19:00:51 +00:00
parent eed905e9f2
commit cdccafd922
3 changed files with 20 additions and 9 deletions

View File

@ -1,6 +1,13 @@
2015-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
PR libstdc++/68448
* python/hook.in: Call register_libstdcxx_printers.
* python/libstdcxx/v6/__init__.py: Wrap it to
register_libstdcxx_printers.
2015-11-17 Jonathan Wakely <jwakely@redhat.com> 2015-11-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++66059 PR libstdc++/66059
* include/std/utility (_Build_index_tuple): Optimise. * include/std/utility (_Build_index_tuple): Optimise.
2015-11-16 Doug Evans <dje@google.com> 2015-11-16 Doug Evans <dje@google.com>

View File

@ -55,4 +55,7 @@ if gdb.current_objfile () is not None:
if not dir_ in sys.path: if not dir_ in sys.path:
sys.path.insert(0, dir_) sys.path.insert(0, dir_)
import libstdcxx.v6 # Call a function as a plain import would not execute body of the included file
# on repeated reloads of this object file.
from libstdcxx.v6 import register_libstdcxx_printers
register_libstdcxx_printers(gdb.current_objfile())

View File

@ -15,10 +15,6 @@
import gdb import gdb
# Load the pretty-printers.
from .printers import register_libstdcxx_printers
register_libstdcxx_printers(gdb.current_objfile())
# Load the xmethods if GDB supports them. # Load the xmethods if GDB supports them.
def gdb_has_xmethods(): def gdb_has_xmethods():
try: try:
@ -27,6 +23,11 @@ def gdb_has_xmethods():
except ImportError: except ImportError:
return False return False
if gdb_has_xmethods(): def register_libstdcxx_printers(obj):
# Load the pretty-printers.
from .printers import register_libstdcxx_printers
register_libstdcxx_printers(obj)
if gdb_has_xmethods():
from .xmethods import register_libstdcxx_xmethods from .xmethods import register_libstdcxx_xmethods
register_libstdcxx_xmethods(gdb.current_objfile()) register_libstdcxx_xmethods(obj)