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
Marco Bubke
flatpak-qt-creator
Commits
51c47402
Commit
51c47402
authored
Jan 17, 2011
by
Friedemann Kleint
Browse files
Debugger: Fix 'Select widget to watch' on Windows.
parent
fb25e295
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
51c47402
...
...
@@ -3731,23 +3731,24 @@ void GdbEngine::watchPoint(const QPoint &pnt)
void
GdbEngine
::
handleWatchPoint
(
const
GdbResponse
&
response
)
{
if
(
response
.
resultClass
==
GdbResultDone
)
{
const
GdbMi
contents
=
response
.
data
.
findChild
(
"consolestreamoutput"
);
// "$5 = (void *) 0xbfa7ebfc\n"
const
QByteArray
ba
=
parsePlainConsoleStream
(
response
);
//qDebug() << "BA: " << ba;
const
int
posWidget
=
ba
.
indexOf
(
"QWidget"
);
const
int
posNs
=
ba
.
lastIndexOf
(
' '
,
posWidget
)
+
1
;
const
int
pos0x
=
ba
.
indexOf
(
"0x"
,
posWidget
+
7
);
if
(
posWidget
==
-
1
||
posNs
==
0
||
pos0x
==
-
1
)
{
if
(
posWidget
==
-
1
||
pos0x
==
-
1
)
{
showStatusMessage
(
tr
(
"Cannot read widget data: %1"
).
arg
(
_
(
ba
)));
}
else
{
const
QByteArray
addr
=
ba
.
mid
(
pos0x
);
//const QByteArray ns = ba.mid(posNs, posWidget - posNs);
const
QByteArray
ns
=
qtNamespace
();
const
QByteArray
type
=
ns
.
isEmpty
()
?
"QWidget*"
:
(
"'"
+
ns
+
"QWidget'*"
);
const
QString
exp
=
_
(
"(*(struct %1)%2)"
).
arg
(
_
(
type
)).
arg
(
_
(
addr
));
// qDebug() << posNs << posWidget << pos0x << addr << ns << type;
watchHandler
()
->
watchExpression
(
exp
);
if
(
addr
.
toULongLong
(
0
,
0
))
{
// Non-null pointer
const
QByteArray
ns
=
qtNamespace
();
const
QByteArray
type
=
ns
.
isEmpty
()
?
"QWidget*"
:
(
"'"
+
ns
+
"QWidget'*"
);
const
QString
exp
=
_
(
"(*(struct %1)%2)"
).
arg
(
_
(
type
)).
arg
(
_
(
addr
));
// qDebug() << posNs << posWidget << pos0x << addr << ns << type;
watchHandler
()
->
watchExpression
(
exp
);
}
else
{
showStatusMessage
(
tr
(
"Could not find a widget."
));
}
}
}
}
...
...
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