Permalink
Browse files

remove workspace path from locations

  • Loading branch information...
1 parent 1661442 commit bd384b87321d90c8fe3a477bc02a5772fb6c3ace @JPMoresmau committed Oct 23, 2012
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -103,6 +103,7 @@ public void setLocation( final String location ) {
charEnd = -1;
} else {
try {
+ name=removeFilePrefix( location);
hasVariables=true;
// Get file name
String fname=unprocessedFileName;
@@ -138,6 +139,19 @@ public void setLocation( final String location ) {
DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent( this, DebugEvent.CHANGE, DebugEvent.CONTENT )});
}
+ private String removeFilePrefix(final String fullLocation) throws CoreException{
+ String ret=fullLocation;
+ if (fullLocation!=null && fullLocation.length()>0){
+ IProject p=getProject();
+ String projectLocation=p.getLocation().toOSString();
+ int ix=fullLocation.indexOf( projectLocation );
+ if(ix>-1){
+ ret=fullLocation.substring( 0,ix )+fullLocation.substring( ix+projectLocation.length()-p.getName().length() );
+ }
+ }
+ return ret;
+ }
+
public void setHistoryLocation( final String location ) {
name=null;
lineNumber=-1;
@@ -163,7 +177,7 @@ public void setHistoryLocation( final String location ) {
endLineNumber=Integer.parseInt( m.group(6) );
unprocessedFileName=m.group( 3 );
tmpCharStart=Integer.parseInt(m.group(5));
- tmpCharEnd=Integer.parseInt(m.group(6));
+ tmpCharEnd=Integer.parseInt(m.group(7));
} else {
// It means there was an error
endLineNumber = -1;
@@ -180,7 +194,7 @@ public void setHistoryLocation( final String location ) {
hasVariables=idx==1;
name=location;
int ix=name.indexOf( ':' );
- name=name.substring( ix+1 ).trim();
+ name=removeFilePrefix( name.substring( ix+1 ).trim());
// Get file name
String fname=unprocessedFileName;
IProject p = getProject();
@@ -212,7 +226,7 @@ public void setHistoryLocation( final String location ) {
}
}
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent( this, DebugEvent.CHANGE, DebugEvent.CONTENT )});
+ DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent( thread, DebugEvent.CHANGE, DebugEvent.CONTENT )});
}

0 comments on commit bd384b8

Please sign in to comment.