mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +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:
parent
2add4e809f
commit
40cdeb4102
1 changed files with 24 additions and 3 deletions
|
@ -11,6 +11,7 @@
|
||||||
* John Dallaway - GDB 7.x getOsId() pattern match too restrictive (Bug 325552)
|
* John Dallaway - GDB 7.x getOsId() pattern match too restrictive (Bug 325552)
|
||||||
* Xavier Raynaud (Kalray) - MIThread can be overridden (Bug 429124)
|
* Xavier Raynaud (Kalray) - MIThread can be overridden (Bug 429124)
|
||||||
* Alvaro Sanchez-Leon - Bug 451396 - Improve extensibility to process MI "-thread-info" results
|
* 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;
|
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||||
|
|
||||||
|
@ -40,10 +41,18 @@ public class MIThread {
|
||||||
final private String fDetails;
|
final private String fDetails;
|
||||||
final private String fState;
|
final private String fState;
|
||||||
final private String fCore;
|
final private String fCore;
|
||||||
|
final private String fName;
|
||||||
|
|
||||||
/** @since 4.4 */
|
/** @since 4.4 */
|
||||||
protected MIThread(String threadId, String targetId, String osId, String parentId,
|
protected MIThread(String threadId, String targetId, String osId, String parentId,
|
||||||
MIFrame topFrame, String details, String state, String core) {
|
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;
|
fThreadId = threadId;
|
||||||
fTargetId = targetId;
|
fTargetId = targetId;
|
||||||
fOsId = osId;
|
fOsId = osId;
|
||||||
|
@ -52,6 +61,7 @@ public class MIThread {
|
||||||
fDetails = details;
|
fDetails = details;
|
||||||
fState = state;
|
fState = state;
|
||||||
fCore = core;
|
fCore = core;
|
||||||
|
fName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getThreadId() { return fThreadId; }
|
public String getThreadId() { return fThreadId; }
|
||||||
|
@ -67,6 +77,9 @@ public class MIThread {
|
||||||
*/
|
*/
|
||||||
public String getCore() { return fCore; }
|
public String getCore() { return fCore; }
|
||||||
|
|
||||||
|
/** @since 4.6 */
|
||||||
|
public String getName() { return fName; }
|
||||||
|
|
||||||
public static MIThread parse(MITuple tuple) {
|
public static MIThread parse(MITuple tuple) {
|
||||||
MIResult[] results = tuple.getMIResults();
|
MIResult[] results = tuple.getMIResults();
|
||||||
|
|
||||||
|
@ -78,6 +91,7 @@ public class MIThread {
|
||||||
String state = null;
|
String state = null;
|
||||||
String details = null;
|
String details = null;
|
||||||
String core = null;
|
String core = null;
|
||||||
|
String name = null;
|
||||||
|
|
||||||
for (int j = 0; j < results.length; j++) {
|
for (int j = 0; j < results.length; j++) {
|
||||||
MIResult result = results[j];
|
MIResult result = results[j];
|
||||||
|
@ -118,9 +132,16 @@ public class MIThread {
|
||||||
core = ((MIConst) val).getCString().trim();
|
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.
|
// Note that windows gdbs returns lower case "thread" , so the matcher needs to be case-insensitive.
|
||||||
|
|
Loading…
Add table
Reference in a new issue