Commit c9c0f801 authored by hjk's avatar hjk

Debugger: Fix threadname display

We probably should completely skip the code in the cases where Qt
itself already propagates the object name to the underlying threads.

Task-number: QTCREATORBUG-10826
Change-Id: I7e9e5b7c990a270c8563e40c1fe1e900724c1e5c
Reviewed-by: default avatarRyan May <ryan.may@eecradar.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 17f70460
......@@ -1568,7 +1568,7 @@ class Dumper(DumperBase):
result += ']'
return result
def threadname(self, maximalStackDepth):
def threadname(self, maximalStackDepth, objectPrivateType):
e = gdb.selected_frame()
out = ""
ns = self.qtNamespace()
......@@ -1583,8 +1583,7 @@ class Dumper(DumperBase):
or e.name() == "_ZN14QThreadPrivate5startEPv@4":
try:
thrptr = e.read_var("thr").dereference()
obtype = self.lookupType(ns + "QObjectPrivate").pointer()
d_ptr = thrptr["d_ptr"]["d"].cast(obtype).dereference()
d_ptr = thrptr["d_ptr"]["d"].cast(objectPrivateType).dereference()
try:
objectName = d_ptr["objectName"]
except: # Qt 5
......@@ -1614,10 +1613,11 @@ class Dumper(DumperBase):
oldthread = gdb.selected_thread()
if oldthread:
try:
objectPrivateType = gdb.lookup_type(ns + "QObjectPrivate").pointer()
inferior = self.selectedInferior()
for thread in inferior.threads():
thread.switch()
out += self.threadname(maximalStackDepth)
out += self.threadname(maximalStackDepth, objectPrivateType)
except:
pass
oldthread.switch()
......
Markdown is supported
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