Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
0e8c3875
Commit
0e8c3875
authored
Sep 14, 2010
by
Arvid Ephraim Picciani
Browse files
Debugger: test gdb threeadlist capability
Reviewed-by: hjk
parent
bbc4a5f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/dumper.py
View file @
0e8c3875
...
...
@@ -89,6 +89,13 @@ def isGoodGdb():
# and gdb.VERSION != "6.8.50.20090630-cvs"
return
'parse_and_eval'
in
__builtin__
.
dir
(
gdb
)
def
hasInferiorThreadList
():
try
:
a
=
gdb
.
inferiors
()[
0
].
threads
()
return
True
except
:
return
False
typeCache
=
{}
def
lookupType
(
typestring
):
...
...
@@ -912,6 +919,7 @@ def bbsetup():
for
key
,
value
in
qqFormats
.
items
():
result
+=
'{type="%s",formats="%s"},'
%
(
key
,
value
)
result
+=
'],namespace="%s"'
%
qqNs
result
+=
',hasInferiorThreadList="%s"'
%
int
(
hasInferiorThreadList
())
return
result
...
...
@@ -1715,7 +1723,6 @@ class ThreadNamesCommand(gdb.Command):
if
e
.
name
()
==
self
.
ns
+
"QThreadPrivate::start"
:
thrptr
=
e
.
read_var
(
"thr"
).
dereference
()
d_ptr
=
thrptr
[
"d_ptr"
][
"d"
].
cast
(
lookupType
(
self
.
ns
+
"QObjectPrivate"
).
pointer
()).
dereference
()
#warn("D_PTR: %s " % d_ptr)
objectName
=
d_ptr
[
"objectName"
]
i
=
0
out
+=
'{valueencoded="'
+
str
(
Hex4EncodedLittleEndianWithoutQuotes
)
+
'",id="'
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
0e8c3875
...
...
@@ -1538,6 +1538,8 @@ void GdbEngine::handleHasPython(const GdbResponse &response)
formats
.
append
(
reported
.
split
(
_
(
","
),
QString
::
SkipEmptyParts
));
watchHandler
()
->
addTypeFormats
(
type
,
formats
);
}
const
GdbMi
hasInferiorThreadList
=
data
.
findChild
(
"hasInferiorThreadList"
);
m_hasInferiorThreadList
=
(
hasInferiorThreadList
.
data
().
toInt
()
!=
0
);
}
else
{
m_hasPython
=
false
;
if
(
m_gdbAdapter
->
dumperHandling
()
...
...
@@ -2963,7 +2965,8 @@ void GdbEngine::handleThreadInfo(const GdbResponse &response)
response
.
data
.
findChild
(
"current-thread-id"
).
data
().
toInt
();
threadsHandler
()
->
setCurrentThreadId
(
currentThreadId
);
plugin
()
->
updateState
(
this
);
// Adjust Threads combobox.
postCommand
(
"threadnames "
+
theDebuggerAction
(
MaximalStackDepth
)
->
value
().
toByteArray
(),
CB
(
handleThreadNames
),
id
);
if
(
m_hasInferiorThreadList
)
postCommand
(
"threadnames "
+
theDebuggerAction
(
MaximalStackDepth
)
->
value
().
toByteArray
(),
CB
(
handleThreadNames
),
id
);
}
else
{
// Fall back for older versions: Try to get at least a list
// of running threads.
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
0e8c3875
...
...
@@ -302,6 +302,7 @@ private: ////////// Gdb Output, State & Capability Handling //////////
int
m_gdbBuildVersion
;
// MAC only?
bool
m_isMacGdb
;
bool
m_hasPython
;
bool
m_hasInferiorThreadList
;
private:
////////// Inferior Management //////////
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment