summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajin2012-12-21 13:40:19 (EST)
committer Marc Khouzam2012-12-21 14:13:15 (EST)
commit2fba04a143a6d68ef0723bc876fb74c2014a7522 (patch)
treeca71bfad5b7770c20821e6f431a3bb46b2656a57
parent8ca35f737a689680b786ef35e17f1e3ab7e59a1d (diff)
downloadorg.eclipse.cdt-2fba04a143a6d68ef0723bc876fb74c2014a7522.zip
org.eclipse.cdt-2fba04a143a6d68ef0723bc876fb74c2014a7522.tar.gz
org.eclipse.cdt-2fba04a143a6d68ef0723bc876fb74c2014a7522.tar.bz2
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>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java8
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java8
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 7ce98f2..d889776 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 98bce34..f52071c 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();