diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index ab173cc0eab..b31ee7130e4 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -30,7 +30,9 @@ #include #include +#include #include +#include #include #include @@ -2074,8 +2076,10 @@ QString GdbEngine::breakpointLocation(const BreakpointParameters &data) return addressSpec(data.address); BreakpointPathUsage usage = data.pathUsage; - if (usage == BreakpointPathUsageEngineDefault) - usage = BreakpointUseShortPath; + if (usage == BreakpointPathUsageEngineDefault) { + ProjectExplorer::Project *project = ProjectManager::projectForFile(data.fileName); + usage = project ? BreakpointUseFullPath : BreakpointUseShortPath; + } const QString fileName = usage == BreakpointUseFullPath ? data.fileName.path() : breakLocation(data.fileName); @@ -2088,8 +2092,10 @@ QString GdbEngine::breakpointLocation(const BreakpointParameters &data) QString GdbEngine::breakpointLocation2(const BreakpointParameters &data) { BreakpointPathUsage usage = data.pathUsage; - if (usage == BreakpointPathUsageEngineDefault) - usage = BreakpointUseShortPath; + if (usage == BreakpointPathUsageEngineDefault) { + ProjectExplorer::Project *project = ProjectManager::projectForFile(data.fileName); + usage = project ? BreakpointUseFullPath : BreakpointUseShortPath; + } const QString fileName = usage == BreakpointUseFullPath ? data.fileName.path() : breakLocation(data.fileName);