X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java index db66060..e93a7f1 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java @@ -15,6 +15,7 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.SocketTimeoutException; import java.util.Map; +import java.util.Vector; import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint; import net.sourceforge.phpdt.internal.debug.core.model.PHPDebugTarget; @@ -207,7 +208,11 @@ public class PHPDBGProxy { * */ private String MapPath (PHPLineBreakpoint phpLBP) { - IPath filename; + IPath filename; + IPath remotePath; + IPath newpath; + IPath localPath; + String local; if (remote) { filename = phpLBP.getMarker().getResource().getProjectRelativePath(); @@ -230,14 +235,43 @@ public class PHPDBGProxy { } } - if (pathtranslation && remote) { - if (remoteSourcePath.toString ().substring (0, 1).equals ("/")) { - path = path.replace ('\\', '/'); - } - else { - path = path.replace ('/', '\\'); + if (remoteSourcePath.isEmpty ()) { + if ((pathmap != null) && remote) { + java.util.Iterator iterator = pathmap.keySet().iterator(); + + while (iterator.hasNext ()) { + local = (String) iterator.next (); // Get the local/client side path of the mapping + remotePath = new Path ((String) pathmap.get (local)); // Get the remote/server side path of the mapping + localPath = new Path (local); // Get the remote/server side path of the mapping + + if (localPath.isPrefixOf (filename)) { // Starts the remote/server side file path with the remote/server side mapping path + // dann prefix abhängen und den remote path davorhägen + newpath = filename.removeFirstSegments (localPath.matchingFirstSegments (filename)); + newpath = remotePath.append (newpath); + path = newpath.toString (); + + if (path.substring (0, 1).equals ("/")) { + path = path.replace ('\\', '/'); + } + else { + path = path.replace ('/', '\\'); + } + + return path; + } + } } - } + } + else { + if (pathtranslation && remote) { + if (remoteSourcePath.toString ().substring (0, 1).equals ("/")) { + path = path.replace ('\\', '/'); + } + else { + path = path.replace ('/', '\\'); + } + } + } return path; } @@ -367,9 +401,9 @@ public class PHPDBGProxy { * It reads the variables from PHP via DBG * * @param frame The stackframe which wants the variables. - * @return The array of variables for this stackframe. + * @return The list of variables for this stackframe. */ - public PHPVariable[] readVariables (PHPStackFrame frame) { + public Vector readVariables (PHPStackFrame frame) { try { return DBGInt.getVariables (frame); // Get the variables from DBG interface } catch (IOException ioex) {