1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +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 2004-07-02 Mikhail Khodjaiants
Fix for bug 68934: Debug into dll doesn't work. Fix for bug 68934: Debug into dll doesn't work.

View file

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

View file

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

View file

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