]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gdbhooks.py: fix prettyprinting of NULL vec<>*
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 20 Nov 2013 20:00:33 +0000 (20:00 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 20 Nov 2013 20:00:33 +0000 (20:00 +0000)
* gdbhooks.py (VecPrinter.children): Don't attempt to iterate
the children of a NULL pointer.

From-SVN: r205139

gcc/ChangeLog
gcc/gdbhooks.py

index 72794d19dd5da4f2646380b004ef6d786566fa02..810670e2d987f6f1fbd8169edacf64056c4a7686 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-20  David Malcolm  <dmalcolm@redhat.com>
+
+       * gdbhooks.py (VecPrinter.children): Don't attempt to iterate
+       the children of a NULL pointer.
+
 2013-11-20  Robert Suchanek  <Robert.Suchanek@imgtec.com>
 
        * lra.c (lra): Set lra_in_progress before check_rtl call.
index baccd6b783e1d8011bd3f2f300abaa5a775bc963..f0a925c2b9c7210ba8b4a101da658977114024e3 100644 (file)
@@ -383,6 +383,8 @@ class VecPrinter:
         return '0x%x' % long(self.gdbval)
 
     def children (self):
+        if long(self.gdbval) == 0:
+            return
         m_vecpfx = self.gdbval['m_vecpfx']
         m_num = m_vecpfx['m_num']
         m_vecdata = self.gdbval['m_vecdata']