2014-09-30 Siva Chandra Reddy <sivachandra@google.com>
[official-gcc.git] / libstdc++-v3 / python / libstdcxx / v6 / __init__.py
blob59c1f27688e0d2995a3097ca66d50de56ff24933
1 # Copyright (C) 2014 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 import gdb
18 # Load the pretty-printers.
19 from printers import register_libstdcxx_printers
20 register_libstdcxx_printers(gdb.current_objfile())
22 # Load the xmethods if GDB supports them.
23 def gdb_has_xmethods():
24 try:
25 import gdb.xmethod
26 return True
27 except ImportError:
28 return False
30 if gdb_has_xmethods():
31 from xmethods import register_libstdcxx_xmethods
32 register_libstdcxx_xmethods(gdb.current_objfile())