diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 48983def79..e32813f5bf 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -1037,6 +1037,7 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
 QAbstractAnimation::QAbstractAnimation(QObject *parent)
     : QObject(*new QAbstractAnimationPrivate, 0)
 {
+    qDebug(__FUNCTION__);
     // Allow auto-add on reparent
     setParent(parent);
 }
@@ -1047,6 +1048,7 @@ QAbstractAnimation::QAbstractAnimation(QObject *parent)
 QAbstractAnimation::QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent)
     : QObject(dd, 0)
 {
+    qDebug(__FUNCTION__);
     // Allow auto-add on reparent
    setParent(parent);
 }
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 5dd5f8031e..a0ab0da4dc 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -477,6 +477,7 @@ QIODevice::QIODevice()
 QIODevice::QIODevice(QObject *parent)
     : QObject(*new QIODevicePrivate, parent)
 {
+//    qDebug(__FUNCTION__);
 #if defined QIODEVICE_DEBUG
     printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, metaObject()->className());
 #endif
@@ -488,6 +489,7 @@ QIODevice::QIODevice(QObject *parent)
 QIODevice::QIODevice(QIODevicePrivate &dd, QObject *parent)
     : QObject(dd, parent)
 {
+//    qDebug(__FUNCTION__);
 }
 #endif
 
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 304a7bda08..6afb415989 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -143,14 +143,20 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId)
     Constructs a new event dispatcher with the given \a parent.
 */
 QAbstractEventDispatcher::QAbstractEventDispatcher(QObject *parent)
-    : QObject(*new QAbstractEventDispatcherPrivate, parent) {}
+    : QObject(*new QAbstractEventDispatcherPrivate, parent)
+{
+    qDebug(__FUNCTION__);
+}
 
 /*!
     \internal
 */
 QAbstractEventDispatcher::QAbstractEventDispatcher(QAbstractEventDispatcherPrivate &dd,
                                                    QObject *parent)
-    : QObject(dd, parent) {}
+    : QObject(dd, parent)
+{
+    qDebug(__FUNCTION__);
+}
 
 /*!
     Destroys the event dispatcher.
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 66afa52617..f0f9601df7 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -801,6 +801,22 @@ static bool check_parent_thread(QObject *parent,
     \sa parent(), findChild(), findChildren()
 */
 
