diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h
index eae97dd2625e90c95564e59fe1bab4d97ff940c2..040911aac1a3ce9333b840e97f81f5c737a19cd8 100644
--- a/src/plugins/debugger/debuggerconstants.h
+++ b/src/plugins/debugger/debuggerconstants.h
@@ -79,12 +79,6 @@ const char * const DOCKWIDGET_QML_SCRIPTCONSOLE = "Debugger.Docks.ScriptConsole"
 
 namespace Internal {
     enum { debug = 0 };
-#ifdef Q_OS_MAC
-    const char * const LD_PRELOAD_ENV_VAR = "DYLD_INSERT_LIBRARIES";
-#else
-    const char * const LD_PRELOAD_ENV_VAR = "LD_PRELOAD";
-#endif
-
 } // namespace Internal
 
 const char * const OPENED_BY_DEBUGGER         = "OpenedByDebugger";
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index b122edfce4aff525b14009d9aa999cccdb928082..af97def426e6903f70c3a9c2cb61417d70ac9c60 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1548,8 +1548,13 @@ void GdbEngine::pythonDumpersFailed()
     if (m_gdbAdapter->dumperHandling()
                 == AbstractGdbAdapter::DumperLoadedByGdbPreload
             && checkDebuggingHelpersClassic()) {
+#ifdef Q_OS_MAC
+        const char * const LD_PRELOAD_ENV_VAR = "DYLD_INSERT_LIBRARIES";
+#else
+        const char * const LD_PRELOAD_ENV_VAR = "LD_PRELOAD";
+#endif
         QByteArray cmd = "set environment ";
-        cmd += Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR;
+        cmd += LD_PRELOAD_ENV_VAR;
         cmd += ' ';
         cmd += startParameters().startMode == StartRemoteGdb
            ? startParameters().remoteDumperLib