1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +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:
Simon Marchi 2014-11-13 14:25:50 -05:00 committed by Marc Khouzam
parent d317c16080
commit c6865cfb7d
2 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@
* Ericsson - initial API and implementation
* 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
* Simon Marchi (Ericsson) - Bug 378154 - Pass thread name from MIThread to the data model
*******************************************************************************/
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) {
String id = ""; //$NON-NLS-1$
if (thread.getOsId() != null) {
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
if (id.isEmpty()) id = null;
String name = thread.getName();
String core = thread.getCore();
return new MIThreadDMData_7_1("", id, //$NON-NLS-1$
core == null ? null : new String[] { core });
return new MIThreadDMData_7_1(name == null ? "" : name, id, core == null ? null : new String[] { core });
}
@DsfServiceEventHandler

View file

@ -175,8 +175,8 @@ public class GDBProcessesTest extends BaseTestCase {
Pattern pattern = Pattern.compile("\\d*", Pattern.MULTILINE); //$NON-NLS-1$
Matcher matcher = pattern.matcher(threadData.getId());
assertTrue("Thread ID is a series of number", matcher.find());
// Name is blank in case of GDB back end
assertEquals("Thread name is should have been blank for GDB Back end", "", threadData.getName());
// Check thread name
assertEquals("main thread's name is the name of the executable", EXEC_NAME, threadData.getName());
fWait.waitReset();
}