* python/libstdcxx/v6/printers.py: Don't use string exceptions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161233
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-06-22 Matthias Klose <doko@ubuntu.com>
+
+ * python/libstdcxx/v6/printers.py: Don't use string exceptions.
+
2010-06-22 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44630
2010-06-22 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44630
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import itertools
import re
import itertools
import re
elif self.typename == "std::__debug::list":
nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
else:
elif self.typename == "std::__debug::list":
nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
else:
+ #raise ValueError, "Cannot cast list node for list printer."
raise "Cannot cast list node for list printer."
return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
raise "Cannot cast list node for list printer."
return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
elif self.typename == "std::__norm::_List_iterator" or self.typename == "std::__norm::_List_const_iterator":
nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
else:
elif self.typename == "std::__norm::_List_iterator" or self.typename == "std::__norm::_List_const_iterator":
nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
else:
- raise "Cannot cast list node for list iterator printer."
+ raise ValueError, "Cannot cast list node for list iterator printer."
return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
class StdSlistPrinter:
return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
class StdSlistPrinter:
# tuple.
nodes = self.head.type.fields ()
if len (nodes) != 1:
# tuple.
nodes = self.head.type.fields ()
if len (nodes) != 1:
- raise "Top of tuple tree does not consist of a single node."
+ raise ValueError, "Top of tuple tree does not consist of a single node."
# Set the actual head to the first pair.
self.head = self.head.cast (nodes[0].type)
# Set the actual head to the first pair.
self.head = self.head.cast (nodes[0].type)
raise StopIteration
# Check that this iteration has an expected structure.
if len (nodes) != 2:
raise StopIteration
# Check that this iteration has an expected structure.
if len (nodes) != 2:
- raise "Cannot parse more than 2 nodes in a tuple tree."
+ raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
# - Left node is the next recursion parent.
# - Right node is the actual class contained in the tuple.
# - Left node is the next recursion parent.
# - Right node is the actual class contained in the tuple.