diff options
author | ajin | 2012-12-21 18:40:19 +0000 |
---|---|---|
committer | Marc Khouzam | 2012-12-21 19:11:41 +0000 |
commit | b1311abea792f952fef973f2437e3f934c92c30a (patch) | |
tree | 39275c82609c37ab452c987fc7045db936460e99 | |
parent | a2570cdd212ffeb87cddeb691b3562e5f2b3841f (diff) | |
download | org.eclipse.cdt-b1311abea792f952fef973f2437e3f934c92c30a.tar.gz org.eclipse.cdt-b1311abea792f952fef973f2437e3f934c92c30a.tar.xz org.eclipse.cdt-b1311abea792f952fef973f2437e3f934c92c30a.zip |
Bug 397039
For some gdb implementations the "osId" cannot be retrieved because
the "TreadIDs" output does not follow the Linux gdb format. Catch the
"null" return and not output it as a string.
Change-Id: I8d4b711d935c5d81d1e8ff3adb0de5e3fe220061
Reviewed-on: https://git.eclipse.org/r/9334
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2 files changed, 12 insertions, 4 deletions
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(); |