Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
9dc3e3ed
Commit
9dc3e3ed
authored
Apr 08, 2011
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: fix quoting of watched expressions with funny chars inside
Base 64 to the rescue. Reviewed-by: con
parent
d40c15ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
share/qtcreator/gdbmacros/dumper.py
share/qtcreator/gdbmacros/dumper.py
+3
-6
src/plugins/debugger/gdb/pythongdbengine.cpp
src/plugins/debugger/gdb/pythongdbengine.cpp
+9
-1
No files found.
share/qtcreator/gdbmacros/dumper.py
View file @
9dc3e3ed
...
...
@@ -1335,15 +1335,13 @@ class Dumper:
def
handleWatch
(
self
,
exp
,
iname
):
exp
=
str
(
exp
)
escapedExp
=
exp
.
replace
(
'"'
,
'
\\
"'
)
escapedExp
=
escapedExp
.
replace
(
'
\\
'
,
'
\\\\
'
)
escapedExp
=
base64
.
b64encode
(
exp
);
#warn("HANDLING WATCH %s, INAME: '%s'" % (exp, iname))
if
exp
.
startswith
(
"["
)
and
exp
.
endswith
(
"]"
):
#warn("EVAL: EXP: %s" % exp)
with
SubItem
(
self
):
self
.
put
(
'iname="%s",'
%
iname
)
self
.
put
(
'name="%s",'
%
escapedExp
)
self
.
put
(
'exp="%s",'
%
escapedExp
)
self
.
put
(
'wname="%s",'
%
escapedExp
)
try
:
list
=
eval
(
exp
)
self
.
putValue
(
""
)
...
...
@@ -1366,8 +1364,7 @@ class Dumper:
with
SubItem
(
self
):
self
.
put
(
'iname="%s",'
%
iname
)
self
.
put
(
'name="%s",'
%
escapedExp
)
self
.
put
(
'exp="%s",'
%
escapedExp
)
self
.
put
(
'wname="%s",'
%
escapedExp
)
handled
=
False
if
len
(
exp
)
==
0
:
# The <Edit> case
self
.
putValue
(
" "
)
...
...
src/plugins/debugger/gdb/pythongdbengine.cpp
View file @
9dc3e3ed
...
...
@@ -152,7 +152,15 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response)
foreach
(
const
GdbMi
&
child
,
data
.
children
())
{
WatchData
dummy
;
dummy
.
iname
=
child
.
findChild
(
"iname"
).
data
();
dummy
.
name
=
_
(
child
.
findChild
(
"name"
).
data
());
GdbMi
wname
=
child
.
findChild
(
"wname"
);
if
(
wname
.
isValid
())
{
// Happens (only) for watched expressions. They are encoded as.
// base64 encoded 8 bit data, without quotes
dummy
.
name
=
decodeData
(
wname
.
data
(),
5
);
dummy
.
exp
=
dummy
.
name
.
toUtf8
();
}
else
{
dummy
.
name
=
_
(
child
.
findChild
(
"name"
).
data
());
}
//qDebug() << "CHILD: " << child.toString();
parseWatchData
(
watchHandler
()
->
expandedINames
(),
dummy
,
child
,
&
list
);
}
...
...
Write
Preview
Markdown
is supported
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