diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 81e463e16d4a4858d6add7c9fdb3db534b6755c6..9ea8aaf67395053e6366533daf3ffaacc3d87049 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2201,7 +2201,24 @@ void GdbEngine::attemptBreakpointSynchronization()
     // For best results, we rely on an up-to-date fullname mapping.
     // The listing completion will retrigger us, so no futher action is needed.
     if (m_sourcesListOutdated && theDebuggerBoolSetting(UsePreciseBreakpoints)) {
-        reloadSourceFilesInternal();
+        if (state() == InferiorRunning) {
+            // FIXME: this is a hack
+            // The hack solves the problem that we want both commands
+            // (reloadSourceFiles and reloadBreakList) to be executed
+            // within the same stop-executecommand-continue cycle.
+            // Just calling reloadSourceFiles and reloadBreakList doesn't work
+            // in this case, because a) stopping the executable is asyncronous,
+            // b) we wouldn't want to stop-exec-continue twice
+            m_sourcesListUpdating = true;
+            GdbCommand cmd;
+            cmd.command = "-file-list-exec-source-files";
+            cmd.flags = NoFlags;
+            cmd.callback = &GdbEngine::handleQuerySources;
+            cmd.callbackName = "";
+            m_commandsToRunOnTemporaryBreak.append(cmd);
+        } else {
+            reloadSourceFilesInternal();
+        }
         reloadBreakListInternal();
         return;
     }