1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 378154 - Have MIThread provide thread name

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Change-Id: I913d396a33e1ad76c9e15c7ae665291ae3ab8d14
Reviewed-on: https://git.eclipse.org/r/36057
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Simon Marchi 2014-11-06 10:23:57 -05:00 committed by Marc Khouzam
parent 2add4e809f
commit 40cdeb4102

View file

@ -11,6 +11,7 @@
* John Dallaway - GDB 7.x getOsId() pattern match too restrictive (Bug 325552)
* Xavier Raynaud (Kalray) - MIThread can be overridden (Bug 429124)
* Alvaro Sanchez-Leon - Bug 451396 - Improve extensibility to process MI "-thread-info" results
* Simon Marchi (Ericsson) - Bug 378154 - Have MIThread provide thread name
*******************************************************************************/
package org.eclipse.cdt.dsf.mi.service.command.output;
@ -40,10 +41,18 @@ public class MIThread {
final private String fDetails;
final private String fState;
final private String fCore;
final private String fName;
/** @since 4.4 */
protected MIThread(String threadId, String targetId, String osId, String parentId,
MIFrame topFrame, String details, String state, String core) {
this(threadId, targetId, osId, parentId, topFrame, details, state, core, null);
}
/** @since 4.6 */
protected MIThread(String threadId, String targetId, String osId, String parentId,
MIFrame topFrame, String details, String state, String core,
String name) {
fThreadId = threadId;
fTargetId = targetId;
fOsId = osId;
@ -52,6 +61,7 @@ public class MIThread {
fDetails = details;
fState = state;
fCore = core;
fName = name;
}
public String getThreadId() { return fThreadId; }
@ -66,7 +76,10 @@ public class MIThread {
* @since 4.0
*/
public String getCore() { return fCore; }
/** @since 4.6 */
public String getName() { return fName; }
public static MIThread parse(MITuple tuple) {
MIResult[] results = tuple.getMIResults();
@ -78,6 +91,7 @@ public class MIThread {
String state = null;
String details = null;
String core = null;
String name = null;
for (int j = 0; j < results.length; j++) {
MIResult result = results[j];
@ -118,9 +132,16 @@ public class MIThread {
core = ((MIConst) val).getCString().trim();
}
}
else if (var.equals("name")) { //$NON-NLS-1$
MIValue val = results[j].getMIValue();
if (val instanceof MIConst) {
name = ((MIConst) val).getCString().trim();
}
}
}
return new MIThread(threadId, targetId, osId, parentId, topFrame, details, state, core);
return new MIThread(threadId, targetId, osId, parentId, topFrame,
details, state, core, name);
}
// Note that windows gdbs returns lower case "thread" , so the matcher needs to be case-insensitive.