Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2012-01-19 22:13:36 -0500
committerMarc Khouzam2012-01-19 22:13:36 -0500
commit50640df3c04fbcf0c59873e18ddedba40e610c11 (patch)
tree4d76ff72cab8c3e794906958ed560d569b35c6a6
parentc7adafb18b44e3a7c823740329e97a7d3eebf978 (diff)
downloadorg.eclipse.cdt-50640df3c04fbcf0c59873e18ddedba40e610c11.tar.gz
org.eclipse.cdt-50640df3c04fbcf0c59873e18ddedba40e610c11.tar.xz
org.eclipse.cdt-50640df3c04fbcf0c59873e18ddedba40e610c11.zip
Bug 369168: threadOSId is not extracted for non-pthread programs
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThread.java8
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java1
2 files changed, 9 insertions, 0 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThread.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThread.java
index f718950a32..caf4351b5e 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThread.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThread.java
@@ -124,6 +124,7 @@ public class MIThread {
private static Pattern fgOsIdPattern1 = Pattern.compile("([Tt][Hh][Rr][Ee][Aa][Dd]\\s*)(0x[0-9a-fA-F]+|-?\\d+)(\\s*\\([Ll][Ww][Pp]\\s*)(\\d*)", 0); //$NON-NLS-1$
private static Pattern fgOsIdPattern2 = Pattern.compile("[Tt][Hh][Rr][Ee][Aa][Dd]\\s*\\d+\\.(\\d+)", 0); //$NON-NLS-1$
private static Pattern fgOsIdPattern3 = Pattern.compile("[Tt][Hh][Rr][Ee][Aa][Dd]\\s*(\\S+)", 0); //$NON-NLS-1$
+ private static Pattern fgOsIdPattern4 = Pattern.compile("[Pp][Rr][Oo][Cc][Ee][Ss][Ss]\\s*(\\S+)", 0); //$NON-NLS-1$
static String parseOsId(String str) {
// General format:
@@ -132,6 +133,8 @@ public class MIThread {
// "Thread 162.32942"
// ^^^^^
// "thread abc123"
+ //
+ // "process 12345" => Linux without pthread. The process as one thread, the process thread.
// ^^^^^^
// PLEASE UPDATE MIThreadTests.java IF YOU TWEAK THIS CODE
@@ -150,6 +153,11 @@ public class MIThread {
return matcher.group(1);
}
+ matcher = fgOsIdPattern4.matcher(str);
+ if (matcher.find()) {
+ return matcher.group(1);
+ }
+
return null;
}
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java
index d0bde2e256..e057709132 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java
@@ -12,6 +12,7 @@ public class MIThreadTests {
assertEquals("abc123", MIThread.parseOsId("Thread abc123"));
assertEquals("abc123", MIThread.parseOsId("thread abc123"));
assertEquals("abc123", MIThread.parseOsId("THREAD abc123"));
+ assertEquals("abc123", MIThread.parseOsId("process abc123"));
}
@Test

Back to the top