1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

The registers with errors shouldn't be disposed when the target is suspended. Added synchronization to the "getRegisters" method.

This commit is contained in:
Mikhail Khodjaiants 2005-07-29 19:24:19 +00:00
parent a644748bb8
commit c16a83969c
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2005-07-29 Mikhail Khodjaiants
The registers with errors shouldn't be disposed when the target is suspended.
Added synchronization to the "getRegisters" method.
* CRegisterGroup.java
2005-07-28 Mikhail Khodjaiants
Bug 104421: Register view can not show correct value when switch between different thread or stack frame.
* ICDIRegister.java

View file

@ -80,9 +80,13 @@ public class CRegisterGroup extends CDebugElement implements IPersistableRegiste
if ( fDisposed )
return new IRegister[0];
if ( fRegisters == null ) {
fRegisters = new IRegister[fRegisterDescriptors.length];
for( int i = 0; i < fRegisters.length; ++i ) {
fRegisters[i] = new CRegister( this, fRegisterDescriptors[i] );
synchronized( this ) {
if ( fRegisters == null ) {
fRegisters = new IRegister[fRegisterDescriptors.length];
for( int i = 0; i < fRegisters.length; ++i ) {
fRegisters[i] = new CRegister( this, fRegisterDescriptors[i] );
}
}
}
}
return fRegisters;
@ -101,13 +105,12 @@ public class CRegisterGroup extends CDebugElement implements IPersistableRegiste
}
public void targetSuspended() {
if (fRegisters == null) {
if ( fRegisters == null ) {
return;
}
for ( int i = 0; i < fRegisters.length; ++i ) {
if ( fRegisters[i] != null && ((CRegister)fRegisters[i]).hasErrors() ) {
((CRegister)fRegisters[i]).dispose();
fRegisters[i] = null;
((CRegister)fRegisters[i]).resetStatus();
}
}
}