1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-05 16:15:25 +02:00

Bug 420604 - Disassembly view tends to scroll upwards on refresh

This commit is contained in:
Anton Leherbauer 2013-11-05 15:00:51 +01:00
parent f70547c526
commit 79b3399977

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2012 Wind River Systems and others.
* Copyright (c) 2007, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -277,6 +277,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private volatile int fUpdateCount;
private BigInteger fPCAddress;
private BigInteger fGotoAddressPending= PC_UNKNOWN;
private boolean fGotoAddressOnTop;
private BigInteger fFocusAddress= PC_UNKNOWN;
private int fBufferZone;
private String fDebugSessionId;
@ -1413,10 +1414,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
AddressRangePosition pos = getPositionOfAddress(address);
if (pos != null) {
if (pos.fValid) {
boolean onTop = false;
if (fGotoAddressPending.equals(address)) {
fGotoAddressPending = PC_UNKNOWN;
onTop = fGotoAddressOnTop;
fGotoAddressOnTop = false;
}
gotoPosition(pos, false);
gotoPosition(pos, onTop);
} else {
int lines = fBufferZone+3;
BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength).min(
@ -2035,6 +2039,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fTargetFrame = targetFrame;
fFrameAddress = frameAddress;
fPCAddress = pcAddress;
fGotoAddressOnTop = true;
gotoAddress(topAddress);
} else {
refreshView((int)(refreshViewScheduled - now));