summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/crawl-gdb.py
diff options
context:
space:
mode:
authorSamuel Bronson <naesten@gmail.com>2013-03-30 21:28:40 -0400
committerSamuel Bronson <naesten@gmail.com>2013-03-30 21:28:40 -0400
commitcf6489b92a2634108f43c37a11b7d332ec1a76f1 (patch)
treeaf33ab8cebabbc803f3cafc21e9f2546086fd2e7 /crawl-ref/source/crawl-gdb.py
parent0bcbfe5c1cdd9eb394be02afd057df434cbf89a1 (diff)
downloadcrawl-ref-cf6489b92a2634108f43c37a11b7d332ec1a76f1.tar.gz
crawl-ref-cf6489b92a2634108f43c37a11b7d332ec1a76f1.zip
Be more careful of NULL pointers in CrawlHashTable/CrawlVector pretty printers
Diffstat (limited to 'crawl-ref/source/crawl-gdb.py')
-rw-r--r--crawl-ref/source/crawl-gdb.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/crawl-gdb.py b/crawl-ref/source/crawl-gdb.py
index 08bb723edb..7ec7395f13 100644
--- a/crawl-ref/source/crawl-gdb.py
+++ b/crawl-ref/source/crawl-gdb.py
@@ -50,11 +50,14 @@ class CrawlHashTable_printer:
return None
def children(self):
- # needs libstdc++ printers
+ if not self.val["hash_map"]:
+ return ()
+
vis = gdb.default_visualizer(self.val["hash_map"].dereference())
if vis:
return vis.children()
- raise NeedLibstdcxxPrinters
+ else:
+ raise NeedLibstdcxxPrinters
def display_hint(self):
return "map"
@@ -67,11 +70,14 @@ class CrawlVector_printer:
return None
def children(self):
- # needs libstdc++ printers
+ if not self.val["vec"]:
+ return ()
+
vis = gdb.default_visualizer(self.val["vec"])
if vis:
return vis.children()
- raise NeedLibstdcxxPrinters
+ else:
+ raise NeedLibstdcxxPrinters
def display_hint(self):
return "array"