Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-03-01 14:07:52 +0000
committerAnton Leherbauer2010-03-01 14:07:52 +0000
commit74a81d3e32755e56dde462e96ff49be04afcb84c (patch)
treea733b600f85750e012f1606c523f700efb9eed88 /dsf/org.eclipse.cdt.dsf.ui
parentecac1992cc00a45fbf83ab986ed5d3eaad9b2916 (diff)
downloadorg.eclipse.cdt-74a81d3e32755e56dde462e96ff49be04afcb84c.tar.gz
org.eclipse.cdt-74a81d3e32755e56dde462e96ff49be04afcb84c.tar.xz
org.eclipse.cdt-74a81d3e32755e56dde462e96ff49be04afcb84c.zip
[302875] [dis] Toggling "Show Symbols" resets viewport
[304110] [Disassembly] Refresh button should not jump to PC address
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
index 16e853743b1..82709f52664 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
@@ -1865,13 +1865,25 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
long now = System.currentTimeMillis();
if (now >= refreshViewScheduled) {
if (DEBUG) System.err.println("*** refreshing view ***"); //$NON-NLS-1$
- fFocusAddress = PC_UNKNOWN;
+
+ // save viewport position and frame info
+ BigInteger topAddress = getTopAddress();
int targetFrame= fTargetFrame;
+ BigInteger frameAddress = fFrameAddress;
+ BigInteger pcAddress = fPCAddress;
+
+ // clear viewer
resetViewer();
if (fScrollPos != null) {
fScrollPos.isDeleted = true;
}
- gotoFrameIfActive(targetFrame);
+
+ // restore frame info and viewport
+ fPCAnnotationUpdatePending = true;
+ fTargetFrame = targetFrame;
+ fFrameAddress = frameAddress;
+ fPCAddress = pcAddress;
+ gotoAddress(topAddress);
} else {
refreshView((int)(refreshViewScheduled - now));
}
@@ -1886,6 +1898,14 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
+ private BigInteger getTopAddress() {
+ BigInteger topAddress = getAddressOfLine(fViewer.getTopIndex());
+ if (topAddress.equals(fStartAddress)) {
+ topAddress = getAddressOfLine(fViewer.getTopIndex() + 1);
+ }
+ return topAddress;
+ }
+
private void resetViewer() {
// clear all state and cache
fPCAnnotationUpdatePending = false;

Back to the top