mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Bug 325063 - [disassembly] view occasionally accepts no further scrolling/PC changes with unhandled assert
This commit is contained in:
parent
3a89b51a37
commit
588a6efd67
2 changed files with 23 additions and 28 deletions
|
@ -32,23 +32,23 @@ import org.eclipse.cdt.dsf.concurrent.Query;
|
|||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IDisassembly;
|
||||
import org.eclipse.cdt.dsf.debug.service.IDisassembly.IDisassemblyDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions;
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMAddress;
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues;
|
||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||
import org.eclipse.cdt.dsf.debug.service.IInstruction;
|
||||
import org.eclipse.cdt.dsf.debug.service.IMixedInstruction;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack;
|
||||
import org.eclipse.cdt.dsf.debug.service.IDisassembly.IDisassemblyDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMAddress;
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExitedDMEvent;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IResumedDMEvent;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
|
||||
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
|
||||
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
|
||||
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
|
||||
|
@ -244,20 +244,24 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
|
|||
stack.getTopFrame(fTargetContext, new DataRequestMonitor<IFrameDMContext>(executor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
fCallback.setUpdatePending(false);
|
||||
fTargetFrameContext= getData();
|
||||
if (fTargetFrameContext != null) {
|
||||
retrieveFrameAddressInSessionThread(frame);
|
||||
} else {
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// TODO retrieve other stack frame
|
||||
fCallback.setUpdatePending(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
assert frame == fTargetFrameContext.getLevel();
|
||||
else if (frame != fTargetFrameContext.getLevel()) {
|
||||
// frame context has changed in the meantime - reinvoke
|
||||
retrieveFrameAddressInSessionThread(fTargetFrameContext.getLevel());
|
||||
return;
|
||||
}
|
||||
|
||||
stack.getFrameData(fTargetFrameContext, new DataRequestMonitor<IFrameDMData>(executor, null) {
|
||||
|
@ -281,7 +285,6 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
|
|||
fCallback.gotoFrame(frame, addressValue);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
final IStatus status= getStatus();
|
||||
|
|
|
@ -1340,19 +1340,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
AddressRangePosition pos = getPositionOfAddress(address);
|
||||
if (pos != null) {
|
||||
if (pos.fValid) {
|
||||
AddressRangePosition previousPos = /* fUpdateBeforeFocus ? getPositionOfAddress(pos.fAddressOffset-1): */ null;
|
||||
if (previousPos == null || previousPos.fValid) {
|
||||
if (fGotoAddressPending.equals(address)) {
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
}
|
||||
gotoPosition(pos, false);
|
||||
} else {
|
||||
int lines = fBufferZone+3;
|
||||
BigInteger endAddress = pos.fAddressOffset;
|
||||
BigInteger startAddress = previousPos.fAddressOffset.max(
|
||||
endAddress.subtract(BigInteger.valueOf(lines * fDocument.getMeanSizeOfInstructions())));
|
||||
retrieveDisassembly(startAddress, endAddress, lines);
|
||||
}
|
||||
if (fGotoAddressPending.equals(address)) {
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
}
|
||||
gotoPosition(pos, false);
|
||||
} else {
|
||||
int lines = fBufferZone+3;
|
||||
BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength).min(
|
||||
|
@ -2032,6 +2023,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
*/
|
||||
public void gotoFrame(int frame) {
|
||||
assert isGuiThread();
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
gotoFrame(frame, PC_UNKNOWN);
|
||||
}
|
||||
|
||||
|
@ -2051,6 +2043,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
public void gotoFrame(int frame, BigInteger address) {
|
||||
assert isGuiThread();
|
||||
if (DEBUG) System.out.println("gotoFrame " + frame + " " + getAddressText(address)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (fGotoAddressPending == fFrameAddress) {
|
||||
// cancel goto address from previous goto frame
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
}
|
||||
fTargetFrame = frame;
|
||||
fFrameAddress = address;
|
||||
if (fTargetFrame == -1) {
|
||||
|
@ -2091,10 +2087,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
addToPCHistory(pcPos);
|
||||
}
|
||||
fGotoFramePending = false;
|
||||
if (fGotoAddressPending == fFrameAddress) {
|
||||
fGotoAddressPending = PC_UNKNOWN;
|
||||
}
|
||||
// if (DEBUG) System.out.println("pc updated "+getAddressText(address)); //$NON-NLS-1$
|
||||
gotoPosition(pcPos, false);
|
||||
updateVisibleArea();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue