1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 236651

Poor pattern matching didn't allow output of "info thread" to be used.
This commit is contained in:
Marc Khouzam 2008-06-11 18:12:28 +00:00
parent a69b4955f0
commit 17b9861f5a

View file

@ -79,11 +79,11 @@ public class CLIInfoThreadsInfo extends MIInfo {
protected void parseThreadInfo(String str, List<ThreadInfo> info) {
// Fetch the OS ThreadId & Find the current thread
if(str.length() > 0 ){
Pattern pattern = Pattern.compile("(^\\d*|^\\*\\s*\\d*)(\\s*Thread\\s*)(\\d*)(\\s*\\(LWP\\s*)(\\d*)", Pattern.MULTILINE); //$NON-NLS-1$
Pattern pattern = Pattern.compile("(^\\*?\\s*\\d+)(\\s*Thread\\s*)(0x[0-9a-fA-F]+|-?\\d+)(\\s*\\(LWP\\s*)(\\d*)", Pattern.MULTILINE); //$NON-NLS-1$
Matcher matcher = pattern.matcher(str);
boolean isCurrentThread = false;
if (matcher.find()) {
String id = matcher.group(1);
String id = matcher.group(1).trim();
if (id.charAt(0) == '*') {
isCurrentThread = true;
id = id.substring(1).trim();