forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
0118bc290a
commit
8c0f663118
@@ -1014,7 +1014,10 @@ class DumperBase:
|
|||||||
# This should not happen. But it does, see QTCREATORBUG-14755.
|
# This should not happen. But it does, see QTCREATORBUG-14755.
|
||||||
# GDB/GCC produce sizeof == 0 for QProcess arr[3]
|
# GDB/GCC produce sizeof == 0 for QProcess arr[3]
|
||||||
s = str(value.type)
|
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)
|
n = int(arrayByteSize / ts)
|
||||||
if displayFormat != RawFormat and p:
|
if displayFormat != RawFormat and p:
|
||||||
|
Reference in New Issue
Block a user