diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-07-22 17:06:18 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-08-01 13:21:20 +0200 |
commit | 1066cf73599555e3ae3b8a5e2b12a98af8c026fb (patch) | |
tree | beb7d9c86598ed5c2fb01d6df688d8c36b58d2e0 /share | |
parent | 81bb1c98a21ff4dbf2a383046a61e7ddb48e5f65 (diff) |
Debugger[gdb]: Fix crash when stepping over QLocale initialization.
Check the index before the array is accessed in the call item.
Task-number: QTCREATORBUG-5576
Change-Id: I3f533ef76af42dad97c93087f2d434b58fdedd44
Reviewed-on: http://codereview.qt.nokia.com/2044
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/dumper/qttypes.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/share/qtcreator/dumper/qttypes.py b/share/qtcreator/dumper/qttypes.py index ec5119bcc8c..f66fba46a13 100644 --- a/share/qtcreator/dumper/qttypes.py +++ b/share/qtcreator/dumper/qttypes.py @@ -556,8 +556,19 @@ def qdump__QLinkedList(d, item): d.putSubItem(Item(p["t"], item.iname, i)) p = p["n"] +qqLocalesCount = None def qdump__QLocale(d, item): + # Check for uninitialized 'index' variable. Retrieve size of QLocale data array + # from variable in qlocale.cpp (default: 368/Qt 4.8), 368 being 'System'. + global qqLocalesCount + if qqLocalesCount is None: + try: + qqLocalesCount = int(value(qtNamespace() + 'locale_data_size')) + except: + qqLocalesCount = 368 + index = int(item.value["p"]["index"]) + check(index >= 0 and index <= qqLocalesCount) d.putStringValue(call(item.value, "name")) d.putNumChild(0) return |