mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 378154 - Display thread name reported by GDB in Debug view
Change-Id: I3e04a56d218fdb2f189c06968c4f2d2671327838 Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/36435 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
d317c16080
commit
c6865cfb7d
2 changed files with 7 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
* Ericsson - initial API and implementation
|
* Ericsson - initial API and implementation
|
||||||
* Andy Jin (QNX) - Not output thread osId as a string when it is null (Bug 397039)
|
* Andy Jin (QNX) - Not output thread osId as a string when it is null (Bug 397039)
|
||||||
* 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 - Pass thread name from MIThread to the data model
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.service;
|
package org.eclipse.cdt.dsf.gdb.service;
|
||||||
|
|
||||||
|
@ -200,6 +201,7 @@ public class GDBProcesses_7_1 extends GDBProcesses_7_0 {
|
||||||
*/
|
*/
|
||||||
protected IGdbThreadDMData createThreadDMData(MIThread thread) {
|
protected IGdbThreadDMData createThreadDMData(MIThread thread) {
|
||||||
String id = ""; //$NON-NLS-1$
|
String id = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
if (thread.getOsId() != null) {
|
if (thread.getOsId() != null) {
|
||||||
id = thread.getOsId();
|
id = thread.getOsId();
|
||||||
}
|
}
|
||||||
|
@ -213,9 +215,9 @@ public class GDBProcesses_7_1 extends GDBProcesses_7_0 {
|
||||||
// We must indicate and empty id by using null
|
// We must indicate and empty id by using null
|
||||||
if (id.isEmpty()) id = null;
|
if (id.isEmpty()) id = null;
|
||||||
|
|
||||||
|
String name = thread.getName();
|
||||||
String core = thread.getCore();
|
String core = thread.getCore();
|
||||||
return new MIThreadDMData_7_1("", id, //$NON-NLS-1$
|
return new MIThreadDMData_7_1(name == null ? "" : name, id, core == null ? null : new String[] { core });
|
||||||
core == null ? null : new String[] { core });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
|
|
|
@ -175,8 +175,8 @@ public class GDBProcessesTest extends BaseTestCase {
|
||||||
Pattern pattern = Pattern.compile("\\d*", Pattern.MULTILINE); //$NON-NLS-1$
|
Pattern pattern = Pattern.compile("\\d*", Pattern.MULTILINE); //$NON-NLS-1$
|
||||||
Matcher matcher = pattern.matcher(threadData.getId());
|
Matcher matcher = pattern.matcher(threadData.getId());
|
||||||
assertTrue("Thread ID is a series of number", matcher.find());
|
assertTrue("Thread ID is a series of number", matcher.find());
|
||||||
// Name is blank in case of GDB back end
|
// Check thread name
|
||||||
assertEquals("Thread name is should have been blank for GDB Back end", "", threadData.getName());
|
assertEquals("main thread's name is the name of the executable", EXEC_NAME, threadData.getName());
|
||||||
|
|
||||||
fWait.waitReset();
|
fWait.waitReset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue