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:
parent
a69b4955f0
commit
17b9861f5a
1 changed files with 2 additions and 2 deletions
|
@ -79,11 +79,11 @@ public class CLIInfoThreadsInfo extends MIInfo {
|
||||||
protected void parseThreadInfo(String str, List<ThreadInfo> info) {
|
protected void parseThreadInfo(String str, List<ThreadInfo> info) {
|
||||||
// Fetch the OS ThreadId & Find the current thread
|
// Fetch the OS ThreadId & Find the current thread
|
||||||
if(str.length() > 0 ){
|
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);
|
Matcher matcher = pattern.matcher(str);
|
||||||
boolean isCurrentThread = false;
|
boolean isCurrentThread = false;
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
String id = matcher.group(1);
|
String id = matcher.group(1).trim();
|
||||||
if (id.charAt(0) == '*') {
|
if (id.charAt(0) == '*') {
|
||||||
isCurrentThread = true;
|
isCurrentThread = true;
|
||||||
id = id.substring(1).trim();
|
id = id.substring(1).trim();
|
||||||
|
|
Loading…
Add table
Reference in a new issue