From 24d9ad7c1127c436d4ae5f14ae7f17c61325928b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 16 Jul 2019 10:31:03 +0200 Subject: [PATCH] Dumper: Adapt QC internal dumper to renamed class FileName is now FilePath. Follow the approach that is used internal to display the summary of the file path as the content of its URL if non-empty and the content of the file otherwise. Keep the old approach as well as it can still be used, even in new code thanks to a using declaration and fallback to the old approach if debugging old source. Change-Id: I37c621e451fea92ca34db9a63b5ca26b3bdc201c Reviewed-by: hjk --- share/qtcreator/debugger/creatortypes.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index 087619eb4a3..5c049e482f8 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -191,10 +191,19 @@ def qdump__CPlusPlus__Internal__Value(d, value): d.putValue(value["l"]) d.putPlainChildren(value) -def qdump__Utils__FileName(d, value): - d.putStringValue(value) +def qdump__Utils__FilePath(d, value): + try: + if not d.extractPointer(value["m_url"]): # there is no valid URL + d.putStringValue(value["m_data"]) + else: + d.putItem(value["m_url"]) + except: + d.putStringValue(value) # support FileName before 4.10 as well d.putPlainChildren(value) +def qdump__Utils__FileName(d, value): + qdump__Utils__FilePath(d, value) + def qdump__Utils__ElfSection(d, value): d.putByteArrayValue(value["name"]) d.putPlainChildren(value)