From 8c0f663118a3247294f1040d976d61d5fe7ef555 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 11 Jan 2016 15:26:07 +0200 Subject: [PATCH] Dumper: Fallback to 100 items when array size cannot be determined Can happen when an array is declared as `extern Struct arr[];` Change-Id: I7e9e0a5e73799dc29bfe6a71ad60d3d51a709cef Reviewed-by: hjk --- share/qtcreator/debugger/dumper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 38cc80625e0..bd9b6a3c649 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1014,7 +1014,10 @@ class DumperBase: # This should not happen. But it does, see QTCREATORBUG-14755. # GDB/GCC produce sizeof == 0 for QProcess arr[3] s = str(value.type) - arrayByteSize = int(s[s.find('[')+1:s.find(']')]) * ts; + itemCount = s[s.find('[')+1:s.find(']')] + if not itemCount: + itemCount = '100' + arrayByteSize = int(itemCount) * ts; n = int(arrayByteSize / ts) if displayFormat != RawFormat and p: