Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] mapped remote breakpoints working

alex -

  sounds good to me - i've committed the patch along with some fixes to the path mapper to properly handle resources that were retrieved via the dbgp 'source' command.

On Tue, Jul 1, 2008 at 3:34 AM, Alex Panchenko <alex@xxxxxxxxx> wrote:
Hi Jae,

It's great you have implemented this feature!

I have extracted interface from the breakpoint path mapper and modified the way to pass it to the breakpoint manager - it is via constructor now.
Also IMHO it would be better to move this functionality to the descendant of the ScriptDebugTarget - see the attached patch.
That way it will be used only when it is required.
If it is OK with you - feel free to commit it.

Thanks,
Alex


Jae Gangemi wrote:
hello all -

 good news everyone - think futurama ;) - i've figured out a way to handle the remote breakpoint mapping issues and have committed the required changes.

 i've created a path mapper that the ScriptBreakpointManager uses to reverse map the breakpoint paths based on the remoteWorkingDir that has been set right before sending them over to the engine. in some cases of embedded application debugging, it may be necessary to strip the source folders off the path as well, so an option has been added to the remote launch tab to allow for this.

 let me know if you have problems/questions!

--
-jae
------------------------------------------------------------------------

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
 

### Eclipse Workspace Patch 1.0
#P org.eclipse.dltk.debug
Index: src/org/eclipse/dltk/internal/debug/core/model/ScriptDebugTarget.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.dltk/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptDebugTarget.java,v
retrieving revision 1.32
diff -u -r1.32 ScriptDebugTarget.java
--- src/org/eclipse/dltk/internal/debug/core/model/ScriptDebugTarget.java       1 Jul 2008 07:27:35 -0000       1.32
+++ src/org/eclipse/dltk/internal/debug/core/model/ScriptDebugTarget.java       1 Jul 2008 07:29:48 -0000
@@ -46,8 +46,6 @@
               IScriptDebugTarget, IScriptThreadManagerListener {

       private static final String LAUNCH_CONFIGURATION_ATTR_PROJECT = "project"; //$NON-NLS-1$
-       private static final String LAUNCH_CONFIGURATION_ATTR_REMOTE_WORKING_DIR = "remoteWorkingDir";
-       private static final String LAUNCH_CONFIGURATION_ATTR_STRIP_SRC_FOLDERS = "stripSourceFolders";
       private static final String LAUNCH_CONFIGURATION_ATTR_BREAK_ON_FIRST_LINE = "enableBreakOnFirstLine"; //$NON-NLS-1$

       private static final int THREAD_TERMINATION_TIMEOUT = 5000; // 5 seconds
@@ -327,26 +325,8 @@
               }
       }

-       private IScriptBreakpointPathMapper createPathMapper() {
-               String remoteWorkingDir = null;
-               boolean stripSrcFolders = false;
-
-               try {
-                       remoteWorkingDir = launch.getLaunchConfiguration().getAttribute(
-                                       LAUNCH_CONFIGURATION_ATTR_REMOTE_WORKING_DIR, "");
-               } catch (CoreException e) {
-                       DLTKDebugPlugin.log(e);
-               }
-
-               try {
-                       stripSrcFolders = launch.getLaunchConfiguration().getAttribute(
-                                       LAUNCH_CONFIGURATION_ATTR_STRIP_SRC_FOLDERS, false);
-               } catch (CoreException e) {
-                       DLTKDebugPlugin.log(e);
-               }
-
-               return new ScriptBreakpointPathMapper(getScriptProject(),
-                               remoteWorkingDir, stripSrcFolders);
+       protected IScriptBreakpointPathMapper createPathMapper() {
+               return new NopScriptbreakpointPathMapper();
       }

       public void allThreadsTerminated() {
Index: src/org/eclipse/dltk/internal/debug/core/model/RemoteScriptDebugTarget.java
===================================================================
RCS file: src/org/eclipse/dltk/internal/debug/core/model/RemoteScriptDebugTarget.java
diff -N src/org/eclipse/dltk/internal/debug/core/model/RemoteScriptDebugTarget.java
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/dltk/internal/debug/core/model/RemoteScriptDebugTarget.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,65 @@
+package org.eclipse.dltk.internal.debug.core.model;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.dltk.debug.core.DLTKDebugPlugin;
+import org.eclipse.dltk.debug.core.IDbgpService;
+import org.eclipse.dltk.debug.core.IDebugOptions;
+
+public class RemoteScriptDebugTarget extends ScriptDebugTarget {
+
+       private static final String LAUNCH_CONFIGURATION_ATTR_REMOTE_WORKING_DIR = "remoteWorkingDir"; //$NON-NLS-1$
+       private static final String LAUNCH_CONFIGURATION_ATTR_STRIP_SRC_FOLDERS = "stripSourceFolders"; //$NON-NLS-1$
+
+       /**
+        * @param modelId
+        * @param dbgpService
+        * @param sessionId
+        * @param launch
+        * @param process
+        */
+       public RemoteScriptDebugTarget(String modelId, IDbgpService dbgpService,
+                       String sessionId, ILaunch launch, IProcess process) {
+               super(modelId, dbgpService, sessionId, launch, process);
+       }
+
+       /**
+        * @param modelId
+        * @param dbgpService
+        * @param sessionId
+        * @param launch
+        * @param process
+        * @param options
+        */
+       public RemoteScriptDebugTarget(String modelId, IDbgpService dbgpService,
+                       String sessionId, ILaunch launch, IProcess process,
+                       IDebugOptions options) {
+               super(modelId, dbgpService, sessionId, launch, process, options);
+       }
+
+       protected IScriptBreakpointPathMapper createPathMapper() {
+               String remoteWorkingDir = null;
+               boolean stripSrcFolders = false;
+
+               try {
+                       remoteWorkingDir = getLaunch().getLaunchConfiguration()
+                                       .getAttribute(LAUNCH_CONFIGURATION_ATTR_REMOTE_WORKING_DIR,
+                                                       ""); //$NON-NLS-1$
+               } catch (CoreException e) {
+                       DLTKDebugPlugin.log(e);
+               }
+
+               try {
+                       stripSrcFolders = getLaunch().getLaunchConfiguration()
+                                       .getAttribute(LAUNCH_CONFIGURATION_ATTR_STRIP_SRC_FOLDERS,
+                                                       false);
+               } catch (CoreException e) {
+                       DLTKDebugPlugin.log(e);
+               }
+
+               return new ScriptBreakpointPathMapper(getScriptProject(),
+                               remoteWorkingDir, stripSrcFolders);
+       }
+
+}
#P org.eclipse.dltk.launching
Index: src/org/eclipse/dltk/launching/RemoteDebuggingEngineRunner.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.dltk/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/launching/RemoteDebuggingEngineRunner.java,v
retrieving revision 1.7
diff -u -r1.7 RemoteDebuggingEngineRunner.java
--- src/org/eclipse/dltk/launching/RemoteDebuggingEngineRunner.java     21 Apr 2008 10:24:29 -0000      1.7
+++ src/org/eclipse/dltk/launching/RemoteDebuggingEngineRunner.java     1 Jul 2008 07:29:50 -0000
@@ -5,6 +5,9 @@
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.dltk.core.PreferencesLookupDelegate;
+import org.eclipse.dltk.debug.core.IDbgpService;
+import org.eclipse.dltk.debug.core.model.IScriptDebugTarget;
+import org.eclipse.dltk.internal.debug.core.model.RemoteScriptDebugTarget;

 public abstract class RemoteDebuggingEngineRunner extends DebuggingEngineRunner {

@@ -12,6 +15,12 @@
               super(install);
       }

+       protected IScriptDebugTarget createDebugTarget(ILaunch launch,
+                       IDbgpService dbgpService) throws CoreException {
+               return new RemoteScriptDebugTarget(getDebugModelId(), dbgpService,
+                               getSessionId(launch.getLaunchConfiguration()), launch, null);
+       }
+
       /*
        * @see org.eclipse.dltk.launching.DebuggingEngineRunner#getSessionId(org.eclipse.debug.core.ILaunchConfiguration)
        */

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

Back to the top