1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-06 00:25: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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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 volatile int fUpdateCount;
private BigInteger fPCAddress; private BigInteger fPCAddress;
private BigInteger fGotoAddressPending= PC_UNKNOWN; private BigInteger fGotoAddressPending= PC_UNKNOWN;
private boolean fGotoAddressOnTop;
private BigInteger fFocusAddress= PC_UNKNOWN; private BigInteger fFocusAddress= PC_UNKNOWN;
private int fBufferZone; private int fBufferZone;
private String fDebugSessionId; private String fDebugSessionId;
@ -1413,10 +1414,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
AddressRangePosition pos = getPositionOfAddress(address); AddressRangePosition pos = getPositionOfAddress(address);
if (pos != null) { if (pos != null) {
if (pos.fValid) { if (pos.fValid) {
boolean onTop = false;
if (fGotoAddressPending.equals(address)) { if (fGotoAddressPending.equals(address)) {
fGotoAddressPending = PC_UNKNOWN; fGotoAddressPending = PC_UNKNOWN;
onTop = fGotoAddressOnTop;
fGotoAddressOnTop = false;
} }
gotoPosition(pos, false); gotoPosition(pos, onTop);
} else { } else {
int lines = fBufferZone+3; int lines = fBufferZone+3;
BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength).min( BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength).min(
@ -2035,6 +2039,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fTargetFrame = targetFrame; fTargetFrame = targetFrame;
fFrameAddress = frameAddress; fFrameAddress = frameAddress;
fPCAddress = pcAddress; fPCAddress = pcAddress;
fGotoAddressOnTop = true;
gotoAddress(topAddress); gotoAddress(topAddress);
} else { } else {
refreshView((int)(refreshViewScheduled - now)); refreshView((int)(refreshViewScheduled - now));