Commit e855de40 authored by hjk's avatar hjk
Browse files

Debugger: Fix GDB hanging

This partially reverts commit e33da6a6

.
GDB seems to hang while executing str(some_pointer) in some setups.

Task-number: QTCREATORBUG-14374
Change-Id: Ia678533b9122e505b21ef6659d404239995ddb81
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 74066f25
......@@ -1040,21 +1040,8 @@ class DumperBase:
return
typeName = str(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
goodPointer = False
try:
target = value.dereference()
str(target) # Dummy access.
if self.isLldb and target.GetError().Fail():
pass
else:
goodPointer = True
except:
pass
if not goodPointer:
if self.isBadPointer(value):
# Failure to dereference a pointer should at least
# show the value of a pointer.
self.putValue(self.cleanAddress(value))
......@@ -1063,6 +1050,8 @@ class DumperBase:
return
displayFormat = self.currentItemFormat(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
if innerTypeName == "void":
#warn("VOID POINTER: %s" % displayFormat)
......
......@@ -522,6 +522,14 @@ class Dumper(DumperBase):
except:
return None
def isBadPointer(self, value):
try:
target = value.dereference()
target.is_optimized_out # Access test.
return False
except:
return True
def makeValue(self, typeobj, init):
typename = "::" + self.stripClassTag(str(typeobj));
# Avoid malloc symbol clash with QVector.
......
......@@ -365,6 +365,10 @@ class Dumper(DumperBase):
#self.warn(" -> %s" % result)
return result
def isBadPointer(self, value):
target = value.dereference()
return target.GetError().Fail()
def makeValue(self, type, *args):
thread = self.currentThread()
frame = thread.GetFrameAtIndex(0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment