diff options
| author | hjk <hjk121@nokiamail.com> | 2014-11-18 15:38:05 +0100 |
|---|---|---|
| committer | hjk <hjk121@nokiamail.com> | 2014-11-18 16:14:50 +0100 |
| commit | 298e2de7df4e6d16e60fcc9a36c762067084adb4 (patch) | |
| tree | 8f474e3b63fe494f151c9ee84d07bcdebaf90a0a /share | |
| parent | 005f5116a54c41e0a4d73c236ba585e529dd523c (diff) | |
| download | qt-creator-298e2de7df4e6d16e60fcc9a36c762067084adb4.tar.gz | |
Debugger: Centralize handling of optimized out values with GDB
There were a couple of situation where the is_optimized_out flag
was not used and later produced (caught) exceptions on access,
or where the still availably type was not shown.
Change-Id: I7ad5aa09a19357e50739d9fdf32f7423e30fe011
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'share')
| -rw-r--r-- | share/qtcreator/debugger/gdbbridge.py | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index d16230907d..e7fbea86c1 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -100,20 +100,16 @@ def listOfLocals(): try: item.value = frame.read_var(name, block) #warn("READ 1: %s" % item.value) - if not item.value.is_optimized_out: - #warn("ITEM 1: %s" % item.value) - items.append(item) - continue + items.append(item) + continue except: pass try: - item.value = frame.read_var(name) #warn("READ 2: %s" % item.value) - if not item.value.is_optimized_out: - #warn("ITEM 2: %s" % item.value) - items.append(item) - continue + item.value = frame.read_var(name) + items.append(item) + continue except: # RuntimeError: happens for # void foo() { std::string s; std::wstring w; } @@ -998,6 +994,13 @@ class Dumper(DumperBase): type = value.type.unqualified() typeName = str(type) + + if value.is_optimized_out: + self.putValue("<optimized out>") + self.putType(typeName) + self.putNumChild(0) + return + tryDynamic &= self.useDynamicType self.addToCache(type) # Fill type cache if tryDynamic: @@ -1049,9 +1052,7 @@ class Dumper(DumperBase): if type.code == IntCode or type.code == CharCode: self.putType(typeName) - if value.is_optimized_out: - self.putValue("<optimized out>") - elif type.sizeof == 1: + if type.sizeof == 1: # Force unadorned value transport for char and Co. self.putValue(int(value) & 0xff) else: @@ -1061,28 +1062,19 @@ class Dumper(DumperBase): if type.code == FloatCode or type.code == BoolCode: self.putType(typeName) - if value.is_optimized_out: - self.putValue("<optimized out>") - else: - self.putValue(value) + self.putValue(value) self.putNumChild(0) return if type.code == EnumCode: self.putType(typeName) - if value.is_optimized_out: - self.putValue("<optimized out>") - else: - self.putValue("%s (%d)" % (value, value)) + self.putValue("%s (%d)" % (value, value)) self.putNumChild(0) return if type.code == ComplexCode: self.putType(typeName) - if value.is_optimized_out: - self.putValue("<optimized out>") - else: - self.putValue("%s" % value) + self.putValue("%s" % value) self.putNumChild(0) return @@ -1118,10 +1110,6 @@ class Dumper(DumperBase): if type.code == PointerCode: # This could still be stored in a register and # potentially dereferencable. - if value.is_optimized_out: - self.putValue("<optimized out>") - return - self.putFormattedPointer(value) return |
