diff --git a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
index 960f675e..08947046 100644
--- a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
+++ b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
@@ -183,6 +183,7 @@ class MainTest(unittest.TestCase):
                 print(func)
                 continue
             try:
+                print('executing', func)
                 exec(func)
             except NotImplementedError:
                 print(func, "# raises NotImplementedError")
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index badb6a4c..250d74b1 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -376,6 +376,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
     s << "extern \"C\" {" << endl;
     const FunctionGroupMap &functionGroups = getFunctionGroups(metaClass);
     for (FunctionGroupMapIt it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) {
+        qDebug() << __FUNCTION__ << "group" << it.value().constFirst()->name() << it.value().size();
         AbstractMetaFunctionList overloads;
         QSet<QString> seenSignatures;
         for (AbstractMetaFunction *func : it.value()) {
@@ -392,7 +393,16 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
                 overloads << getFunctionAndInheritedOverloads(func, &seenSignatures);
             }
         }
-
+        {
+            QDebug  d = qDebug();
+            d << __FUNCTION__ << "overloads" << overloads.size();
+            for (const AbstractMetaFunction *f : overloads) {
+                d << "           " << f->minimalSignature();
+                if (auto ic = f->implementingClass())
+                    d << ic->name();
+                d << '\n';
+            }
+        }
         if (overloads.isEmpty())
             continue;
 
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 976b3414..d1d31793 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -2498,16 +2498,27 @@ QMap< QString, AbstractMetaFunctionList > ShibokenGenerator::getFunctionGroups(c
 
 AbstractMetaFunctionList ShibokenGenerator::getInheritedOverloads(const AbstractMetaFunction *func, QSet<QString> *seen)
 {
+    {
+        QDebug  d = qDebug();
+        d << __FUNCTION__ << func->name();
+        if (const AbstractMetaClass *ic = func->implementingClass())
+            d << ic->name();
+        d << func->minimalSignature();
+    }
     AbstractMetaFunctionList results;
     AbstractMetaClass* basis;
     if (func->ownerClass() && (basis = func->ownerClass()->baseClass(), basis)) {
         for (; basis; basis = basis->baseClass()) {
+            qDebug() << __FUNCTION__ << "loop" << basis->name();
             const AbstractMetaFunction* inFunc = basis->findFunction(func->name());
             if (inFunc && !seen->contains(inFunc->minimalSignature())) {
+                qDebug() << __FUNCTION__ << "inserting" << inFunc->minimalSignature()
+                         << "since" << (*seen);
                 seen->insert(inFunc->minimalSignature());
                 AbstractMetaFunction* newFunc = inFunc->copy();
                 newFunc->setImplementingClass(func->implementingClass());
                 results << newFunc;
+
             }
         }
     }
@@ -2516,6 +2527,13 @@ AbstractMetaFunctionList ShibokenGenerator::getInheritedOverloads(const Abstract
 
 AbstractMetaFunctionList ShibokenGenerator::getFunctionAndInheritedOverloads(const AbstractMetaFunction *func, QSet<QString> *seen)
 {
+    {
+        QDebug  d = qDebug();
+        d << __FUNCTION__ << func->name();
+        if (const AbstractMetaClass *ic = func->implementingClass())
+            d << ic->name();
+        d << func->minimalSignature();
+    }
     AbstractMetaFunctionList results;
     seen->insert(func->minimalSignature());
     results << const_cast<AbstractMetaFunction *>(func) << getInheritedOverloads(func, seen);
@@ -2524,6 +2542,12 @@ AbstractMetaFunctionList ShibokenGenerator::getFunctionAndInheritedOverloads(con
 
 AbstractMetaFunctionList ShibokenGenerator::getFunctionOverloads(const AbstractMetaClass* scope, const QString& functionName)
 {
+    {
+        QDebug  d = qDebug();
+        d << __FUNCTION__ << functionName;
+        if (scope)
+            d << "scope=" << scope->name();
+    }
     AbstractMetaFunctionList lst = scope ? scope->functions() : globalFunctions();
 
     AbstractMetaFunctionList results;
@@ -2536,6 +2560,7 @@ AbstractMetaFunctionList ShibokenGenerator::getFunctionOverloads(const AbstractM
             results << getFunctionAndInheritedOverloads(func, &seenSignatures);
         }
     }
+    qDebug() << __FUNCTION__ << functionName << "rets" << results.size() << results;
     return results;
 }
 
