mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
updateState() wrong subscript.
and new arguement to no fire events.
This commit is contained in:
parent
814246ee64
commit
21a8a0e8d8
1 changed files with 12 additions and 6 deletions
|
@ -84,14 +84,18 @@ public class CTarget implements ICDITarget {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#setCurrentThread(ICDIThread)
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#setCurrentThread(ICDIThread)
|
||||||
*/
|
*/
|
||||||
public void setCurrentThread(ICDIThread cthread) throws CDIException {
|
public void setCurrentThread(ICDIThread cthread) throws CDIException {
|
||||||
|
setCurrentThread(cthread, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentThread(ICDIThread cthread, boolean doUpdate) throws CDIException {
|
||||||
if (cthread instanceof CThread) {
|
if (cthread instanceof CThread) {
|
||||||
setCurrentThread((CThread)cthread);
|
setCurrentThread((CThread)cthread, doUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public void setCurrentThread(CThread cthread) throws CDIException {
|
public void setCurrentThread(CThread cthread, boolean doUpdate) throws CDIException {
|
||||||
session.setCurrentTarget(this);
|
session.setCurrentTarget(this);
|
||||||
int id = cthread.getId();
|
int id = cthread.getId();
|
||||||
// No need to set thread id 0, it is a dummy thread.
|
// No need to set thread id 0, it is a dummy thread.
|
||||||
|
@ -117,8 +121,10 @@ public class CTarget implements ICDITarget {
|
||||||
// Resetting threads may change the value of
|
// Resetting threads may change the value of
|
||||||
// some variables like Register. Send an update
|
// some variables like Register. Send an update
|
||||||
// To generate changeEvents.
|
// To generate changeEvents.
|
||||||
RegisterManager regMgr = session.getRegisterManager();
|
if (doUpdate) {
|
||||||
regMgr.update();
|
RegisterManager regMgr = session.getRegisterManager();
|
||||||
|
regMgr.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We should be allright now.
|
// We should be allright now.
|
||||||
|
@ -126,7 +132,7 @@ public class CTarget implements ICDITarget {
|
||||||
// thread is gone. Generate a Thread destroyed.
|
// thread is gone. Generate a Thread destroyed.
|
||||||
MISession mi = session.getMISession();
|
MISession mi = session.getMISession();
|
||||||
mi.fireEvent(new MIThreadExitEvent(id));
|
mi.fireEvent(new MIThreadExitEvent(id));
|
||||||
throw new CDIException("Thread destroyed");
|
throw new CDIException("Can not swith to thread " + id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +157,7 @@ public class CTarget implements ICDITarget {
|
||||||
for (int i = 0; i < newThreads.length; i++) {
|
for (int i = 0; i < newThreads.length; i++) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (int j = 0; oldThreads != null && j < oldThreads.length; j++) {
|
for (int j = 0; oldThreads != null && j < oldThreads.length; j++) {
|
||||||
if (newThreads[j].getId() == ((CThread)oldThreads[i]).getId()) {
|
if (newThreads[i].getId() == ((CThread)oldThreads[j]).getId()) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue