1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

2004-07-09 Alain Magloire

Patch from Stefan Bylund for PR 69711
	Added support for thread name.

	* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
	* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java
	* mi/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java
This commit is contained in:
Alain Magloire 2004-07-09 17:54:39 +00:00
parent c59eba3f0e
commit d01737efb7
4 changed files with 35 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2004-07-09 Alain Magloire
Patch from Stefan Bylund for PR 69711
Added support for thread name.
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java
* mi/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java
2004-07-02 Mikhail Khodjaiants
Fix for bug 68934: Debug into dll doesn't work.

View file

@ -256,17 +256,26 @@ public class Target implements ICDITarget {
mi.postCommand(tids);
MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
int [] ids;
String[] names;
if (info == null) {
ids = new int[0];
names = new String[0];
} else {
ids = info.getThreadIds();
names = info.getThreadNames();
}
if (ids != null && ids.length > 0) {
cthreads = new Thread[ids.length];
// Ok that means it is a multiThreaded.
if (names != null && names.length == ids.length) {
for (int i = 0; i < ids.length; i++) {
cthreads[i] = new Thread(this, ids[i], names[i]);
}
} else {
for (int i = 0; i < ids.length; i++) {
cthreads[i] = new Thread(this, ids[i]);
}
}
} else {
// Provide a dummy.
cthreads = new Thread[]{new Thread(this, 0)};

View file

@ -41,6 +41,7 @@ public class Thread extends CObject implements ICDIThread {
static ICDIStackFrame[] noStack = new ICDIStackFrame[0];
int id;
String name;
ICDIStackFrame currentFrame;
List currentFrames;
int stackdepth = 0;
@ -48,8 +49,13 @@ public class Thread extends CObject implements ICDIThread {
final static int STACKFRAME_DEFAULT_DEPTH = 200;
public Thread(ICDITarget target, int threadId) {
this(target, threadId, null);
}
public Thread(ICDITarget target, int threadId, String threadName) {
super(target);
id = threadId;
name = threadName;
}
public int getId() {
@ -63,7 +69,11 @@ public class Thread extends CObject implements ICDIThread {
}
public String toString() {
return Integer.toString(id);
String str = Integer.toString(id);
if (name != null) {
str += " " + name;
}
return str;
}
public void updateState() {

View file

@ -35,6 +35,10 @@ public class MIInfoThreadsInfo extends MIInfo {
return threadIds;
}
public String[] getThreadNames() {
return null;
}
public int getCurrentThread() {
return currentThreadId;
}