aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-22 11:01:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-22 18:45:09 +0200
commit8878f9980d873cccc8f67cc6aed60929396872f2 (patch)
tree6a68d0b491131278eb36fac346e21a8270faf4ea
parented8dbddc67517bff961e4b3c300b21ce987e3e6a (diff)
shiboken6: Improve typesystem debug output
Add some debug output for PrimitiveTypeEntry and indicate built-in types. As a drive-by, add explamatory comment. Task-number: PYSIDE-1660 Change-Id: I870b7f3c2d344a6a3944ea8ac7ccb0d864cbe294 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken6/ApiExtractor/typesystem.cpp16
-rw-r--r--sources/shiboken6/ApiExtractor/typesystem.h7
2 files changed, 22 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystem.cpp b/sources/shiboken6/ApiExtractor/typesystem.cpp
index 88aa15e7f..4a34046df 100644
--- a/sources/shiboken6/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystem.cpp
@@ -2114,9 +2114,13 @@ void TypeEntry::formatDebug(QDebug &debug) const
if (m_d->m_name != cppName)
debug << "\", cppName=\"" << cppName << '"';
debug << ", type=" << m_d->m_type << ", codeGeneration="
- << m_d->m_codeGeneration << ", target=\"" << targetLangName() << '"';
+ << m_d->m_codeGeneration;
+ const QString &targetName = targetLangName();
+ if (m_d->m_name != targetName)
+ debug << ", target=\"" << targetLangName() << '"';
FORMAT_NONEMPTY_STRING("package", m_d->m_targetLangPackage)
FORMAT_BOOL("stream", m_d->m_stream)
+ FORMAT_BOOL("built-in", m_d->m_builtin)
FORMAT_LIST_SIZE("codeSnips", m_d->m_codeSnips)
FORMAT_NONEMPTY_STRING("targetConversionRule", m_d->m_targetConversionRule)
if (m_d->m_viewOn)
@@ -2134,6 +2138,16 @@ void TypeEntry::formatDebug(QDebug &debug) const
formatList(debug, "extraIncludes", m_d->m_extraIncludes, ", ");
}
+void PrimitiveTypeEntry::formatDebug(QDebug &debug) const
+{
+ TypeEntry::formatDebug(debug);
+ if (auto *e = referencedTypeEntry()) {
+ debug << ", references";
+ for (; e != nullptr; e = e->referencedTypeEntry())
+ debug << ":\"" << e->qualifiedCppName() <<'"';
+ }
+}
+
void ComplexTypeEntry::formatDebug(QDebug &debug) const
{
S_D(const ComplexTypeEntry);
diff --git a/sources/shiboken6/ApiExtractor/typesystem.h b/sources/shiboken6/ApiExtractor/typesystem.h
index 38b8c0143..54eaf4e40 100644
--- a/sources/shiboken6/ApiExtractor/typesystem.h
+++ b/sources/shiboken6/ApiExtractor/typesystem.h
@@ -370,6 +370,9 @@ protected:
QString buildTargetLangName() const override;
};
+/// A PrimitiveTypeEntry is user-defined type with conversion rules, a C++
+/// primitive type for which a PrimitiveTypeConverter exists in libshiboken
+/// or a typedef to a C++ primitive type as determined by AbstractMetaBuilder.
class PrimitiveTypeEntry : public TypeEntry
{
public:
@@ -408,6 +411,10 @@ public:
TypeEntry *clone() const override;
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
protected:
explicit PrimitiveTypeEntry(PrimitiveTypeEntryPrivate *d);
};