From 0465eb3d20c93d392893d14c0d2cfc8ea0dd1f12 Mon Sep 17 00:00:00 2001 From: Francois Chouinard Date: Tue, 17 Feb 2009 14:11:08 +0000 Subject: [PATCH] Fix for bug264721 --- .../cdt/dsf/mi/service/MIBreakpoints.java | 5 +++ .../cdt/tests/dsf/gdb/MIBreakpointsTest.java | 42 +++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java index 8fe7ab6e89c..d66c297a3d2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java @@ -460,6 +460,11 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints Integer lineNumber = (Integer) getProperty(attributes, LINE_NUMBER, -1); String function = (String) getProperty(attributes, FUNCTION, NULL_STRING); + // Fix for Bug264721 + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + if (!fileName.equals(NULL_STRING)) { if (lineNumber != -1) { location = fileName + ":" + lineNumber; //$NON-NLS-1$ diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/MIBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/MIBreakpointsTest.java index 3ce31794507..5e0307fabbd 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/MIBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/MIBreakpointsTest.java @@ -1718,7 +1718,11 @@ public class MIBreakpointsTest extends BaseTestCase { public void updateWatchpoint_AddCondition() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_1, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_1, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters(); @@ -1769,7 +1773,11 @@ public class MIBreakpointsTest extends BaseTestCase { public void updateWatchpoint_RemoveCondition() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_1, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_1, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters(); @@ -1821,7 +1829,11 @@ public class MIBreakpointsTest extends BaseTestCase { public void updateWatchpoint_ModifyCondition() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_1, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_1, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters(); @@ -2640,8 +2652,12 @@ public class MIBreakpointsTest extends BaseTestCase { public void breakpointHit_watchpointUpdateCount() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_3, true); - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_4, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_3, true); + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_4, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters(); @@ -2707,8 +2723,12 @@ public class MIBreakpointsTest extends BaseTestCase { public void breakpointHit_watchpointUpdateCondition() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_3, true); - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_4, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_3, true); + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_4, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters(); @@ -2774,8 +2794,12 @@ public class MIBreakpointsTest extends BaseTestCase { public void breakpointHit_WatchpointOutOfScope() throws Throwable { // Run to the point where the variable is initialized - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_1, true); - SyncUtil.SyncAddBreakpoint(SOURCE_FILE + ":" + LINE_NUMBER_3, true); + String fileName = SOURCE_FILE; + if (fileName.contains(" ")) { //$NON-NLS-1$ + fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_1, true); + SyncUtil.SyncAddBreakpoint(fileName + ":" + LINE_NUMBER_3, true); SyncUtil.SyncResumeUntilStopped(); clearEventCounters();