11/*******************************************************************************
2- * Copyright (c) 2008, 2014 Ericsson and others.
2+ * Copyright (c) 2008, 2026 Ericsson and others.
33 *
44 * This program and the accompanying materials
55 * are made available under the terms of the Eclipse Public License 2.0
1515 * Xavier Raynaud (Kalray) - MIThread can be overridden (Bug 429124)
1616 * Alvaro Sanchez-Leon - Bug 451396 - Improve extensibility to process MI "-thread-info" results
1717 * Simon Marchi (Ericsson) - Bug 378154 - Have MIThread provide thread name
18+ * John Dallaway - Accommodate decimal parent ID with hex OS ID (#1421)
1819 *******************************************************************************/
1920package org .eclipse .cdt .dsf .mi .service .command .output ;
2021
@@ -166,7 +167,8 @@ public static MIThread parse(MITuple tuple) {
166167 // Note that windows gdbs returns lower case "thread" , so the matcher needs to be case-insensitive.
167168 private static Pattern fgOsIdPattern1 = Pattern
168169 .compile ("([Tt][Hh][Rr][Ee][Aa][Dd]\\ s*)(0x[0-9a-fA-F]+|-?\\ d+)(\\ s*\\ ([Ll][Ww][Pp]\\ s*)(\\ d*)" , 0 ); //$NON-NLS-1$
169- private static Pattern fgOsIdPattern2 = Pattern .compile ("[Tt][Hh][Rr][Ee][Aa][Dd]\\ s*\\ d+\\ .(\\ d+)" , 0 ); //$NON-NLS-1$
170+ private static Pattern fgOsIdPattern2 = Pattern .compile ("[Tt][Hh][Rr][Ee][Aa][Dd]\\ s*\\ d+\\ .(0x[0-9a-fA-F]+|\\ d+)" , //$NON-NLS-1$
171+ 0 );
170172 private static Pattern fgOsIdPattern3 = Pattern .compile ("[Tt][Hh][Rr][Ee][Aa][Dd]\\ s*(\\ S+)" , 0 ); //$NON-NLS-1$
171173 private static Pattern fgOsIdPattern4 = Pattern .compile ("[Pp][Rr][Oo][Cc][Ee][Ss][Ss]\\ s*(\\ S+)" , 0 ); //$NON-NLS-1$
172174
@@ -177,7 +179,7 @@ protected static String parseOsId(String str) {
177179 // General format:
178180 // "Thread 0xb7c8ab90 (LWP 7010)"
179181 // ^^^^
180- // "Thread 162.32942"
182+ // "Thread 162.32942" => an integer in decimal or 0x hex notation
181183 // ^^^^^
182184 // "thread abc123"
183185 //
@@ -208,7 +210,8 @@ protected static String parseOsId(String str) {
208210 return null ;
209211 }
210212
211- private static Pattern fgIdPattern = Pattern .compile ("[Tt][Hh][Rr][Ee][Aa][Dd]\\ s*(\\ d+)\\ .\\ d+" , 0 ); //$NON-NLS-1$
213+ private static Pattern fgIdPattern = Pattern .compile ("[Tt][Hh][Rr][Ee][Aa][Dd]\\ s*(\\ d+)\\ .(0x[0-9a-fA-F]+|\\ d+)" , //$NON-NLS-1$
214+ 0 );
212215
213216 /**
214217 * This is used to parse the same ID fed to {@link #parseOsId(String)}. The
0 commit comments