From 866d2f9cc7b92c636ae10d2b785e9ea313f6adfe Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sun, 5 Apr 2015 14:06:43 -0400 Subject: [PATCH] Bug 1151349 - Make lldb ns(Int)Region summary handle the numRects==0 case. r=jrmuizel --- python/lldbutils/lldbutils/gfx.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/lldbutils/lldbutils/gfx.py b/python/lldbutils/lldbutils/gfx.py index 8211a62ada7..1ad9a37a7f1 100644 --- a/python/lldbutils/lldbutils/gfx.py +++ b/python/lldbutils/lldbutils/gfx.py @@ -110,14 +110,13 @@ def rect_is_empty(valobj): def summarize_region(valobj, internal_dict): # This function makes use of the synthetic children generated for ns(Int)Regions. bounds = valobj.GetChildMemberWithName("bounds") - num_rects = valobj.GetChildMemberWithName("numRects").GetValueAsUnsigned(0) - if num_rects == 0: - return "empty" bounds_summary = summarize_rect(bounds, internal_dict) - if num_rects == 1: + num_rects = valobj.GetChildMemberWithName("numRects").GetValueAsUnsigned(0) + if num_rects <= 1: if rect_is_empty(bounds): return "empty" - return "one rect: " + bounds_summary + if num_rects == 1: + return "one rect: " + bounds_summary return str(num_rects) + " rects, bounds: " + bounds_summary def init(debugger):