+static  void launchGdb()
+{
+    char cmd[512];
+    qsnprintf(cmd, 512, "gdb --pid %d <<EOF\n"
+                        "set prompt\n"
+                        "set height 0\n"
+                        "thread apply all where full\n"
+                        "where\n"
+                        "detach\n"
+                        "quit\n"
+                        "EOF\n",
+              (int)getpid());
+    if (system(cmd) == -1)
+        fprintf(stderr, "calling gdb failed\n");
+}
+
 QObject::QObject(QObject *parent)
     : d_ptr(new QObjectPrivate)
 {
@@ -809,14 +825,18 @@ QObject::QObject(QObject *parent)
     d->threadData = (parent && !parent->thread()) ? parent->d_func()->threadData : QThreadData::current();
     d->threadData->ref();
     if (parent) {
-        QT_TRY {
-            if (!check_parent_thread(parent, parent ? parent->d_func()->threadData : 0, d->threadData))
-                parent = 0;
-            setParent(parent);
-        } QT_CATCH(...) {
-            d->threadData->deref();
-            QT_RETHROW;
+
+        if (!check_parent_thread(parent, parent ? parent->d_func()->threadData : 0, d->threadData)) {
+            parent = 0;
+            if (d->isWidget)
+                qDebug("Wg");
+            if (d->isWindow)
+                qDebug("Wd");
+            if (qEnvironmentVariableIsSet("DEBUG"))
+                launchGdb();
+            qWarning("Warning");
         }
+        setParent(parent);
     }
 #if QT_VERSION < 0x60000
     qt_addObject(this);
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index 6ff8268978..6d9d717cf3 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -142,6 +142,7 @@ public:
 QSocketNotifier::QSocketNotifier(qintptr socket, Type type, QObject *parent)
     : QObject(*new QSocketNotifierPrivate, parent)
 {
+    qDebug(__FUNCTION__);
     Q_D(QSocketNotifier);
     d->sockfd = socket;
     d->sntype = type;
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 90f29aa630..3bd1606140 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -148,6 +148,7 @@ static const int INV_TIMER = -1;                // invalid timer id
 QTimer::QTimer(QObject *parent)
     : QObject(parent), id(INV_TIMER), inter(0), del(0), single(0), nulltimer(0), type(Qt::CoarseTimer)
 {
+    qDebug(__FUNCTION__);
     Q_UNUSED(del);  // ### Qt 6: remove field
 }
 
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 5df0508829..a8705996c8 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -409,6 +409,7 @@ QThread *QThread::currentThread()
 QThread::QThread(QObject *parent)
     : QObject(*(new QThreadPrivate), parent)
 {
+    qDebug(__FUNCTION__);
     Q_D(QThread);
     // fprintf(stderr, "QThreadData %p created for thread %p\n", d->data, this);
     d->data->thread = this;
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index ea2c611082..62092e62a1 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -458,7 +458,9 @@ void QThreadPoolPrivate::stealAndRunRunnable(QRunnable *runnable)
 */
 QThreadPool::QThreadPool(QObject *parent)
     : QObject(*new QThreadPoolPrivate, parent)
-{ }
+{
+qDebug(__FUNCTION__);
+}
 
 /*!
     Destroys the QThreadPool.
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index 444d4727fd..9064e8c736 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -373,7 +373,10 @@ class QDBusConnectionDispatchEnabler : public QObject
     Q_OBJECT
     QDBusConnectionPrivate *con;
 public:
-    QDBusConnectionDispatchEnabler(QDBusConnectionPrivate *con) : con(con) {}
+    QDBusConnectionDispatchEnabler(QDBusConnectionPrivate *con) : con(con)
+    {
+        qDebug(__FUNCTION__);
+    }
 
 public slots:
     void execute()
diff --git a/src/gui/kernel/qplatforminputcontext.cpp b/src/gui/kernel/qplatforminputcontext.cpp
index 9771e6ba11..3595135c40 100644
--- a/src/gui/kernel/qplatforminputcontext.cpp
+++ b/src/gui/kernel/qplatforminputcontext.cpp
@@ -82,6 +82,7 @@ QT_BEGIN_NAMESPACE
 QPlatformInputContext::QPlatformInputContext()
     : QObject(*(new QPlatformInputContextPrivate))
 {
+    qDebug(__FUNCTION__);
 }
 
 /*!
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 3d7d22959d..17cc731005 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -159,6 +159,7 @@ QWindow::QWindow(QScreen *targetScreen)
     : QObject(*new QWindowPrivate(), 0)
     , QSurface(QSurface::Window)
 {
+    qDebug(__FUNCTION__);
     Q_D(QWindow);
     d->init(targetScreen);
 }
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 7cc694a613..2cb4eccf15 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -6588,6 +6588,7 @@ void QGraphicsScenePrivate::grabGesture(QGraphicsItem *, Qt::GestureType gesture
 
 void QGraphicsScenePrivate::ungrabGesture(QGraphicsItem *item, Qt::GestureType gesture)
 {
+    qDebug( __FUNCTION__);
     // we know this can only be an object
     Q_ASSERT(item->d_ptr->isObject);
     QGraphicsObject *obj = static_cast<QGraphicsObject *>(item);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 581b7c9c94..2ebe36836a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -551,6 +551,7 @@ QApplication::QApplication(int &argc, char **argv, int _internal)
 #endif
     : QGuiApplication(*new QApplicationPrivate(argc, argv, _internal))
 {
+    qDebug(__FUNCTION__);
     Q_D(QApplication);
     d->init();
 }
@@ -4523,6 +4524,7 @@ void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
 #ifndef QT_NO_GESTURES
 QGestureManager* QGestureManager::instance()
 {
+    qDebug( __FUNCTION__);
     QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
     if (!qAppPriv)
         return 0;
diff --git a/src/widgets/kernel/qgesture.cpp b/src/widgets/kernel/qgesture.cpp
index fc715687c6..c3ea172e4a 100644
--- a/src/widgets/kernel/qgesture.cpp
+++ b/src/widgets/kernel/qgesture.cpp
@@ -105,6 +105,7 @@ QGesture::QGesture(QObject *parent)
     : QObject(*new QGesturePrivate, parent)
 {
     d_func()->gestureType = Qt::CustomGesture;
+    qDebug(__FUNCTION__);
 }
 
 /*!
@@ -113,6 +114,7 @@ QGesture::QGesture(QObject *parent)
 QGesture::QGesture(QGesturePrivate &dd, QObject *parent)
     : QObject(dd, parent)
 {
+    qDebug(__FUNCTION__);
 }
 
 /*!
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 5bf66d68e3..a72dd46057 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -91,6 +91,7 @@ QGestureManager::QGestureManager(QObject *parent)
     : QObject(parent), state(NotGesture), m_lastCustomGestureId(Qt::CustomGesture)
 {
     qRegisterMetaType<Qt::GestureState>();
+    qDebug(__FUNCTION__);
 
 #if defined(Q_OS_OSX)
     registerGestureRecognizer(new QMacSwipeGestureRecognizer);
diff --git a/src/widgets/kernel/qgesturerecognizer.cpp b/src/widgets/kernel/qgesturerecognizer.cpp
index 65c46a5e56..01292b3e55 100644
--- a/src/widgets/kernel/qgesturerecognizer.cpp
+++ b/src/widgets/kernel/qgesturerecognizer.cpp
@@ -221,6 +221,7 @@ void QGestureRecognizer::reset(QGesture *gesture)
 */
 Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer *recognizer)
 {
+    qDebug( __FUNCTION__);
     return QGestureManager::instance()->registerGestureRecognizer(recognizer);
 }
 
@@ -231,6 +232,7 @@ Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer *recog
 */
 void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type)
 {
+    qDebug( __FUNCTION__);
     QGestureManager::instance()->unregisterGestureRecognizer(type);
 }
 
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 4adccceebb..98760a3d39 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -983,6 +983,7 @@ struct QWidgetExceptionCleaner
     /* this cleans up when the constructor throws an exception */
     static inline void cleanup(QWidget *that, QWidgetPrivate *d)
     {
+        qDebug(__FUNCTION__);
 #ifdef QT_NO_EXCEPTIONS
         Q_UNUSED(that);
         Q_UNUSED(d);
@@ -1026,12 +1027,8 @@ struct QWidgetExceptionCleaner
 QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)
     : QObject(*new QWidgetPrivate, 0), QPaintDevice()
 {
-    QT_TRY {
-        d_func()->init(parent, f);
-    } QT_CATCH(...) {
-        QWidgetExceptionCleaner::cleanup(this, d_func());
-        QT_RETHROW;
-    }
+    qDebug("%s %p", __FUNCTION__, this);
+    d_func()->init(parent, f);
 }
 
 
@@ -1040,13 +1037,9 @@ QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)
 QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f)
     : QObject(dd, 0), QPaintDevice()
 {
+    qDebug("%s %p", __FUNCTION__, this);
     Q_D(QWidget);
-    QT_TRY {
-        d->init(parent, f);
-    } QT_CATCH(...) {
-        QWidgetExceptionCleaner::cleanup(this, d_func());
-        QT_RETHROW;
-    }
+    d->init(parent, f);
 }
 
 /*!
@@ -1563,6 +1556,7 @@ void QWidgetPrivate::createTLSysExtra()
 
 QWidget::~QWidget()
 {
+    qDebug() <<  __FUNCTION__ << this;
     Q_D(QWidget);
     d->data.in_destructor = true;
 
@@ -12376,6 +12370,7 @@ QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const
 void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)
 {
     Q_D(QWidget);
+    qDebug( __FUNCTION__);
     d->gestureContext.insert(gesture, flags);
     (void)QGestureManager::instance(); // create a gesture manager
 }
@@ -12390,6 +12385,7 @@ void QWidget::ungrabGesture(Qt::GestureType gesture)
 {
     // if you modify this function, check the inlined version in ~QWidget, too
     Q_D(QWidget);
+    qDebug( __FUNCTION__);
     if (d->gestureContext.remove(gesture)) {
         if (QGestureManager *manager = QGestureManager::instance())
             manager->cleanupCachedGestures(this, gesture);
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 8006be8c27..4c41e545d0 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -397,6 +397,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
 QStyle::QStyle()
     : QObject(*new QStylePrivate)
 {
+    qDebug(__FUNCTION__);
     Q_D(QStyle);
     d->proxyStyle = this;
 }
@@ -411,6 +412,7 @@ QStyle::QStyle(QStylePrivate &dd)
 {
   Q_D(QStyle);
   d->proxyStyle = this;
+  qDebug(__FUNCTION__);
 }
 
 /*!
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index aca38884a7..ee9c1a6275 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -379,6 +379,7 @@ void QMainWindowPrivate::init()
 QMainWindow::QMainWindow(QWidget *parent, Qt::WindowFlags flags)
     : QWidget(*(new QMainWindowPrivate()), parent, flags | Qt::Window)
 {
+    qDebug("%s %p", __FUNCTION__, this);
     d_func()->init();
 }
 
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 8f7271c2dc..ab04e471ea 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -241,6 +241,7 @@ QT_BEGIN_NAMESPACE
 QPushButton::QPushButton(QWidget *parent)
     : QAbstractButton(*new QPushButtonPrivate, parent)
 {
+    qDebug("%s %p", __FUNCTION__, this);
     Q_D(QPushButton);
     d->init();
 }
@@ -253,6 +254,7 @@ QPushButton::QPushButton(QWidget *parent)
 QPushButton::QPushButton(const QString &text, QWidget *parent)
     : QPushButton(parent)
 {
+    qDebug("%s %p", __FUNCTION__, this);
     setText(text);
 }
 
