From 17b9861f5a12d2d7bec4aec83f79ae879317bef7 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 11 Jun 2008 18:12:28 +0000 Subject: [PATCH] Bug 236651 Poor pattern matching didn't allow output of "info thread" to be used. --- .../dd/mi/service/command/output/CLIInfoThreadsInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/CLIInfoThreadsInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/CLIInfoThreadsInfo.java index 72dee49824f..9a4612bb141 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/CLIInfoThreadsInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/CLIInfoThreadsInfo.java @@ -79,11 +79,11 @@ public class CLIInfoThreadsInfo extends MIInfo { protected void parseThreadInfo(String str, List 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();