diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java index 7ce98f2e180..d889776ddcd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java @@ -10,6 +10,7 @@ * Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306) * John Dallaway - GDB 7.x MI thread details field ignored (Bug 325556) * Marc Khouzam (Ericsson) - Make each thread an IDisassemblyDMContext (bug 352748) + * Andy Jin (QNX) - Not output thread osId as a string when it is null (Bug 397039) *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.service; @@ -774,12 +775,15 @@ public class GDBProcesses_7_0 extends AbstractDsfService if (getData().getThreadList().length != 0) { MIThread thread = getData().getThreadList()[0]; if (thread.getThreadId().equals(threadDmc.getId())) { - String id = thread.getOsId(); + String id = ""; //$NON-NLS-1$ + if (thread.getOsId() != null) { + id = thread.getOsId() + " "; //$NON-NLS-1$ + } // append thread details (if any) to the thread ID // as for GDB 6.x with CLIInfoThreadsInfo#getOsId() final String details = thread.getDetails(); if (details != null && details.length() > 0) { - id += " (" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + id += "(" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } threadData = new MIThreadDMData("", id); //$NON-NLS-1$ } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java index 98bce344a70..f52071c3a41 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java @@ -7,6 +7,7 @@ * * Contributors: * Ericsson - initial API and implementation + * Andy Jin (QNX) - Not output thread osId as a string when it is null (Bug 397039) *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.service; @@ -175,12 +176,15 @@ public class GDBProcesses_7_1 extends GDBProcesses_7_0 { if (getData().getThreadList().length != 0) { MIThread thread = getData().getThreadList()[0]; if (thread.getThreadId().equals(threadDmc.getId())) { - String id = thread.getOsId(); + String id = ""; //$NON-NLS-1$ + if (thread.getOsId() != null) { + id = thread.getOsId() + " "; //$NON-NLS-1$ + } // append thread details (if any) to the thread ID // as for GDB 6.x with CLIInfoThreadsInfo#getOsId() final String details = thread.getDetails(); if (details != null && details.length() > 0) { - id += " (" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + id += "(" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } String core = thread.getCore();