Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dsdp-dd-dev] Windows version of the MIBrekInsert command

I'm looking at the MIBreakpoins service which I guess would be a good candidate to change.

The MIBreakpoints.addBreakpoint(...) ends with:
		// Execute the command
        fConnection.queueCommand(
            new MIBreakInsert(context, isTemporary, isHardware, condition, ignoreCount, location, tid), addBreakpointDRM);

which could make use of a factory service for the insert commmand. 
I'll implement the command factory and add patches to the issue. 

Cheers,
/Tobias

________________________________

From: dsdp-dd-dev-bounces@xxxxxxxxxxx [mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx] On Behalf Of Tobias Södergren XT
Sent: den 25 februari 2008 12:48
To: Device Debugging developer discussions
Subject: [dsdp-dd-dev] Windows version of the MIBrekInsert command



Below a first attempt to provide a Windows version of the MIBreakInsert command. 
Please notice the package and the name of the class, what do you think about that strategy? 

So if this it going to be used, the question is who will be in charge of finding out which version 
of the MIBreakInsert command that should be instantiated. 

I propose a IMICommandFactoryService (or something with a better name) interface 
for an OSGi service responsible for instantiating commands. 

The different implementations of the service could be chosed by either one of or a mix of: 

o The operating system on which Eclipse is running - which version is then specified by the feature.xml 
o The dialect of the MI commands, as chosen in the debug config dialog 

I think we discussed something like this on the previous phone meeting. 

WDYT? 

/Tobias 

Index: MIWinBreakInsert.java 
=================================================================== 
RCS file: MIWinBreakInsert.java 
diff -N MIWinBreakInsert.java 
--- /dev/null   1 Jan 1970 00:00:00 -0000 
+++ MIWinBreakInsert.java       1 Jan 1970 00:00:00 -0000 
@@ -0,0 +1,42 @@ 
+package org.eclipse.dd.mi.service.command.commands.win; 
+ 
+import org.eclipse.dd.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; 
+import org.eclipse.dd.mi.service.command.commands.MIBreakInsert; 
+ 
+/** 
+ * This is a windows specific adjustment to the {@link MIBreakInsert} command. 
+ * 
+ * Usually backslashes should be escaped to double backslashes for MI commands. 
+ * In this case the path parameter 'line' should not be escaped. 
+ * 
+ * @author Tobias Sodergren 
+ * 
+ */ 
+public class MIWinBreakInsert extends MIBreakInsert { 
+ 
+       private static final String DOUBLE_BACKSLASH = "\\\\ <file://\\\\> "; //$NON-NLS-1$ 
+       private static final String SINGLE_BACKSLASH = "\\"; //$NON-NLS-1$ 
+       
+       /** 
+        * Constructor as expected from {@link MIBreakInsert}. 
+        * 
+        * @see MIBreakInsert. 
+        */ 
+       public MIWinBreakInsert(IBreakpointsTargetDMContext ctx, 
+                       boolean isTemporary, boolean isHardware, String condition, 
+                       int ignoreCount, String line, int tid) { 
+               super(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid); 
+       } 
+ 
+       /** 
+        * The back-slashes in the path for this command should not be escaped. 
+        */ 
+       @Override 
+       protected String parametersToString() { 
+               // This was simple, there's only one parameter and it is a path:line 
+               // number. 
+               String result = super.parametersToString(); 
+               return result.replace(DOUBLE_BACKSLASH, SINGLE_BACKSLASH); 
+       } 
+ 
+} 



Back to the top