Skip to content
GitLab
Menu
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
df8fc5a9
Commit
df8fc5a9
authored
Sep 02, 2010
by
hjk
Browse files
debugger: restrict accepted expressions in automatci tooltips to simple
identifiers.
parent
15c7e5b3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
df8fc5a9
...
...
@@ -3179,6 +3179,25 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
m_toolTipPos
=
mousePos
;
int
line
,
column
;
QString
exp
=
cppExpressionAt
(
editor
,
cursorPos
,
&
line
,
&
column
);
// Extract the first identifier, everything else is considered
// too dangerous.
int
pos1
=
0
,
pos2
=
exp
.
size
();
bool
inId
=
false
;
for
(
int
i
=
0
;
i
!=
exp
.
size
();
++
i
)
{
const
QChar
c
=
exp
.
at
(
i
);
const
bool
isIdChar
=
c
.
isLetterOrNumber
()
||
c
.
unicode
()
==
'_'
;
if
(
inId
&&
!
isIdChar
)
{
pos2
=
i
;
break
;
}
if
(
!
inId
&&
isIdChar
)
{
inId
=
true
;
pos1
=
i
;
}
}
exp
=
exp
.
mid
(
pos1
,
pos2
-
pos1
);
if
(
!
exp
.
isEmpty
()
&&
exp
==
m_toolTipExpression
)
{
showToolTip
();
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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