Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] Patch - displaying external files with absolute paths

I made the attached changes(amongst others) to get CDT to display source
files with  absolute paths without going via the "Attach source"
requester.

More details:

http://zylin.com/pipermail/zylin-discuss_zylin.com/2004-August/000011.html

-- 
Øyvind Harboe
http://www.zylin.com

Index: CSourceLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java,v
retrieving revision 1.27
diff -u -r1.27 CSourceLocator.java
--- CSourceLocator.java	18 Jun 2004 22:17:10 -0000	1.27
+++ CSourceLocator.java	5 Aug 2004 13:06:23 -0000
@@ -10,6 +10,7 @@
  ***********************************************************************/
 package org.eclipse.cdt.debug.internal.core.sourcelookup;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.StringReader;
 import java.text.MessageFormat;
@@ -23,6 +24,8 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.TransformerException;
+
+import org.eclipse.cdt.core.resources.FileStorage;
 import org.eclipse.cdt.debug.core.CDebugCorePlugin;
 import org.eclipse.cdt.debug.core.CDebugUtils;
 import org.eclipse.cdt.debug.core.model.ICStackFrame;
@@ -40,6 +43,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.model.IPersistableSourceLocator;
@@ -143,6 +147,19 @@
 								list.add( result );
 							if ( !searchForDuplicateFiles() )
 								break;
+						}
+					}
+					
+					/* if we didn't find any source files, we'll just try to open the	
+						file as an absolute path external file*/
+					if (list.isEmpty())
+					{
+						File file;
+						file=new File(fileName);
+						if (file.isAbsolute()&&file.exists())
+						{
+							FileStorage t=new FileStorage( new Path(fileName) );
+							list.add(t);
 						}
 					}
 				}

Back to the top