aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2010-06-22 22:09:07 +0000
committerMatthias Klose <doko@gcc.gnu.org>2010-06-22 22:09:07 +0000
commitb2e894b50a1953727cb77898cc618e06577c34d9 (patch)
tree4f0e34dbce91266a9ad414b6eee1c18e9ce35914
parent87867ff6566abe2217e4796873dd1efae6783707 (diff)
downloadgcc-b2e894b50a1953727cb77898cc618e06577c34d9.zip
gcc-b2e894b50a1953727cb77898cc618e06577c34d9.tar.gz
gcc-b2e894b50a1953727cb77898cc618e06577c34d9.tar.bz2
printers.py: Don't use string exceptions.
2010-06-22 Matthias Klose <doko@ubuntu.com> * python/libstdcxx/v6/printers.py: Don't use string exceptions. From-SVN: r161233
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py9
2 files changed, 9 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c1f218d..2fb2a72 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index baa0824..0533dea 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -15,7 +15,7 @@
# 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 gdb
+#import gdb
import itertools
import re
@@ -77,6 +77,7 @@ class StdListPrinter:
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'])
@@ -101,7 +102,7 @@ class StdListIteratorPrinter:
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:
@@ -208,7 +209,7 @@ class StdTuplePrinter:
# 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)
@@ -224,7 +225,7 @@ class StdTuplePrinter:
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.