1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

2005-01-10 Alain Magloire

Fix for PR 82506
	* mi/org/eclipse/cdt/debug/mi/core/MISession.java
	* mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java
This commit is contained in:
Alain Magloire 2005-01-10 20:33:50 +00:00
parent 46c23f102c
commit 0d121179f8
3 changed files with 31 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-01-10 Alain Magloire
Fix for PR 82506
* mi/org/eclipse/cdt/debug/mi/core/MISession.java
* mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java
2004-12-20 Alain Magloire
Fix for PR 81019 for MacOsX
* mi/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java

View file

@ -175,7 +175,7 @@ public class MISession extends Observable {
MIGDBShowInfo infoPrompt = prompt.getMIGDBShowInfo();
String value = infoPrompt.getValue();
if (value != null && value.length() > 0) {
parser.primaryPrompt = value.trim();
parser.cliPrompt = value.trim();
}
} catch (MIException exc) {
// Kill the Transmition thread.

View file

@ -91,6 +91,7 @@ import java.util.StringTokenizer;
public class MIParser {
public String primaryPrompt = "(gdb)"; //$NON-NLS-1$
public String cliPrompt = primaryPrompt;
public String secondaryPrompt = ">"; //$NON-NLS-1$
/**
@ -130,7 +131,7 @@ public class MIParser {
if (token.charAt(0) == '^') {
token.deleteCharAt(0);
rr = processMIResultRecord(token, id);
} else if (token.toString().startsWith(primaryPrompt)) {
} else if (startsWith(token, primaryPrompt)) {
//break; // Do nothing.
} else {
MIOOBRecord band = processMIOOBRecord(token, id);
@ -414,6 +415,29 @@ public class MIParser {
return sb.toString();
}
/**
* Tests if this string starts with the specified prefix beginning
* a specified index.
*
* @param value the string.
* @param prefix the prefix.
* @return <code>true</code> if prefix starts value.
*/
public boolean startsWith(StringBuffer value, String prefix) {
int vlen = value.length();
int plen = prefix.length();
if (vlen < plen) {
return false;
}
for (int i = 0; i < plen; i++) {
if (value.charAt(i) != prefix.charAt(i)) {
return false;
}
}
return true;
}
/**
* Fast String Buffer class. MIParser does a lot
* of deleting off the front of a string, that's clearly