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 <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-01-11 15:26:07 +02:00
committed by Orgad Shaneh
parent 0118bc290a
commit 8c0f663118

View File

@@ -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: