mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 325552: GDB 7.x getOsId() pattern match too restrictive (DSF)
This commit is contained in:
parent
850511bfd3
commit
7585651f46
1 changed files with 16 additions and 5 deletions
|
@ -114,13 +114,19 @@ public class MIThread {
|
|||
return new MIThread(threadId, targetId, osId, parentId, topFrame, details, state, core);
|
||||
}
|
||||
|
||||
private static Pattern fgOsIdPattern1 = Pattern.compile("(Thread\\s*)(0x[0-9a-fA-F]+|-?\\d+)(\\s*\\(LWP\\s*)(\\d*)", 0); //$NON-NLS-1$
|
||||
private static Pattern fgOsIdPattern2 = Pattern.compile("Thread\\s*\\d+\\.(\\d+)", 0); //$NON-NLS-1$
|
||||
|
||||
// Note that windows gdbs returns lower case "thread" , so the matcher needs to be case-insensitive.
|
||||
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 String parseOsId(String str) {
|
||||
// General format:
|
||||
// "Thread 0xb7c8ab90 (LWP 7010)"
|
||||
// ^^^^
|
||||
// "Thread 162.32942"
|
||||
// ^^^^^
|
||||
// "thread abc123"
|
||||
// ^^^^^^
|
||||
|
||||
Matcher matcher = fgOsIdPattern1.matcher(str);
|
||||
if (matcher.find()) {
|
||||
|
@ -132,15 +138,20 @@ public class MIThread {
|
|||
return matcher.group(1);
|
||||
}
|
||||
|
||||
matcher = fgOsIdPattern3.matcher(str);
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Pattern fgIdPattern = Pattern.compile("Thread\\s*(\\d+)\\.\\d+", 0); //$NON-NLS-1$
|
||||
private static Pattern fgIdPattern = Pattern.compile("[Tt][Hh][Rr][Ee][Aa][Dd]\\s*(\\d+)\\.\\d+", 0); //$NON-NLS-1$
|
||||
|
||||
private static String parseParentId(String str) {
|
||||
// General format:
|
||||
// "Thread 0xb7c8ab90 (LWP 7010)"
|
||||
// "Thread 162.32942"
|
||||
// ^^^
|
||||
|
||||
Matcher matcher = fgIdPattern.matcher(str);
|
||||
if (matcher.find()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue