summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-10-13 01:53:57 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-10-16 08:23:30 +0000
commite2e96cab52948b4404cac343bb3ad7c36ca9fafd (patch)
tree9ef7f2c07fc69573f3c275fd5e8e2d5f34a57daf
parentc7cb7672f0c0457477bbcd0fbd64af9874e42a98 (diff)
downloadqt-creator-e2e96cab52948b4404cac343bb3ad7c36ca9fafd.tar.gz
GDB: Handle 'pretty_printer.to_string()' returning None
The documentation for the GDB pretty printer function 'pretty_printer.to_string' says [1]: > [...] > Finally, if this method returns None then no further > operations are peformed in this method and nothing is printed. > [...] Therefore, skip this part if the printer's 'to_string' method returns 'None' and only fall back to assuming LazyString otherwise. This e.g. fixes the std::pair pretty printer (for gcc-9 libstdc++6) for which "<not accessible>" was shown previously in the debugger's locals/expression view. Now it shows the object's address and allows expansion to see the values for the 'first' and 'second' members. [1] https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing-API.html Change-Id: I33b1af82f731c347314af76c533b096b8a5afe21 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--share/qtcreator/debugger/gdbbridge.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 2f056c7a93..858b56c5c1 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -145,7 +145,7 @@ class PlainDumper:
d.putValue(d.hexencode(val), 'utf8:1:0')
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
d.putValue(val)
- else: # Assuming LazyString
+ elif val is not None: # Assuming LazyString
d.putCharArrayValue(val.address, val.length,
val.type.target().sizeof)