aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/debugger
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-03-15 12:45:15 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2019-03-15 13:48:21 +0000
commitb29296e9e0265b9b9d6d0b17fa2b91408943a967 (patch)
tree104f400ad6c122356c3571b9427395a8ff2b6adb /share/qtcreator/debugger
parent85dcfafe5ba27b4bfb20d9cf19dbbd340e081838 (diff)
Escape GDB pretty printer output
Hexencode the output from GDB pretty printer, since Double quotes ('"') and potentially more characters need to be escaped in order for the variable values to be properly displayed in the variable pane while debugging. The 'utf8:1:0' parameter to 'putValue' (as compared to just 'utf8') makes sure that no extra quotes are displayed at the beginning and end of the value. Fixes: QTCREATORBUG-22135 Change-Id: I4ad9fdc75d8f389cc4cdd18d5da1eec242f8a329 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'share/qtcreator/debugger')
-rw-r--r--share/qtcreator/debugger/gdbbridge.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 295d178d58..6b37da43b7 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -141,7 +141,8 @@ class PlainDumper:
d.putType(value.nativeValue.type.name)
val = printer.to_string()
if isinstance(val, str):
- d.putValue(val)
+ # encode and avoid extra quotes ('"') at beginning and end
+ d.putValue(d.hexencode(val), 'utf8:1:0')
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
d.putValue(val)
else: # Assuming LazyString