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
5aebd173
Commit
5aebd173
authored
Jan 17, 2011
by
hjk
Browse files
debugger: make 'watch widget-by-mouseclick' work again
This was the last feature that was only available in the compiled dumpers.
parent
50ea7ab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
5aebd173
...
...
@@ -3717,25 +3717,31 @@ void GdbEngine::assignValueInDebugger(const WatchData *,
void
GdbEngine
::
watchPoint
(
const
QPoint
&
pnt
)
{
//qDebug() << "WATCH " << pnt;
QByteArray
x
=
QByteArray
::
number
(
pnt
.
x
());
QByteArray
y
=
QByteArray
::
number
(
pnt
.
y
());
postCommand
(
"
call (void*)watchPoint
("
+
x
+
','
+
y
+
')'
,
postCommand
(
"
print 'QApplication::widgetAt'
("
+
x
+
','
+
y
+
')'
,
NeedsStop
,
CB
(
handleWatchPoint
));
}
void
GdbEngine
::
handleWatchPoint
(
const
GdbResponse
&
response
)
{
//qDebug() << "HANDLE WATCH POINT:" << response.toString();
if
(
response
.
resultClass
==
GdbResultDone
)
{
GdbMi
contents
=
response
.
data
.
findChild
(
"consolestreamoutput"
);
// "$5 = (void *) 0xbfa7ebfc\n"
QString
str
=
_
(
parsePlainConsoleStream
(
response
));
// "(void *) 0xbfa7ebfc"
QString
addr
=
str
.
mid
(
9
);
QByteArray
ns
=
m_dumperHelper
.
qtNamespace
();
QByteArray
type
=
ns
.
isEmpty
()
?
"QWidget*"
:
(
"'"
+
ns
+
"QWidget'*"
);
QString
exp
=
_
(
"(*(%1)%2)"
).
arg
(
_
(
type
)).
arg
(
addr
);
QByteArray
ba
=
parsePlainConsoleStream
(
response
);
const
int
posWidget
=
ba
.
indexOf
(
"QWidget"
);
if
(
posWidget
==
-
1
)
return
;
const
int
posNs
=
ba
.
lastIndexOf
(
' '
,
posWidget
)
+
1
;
if
(
posNs
==
0
)
return
;
const
int
pos0x
=
ba
.
indexOf
(
"0x"
,
posWidget
+
7
);
if
(
pos0x
==
-
1
)
return
;
const
QByteArray
addr
=
ba
.
mid
(
pos0x
);
const
QByteArray
ns
=
ba
.
mid
(
posNs
,
posWidget
-
posNs
);
const
QByteArray
type
=
ns
.
isEmpty
()
?
"QWidget*"
:
(
"'"
+
ns
+
"QWidget'*"
);
const
QString
exp
=
_
(
"(*(%1)%2)"
).
arg
(
_
(
type
)).
arg
(
_
(
addr
));
watchHandler
()
->
watchExpression
(
exp
);
}
}
...
...
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