mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 15:05:36 +02:00
[358301] [DSTORE] Hang during debug source look up
This commit is contained in:
parent
e8bd883e79
commit
b129a7fed3
4 changed files with 70 additions and 8 deletions
|
@ -22,6 +22,7 @@
|
|||
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
|
||||
* David McKnight (IBM) - [153635] [dstore-linux] dangling symbolic links are not classified properly
|
||||
* David McKnight (IBM) - [350581] [dstore] FileClassifier should default to English
|
||||
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
@ -272,7 +273,10 @@ public class FileClassifier extends SecuredThread
|
|||
super.run();
|
||||
if (!_systemSupportsClassify)
|
||||
return;
|
||||
init();
|
||||
|
||||
try {
|
||||
init();
|
||||
|
||||
|
||||
// get full path
|
||||
String filePath = null;
|
||||
|
@ -337,6 +341,10 @@ public class FileClassifier extends SecuredThread
|
|||
}
|
||||
_dataStore.disconnectObject(_subject);
|
||||
_dataStore.refresh(_subject);
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -656,6 +664,9 @@ public class FileClassifier extends SecuredThread
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
@ -663,6 +674,9 @@ public class FileClassifier extends SecuredThread
|
|||
available = stream.available();
|
||||
}
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
@ -728,8 +742,14 @@ public class FileClassifier extends SecuredThread
|
|||
envVars = new String[] {langVar};
|
||||
}
|
||||
|
||||
// run command with the working directory being the parent file
|
||||
Process theProcess = Runtime.getRuntime().exec(args, envVars, parentFile);
|
||||
// run command with the working directory being the parent file
|
||||
Process theProcess = null;
|
||||
try {
|
||||
theProcess = Runtime.getRuntime().exec(args, envVars, parentFile);
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
BufferedReader reader = null;
|
||||
DataInputStream stream = null;
|
||||
|
@ -755,6 +775,9 @@ public class FileClassifier extends SecuredThread
|
|||
else
|
||||
line = readLine(stream, _specialEncoding);//reader.readLine();
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
|
@ -911,6 +934,9 @@ public class FileClassifier extends SecuredThread
|
|||
else
|
||||
line = readLine(stream, _specialEncoding);
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
@ -954,6 +980,9 @@ public class FileClassifier extends SecuredThread
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
@ -1069,4 +1098,13 @@ public class FileClassifier extends SecuredThread
|
|||
// TODO: log error
|
||||
}
|
||||
}
|
||||
|
||||
public void start(){
|
||||
try {
|
||||
super.start();
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
|
||||
* David McKnight (IBM) - [251650] [dstore] Multiple copies of symbolic link file show in Table view
|
||||
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
||||
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
|
||||
*******************************************************************************/
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
||||
|
@ -369,7 +370,11 @@ public class FileQueryThread extends QueryThread
|
|||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME,
|
||||
"createDataElement failed with exception - isFile ", e, _dataStore); //$NON-NLS-1$
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2007, 2011 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,6 +12,7 @@
|
|||
* Contributors:
|
||||
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
|
||||
* Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers
|
||||
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
|
||||
*******************************************************************************/
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
||||
|
@ -113,6 +114,7 @@ public class QueryThread extends SecuredThread implements ICancellableHandler {
|
|||
else
|
||||
expandedSize = size;
|
||||
|
||||
try {
|
||||
buffer.append(version).append(IServiceConstants.TOKEN_SEPARATOR).append(date).append(
|
||||
IServiceConstants.TOKEN_SEPARATOR).append(size).append(IServiceConstants.TOKEN_SEPARATOR);
|
||||
buffer.append(hidden).append(IServiceConstants.TOKEN_SEPARATOR).append(canWrite).append(
|
||||
|
@ -126,7 +128,10 @@ public class QueryThread extends SecuredThread implements ICancellableHandler {
|
|||
IServiceConstants.TOKEN_SEPARATOR);
|
||||
buffer.append(compressionRatio).append(IServiceConstants.TOKEN_SEPARATOR).append(
|
||||
expandedSize);
|
||||
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
String buf = buffer.toString();
|
||||
return buf;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* David McKnight (IBM) - [299568] Remote search only shows result in the symbolic linked file
|
||||
* David McKnight (IBM] - [330989] [dstore] OutOfMemoryError occurs when searching for a text in a large remote file
|
||||
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
|
||||
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
@ -35,6 +36,7 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.dstore.core.model.DE;
|
||||
import org.eclipse.dstore.core.model.DataElement;
|
||||
|
@ -56,6 +58,7 @@ import org.eclipse.rse.services.clientserver.archiveutils.VirtualChild;
|
|||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||
import org.eclipse.rse.services.clientserver.search.SystemSearchFileNameMatcher;
|
||||
import org.eclipse.rse.services.clientserver.search.SystemSearchLineMatch;
|
||||
import org.eclipse.rse.services.clientserver.search.SystemSearchMatch;
|
||||
import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatchLocator;
|
||||
import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatcher;
|
||||
|
||||
|
@ -504,11 +507,22 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
|
|||
|
||||
for (int i = 0; i < lineMatches.length; i++) {
|
||||
match = lineMatches[i];
|
||||
|
||||
DataElement obj = _dataStore.createObject(deObj, _deGrep, match.getLine(), absPath);
|
||||
obj.setAttribute(DE.A_SOURCE, obj.getSource() + ':'+ match.getLineNumber());
|
||||
|
||||
String sourceString = obj.getSource() + ':'+ match.getLineNumber();
|
||||
|
||||
Iterator iter = match.getMatches();
|
||||
StringBuffer offsets = new StringBuffer();
|
||||
while (iter.hasNext()){
|
||||
SystemSearchMatch m = (SystemSearchMatch)iter.next();
|
||||
int start = m.getStartOffset();
|
||||
int end = m.getEndOffset();
|
||||
offsets.append("(" + start + "," + end + ")");
|
||||
}
|
||||
obj.setAttribute(DE.A_SOURCE, sourceString + offsets.toString());
|
||||
}
|
||||
_dataStore.disconnectObjects(deObj);
|
||||
_dataStore.refresh(deObj);
|
||||
}
|
||||
|
||||
public void checkAndClearupMemory()
|
||||
|
|
Loading…
Add table
Reference in a new issue