diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 23b118b13..42708d695 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -2209,8 +2209,9 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
         const QString originalDefaultExpression =
             fixDefaultValue(arg->defaultValueExpression(), metaArg.type(), currentClass);
 
-        metaArg.setOriginalDefaultValueExpression(originalDefaultExpression);
+        metaArg.setOriginalDefaultValueExpression(originalDefaultExpression);        
         metaArg.setDefaultValueExpression(originalDefaultExpression);
+        qDebug() << __FUNCTION__ << arg->defaultValueExpression() << originalDefaultExpression;
 
         applyDefaultExpressionModifications(functionMods, i, &metaArg);
 
@@ -2934,13 +2935,17 @@ QString AbstractMetaBuilderPrivate::fixSimpleDefaultValue(QStringView expr,
 QString AbstractMetaBuilderPrivate::fixDefaultValue(QString expr, const AbstractMetaType &type,
                                                     const AbstractMetaClassCPtr &implementingClass) const
 {
+    qDebug() << __FUNCTION__ << expr;
     expr.replace(u'\n', u' '); // breaks signature parser
 
-    if (AbstractMetaBuilder::dontFixDefaultValue(expr))
+    if (AbstractMetaBuilder::dontFixDefaultValue(expr)) {
+        qDebug() << __FUNCTION__ << "b1 dontFixDefaultValue";
         return expr;
+    }
 
     if (type.isFlags() || type.isEnum()) {
         expr = fixEnumDefault(type, expr, implementingClass);
+        qDebug() << __FUNCTION__ << "enum" << expr;
     } else if (type.isContainer() && expr.contains(u'<')) {
         // Expand a container of a nested class, fex
         // "QList<FormatRange>()" -> "QList<QTextLayout::FormatRange>()"
@@ -2961,6 +2966,7 @@ QString AbstractMetaBuilderPrivate::fixDefaultValue(QString expr, const Abstract
         const auto innerType = QStringView{expr}.mid(innerPos, innerLen).trimmed();
         if (isUnderQualifiedSpec(qualifiedInnerTypeName, innerType))
             expr.replace(innerPos, innerLen, qualifiedInnerTypeName);
+        qDebug() << __FUNCTION__ << "container" << expr;
     } else {
         // Here the default value is supposed to be a constructor, a class field,
         // a constructor receiving a static class field or an enum. Consider
@@ -3009,8 +3015,10 @@ QString AbstractMetaBuilderPrivate::fixDefaultValue(QString expr, const Abstract
         const auto className = QStringView{expr}.left(parenPos);
         if (isUnderQualifiedSpec(qualifiedTypeName, className))
             expr.replace(0, className.size(), qualifiedTypeName);
+        qDebug() << __FUNCTION__ << "def" << expr;
     }
 
+    qDebug() << __FUNCTION__ << "rets" << expr;
     return expr;
 }
 
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index 44408572d..34452ecaf 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -642,7 +642,9 @@ void BuilderPrivate::endTemplateTypeAlias(const CXCursor &typeAliasCursor)
 // CXCursor_EnumConstantDecl, ParmDecl (a = Flag1 | Flag2)
 QString BuilderPrivate::cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor)
 {
+    qDebug() << __FUNCTION__ << cursor;
     const std::string_view snippet = bv->getCodeSnippet(cursor);
+    qDebug() << __FUNCTION__ << "snippet=" << snippet;
     auto equalSign = snippet.find('=');
     if (equalSign == std::string::npos)
         return QString();
@@ -1070,6 +1072,7 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
             d->m_currentFunction->addArgument(d->m_currentArgument);
             QString defaultValueExpression = d->cursorValueExpression(this, cursor);
             if (!defaultValueExpression.isEmpty()) {
+                qDebug() << __FUNCTION__ << "defVal=" << defaultValueExpression;
                 d->m_currentArgument->setDefaultValueExpression(defaultValueExpression);
                 d->m_currentArgument->setDefaultValue(true);
             }
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index c695c3044..a55a7a60e 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -2994,6 +2994,7 @@ qsizetype CppGenerator::writePythonToCppTypeConversion(TextStream &s,
     }
         break;
     case GeneratorArgument::Conversion::Default:
+        qDebug() << __FUNCTION__ << defaultValue << type;
         s << ' ' << cppOut;
         if (isProtectedEnum && avoidProtectedHack()) {
             s << " = ";
