1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 00:35:49 +02:00

Bug 326145 - [source lookup] Changing the color of the IP annotation is not reflected immediately in the editor and disassembly

This commit is contained in:
Anton Leherbauer 2010-09-30 10:03:29 +00:00
parent 5b14b5fefb
commit 437d771c94
4 changed files with 27 additions and 55 deletions

View file

@ -26,7 +26,7 @@ command.gotoSymbol.description=Navigate to symbolic address
command.rulerToggleBreakpoint.name=Toggle Breakpoint
command.rulerToggleBreakpoint.description=Toggle breakpoint in disassembly ruler
commandContext.name= In DSF Disassembly
commandContext.name= In Disassembly
commandContext.description= When debugging in assembly mode
# actions
@ -55,9 +55,6 @@ popup.runToLine.label=Run To &Line
# Preferences
debugCallStack = Debug Call Stack
debugCurrentInstructionPointer = Debug Current Instruction Pointer
StaleData.foreground.label=Stale data foreground color
StaleData.foreground.description=This color is used to indicate that a given element of data in a view is stale. User should refresh the view to see current data. The foreground color is used only when the view is showing data in columns.

View file

@ -10,50 +10,6 @@
<extension point="org.eclipse.core.runtime.preferences">
<initializer class="org.eclipse.cdt.dsf.debug.internal.ui.PreferenceInitializer"/>
</extension>
<extension point="org.eclipse.ui.editors.annotationTypes">
<type
name="org.eclipse.cdt.dsf.debug.currentIP">
</type>
<type
name="org.eclipse.cdt.dsf.debug.secondaryIP">
</type>
</extension>
<extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationImageProvider="org.eclipse.cdt.dsf.debug.ui.sourcelookup.InstructionPointerImageProvider"
annotationType="org.eclipse.cdt.dsf.debug.currentIP"
colorPreferenceKey="currentIPColor"
colorPreferenceValue="198,219,174"
highlightPreferenceKey="currentIPHighlight"
highlightPreferenceValue="true"
label="%debugCurrentInstructionPointer"
overviewRulerPreferenceKey="currentIPOverviewRuler"
overviewRulerPreferenceValue="true"
presentationLayer="6"
textPreferenceKey="currentIPIndication"
textPreferenceValue="false"
verticalRulerPreferenceKey="currentIPVerticalRuler"
verticalRulerPreferenceValue="true">
</specification>
<specification
annotationImageProvider="org.eclipse.cdt.dsf.debug.ui.sourcelookup.InstructionPointerImageProvider"
annotationType="org.eclipse.cdt.dsf.debug.secondaryIP"
colorPreferenceKey="secondaryIPColor"
colorPreferenceValue="219,235,204"
highlightPreferenceKey="secondaryIPHighlight"
highlightPreferenceValue="true"
label="%debugCallStack"
overviewRulerPreferenceKey="secondaryIPOverviewRuler"
overviewRulerPreferenceValue="true"
presentationLayer="6"
textPreferenceKey="secondaryIPIndication"
textPreferenceValue="false"
verticalRulerPreferenceKey="secondaryIPVerticalRuler"
verticalRulerPreferenceValue="true">
</specification>
</extension>
<extension point="org.eclipse.ui.viewActions">
<!-- Variables View menu contributions -->

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2009 Wind River Systems and others.
* Copyright (c) 2007, 2010 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
@ -25,8 +25,8 @@ import org.eclipse.swt.widgets.Canvas;
*/
public class DisassemblyIPAnnotation extends Annotation implements IAnnotationPresentation {
public static final String ID_TOP = "org.eclipse.cdt.dsf.debug.currentIP"; //$NON-NLS-1$
public static final String ID_SECONDARY = "org.eclipse.cdt.dsf.debug.secondaryIP"; //$NON-NLS-1$
public static final String ID_TOP = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT;
public static final String ID_SECONDARY = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY;
private Image fImage;
private int fContext = Integer.MIN_VALUE;

View file

@ -19,15 +19,19 @@ import java.util.List;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
import org.eclipse.cdt.dsf.datamodel.DMContexts;
import org.eclipse.cdt.dsf.debug.service.IRunControl;
import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IAnnotationPresentation;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
@ -41,17 +45,17 @@ class InstructionPointerManager {
/**
* Current instruction pointer annotation type.
*/
private static final String ID_CURRENT_IP= "org.eclipse.cdt.dsf.debug.currentIP"; //$NON-NLS-1$
private static final String ID_CURRENT_IP= IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT;
/**
* Secondary instruction pointer annotation type.
*/
private static final String ID_SECONDARY_IP= "org.eclipse.cdt.dsf.debug.secondaryIP"; //$NON-NLS-1$
private static final String ID_SECONDARY_IP= IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY;
/**
* Editor annotation object for instruction pointers.
*/
static class IPAnnotation extends Annotation {
static class IPAnnotation extends Annotation implements IAnnotationPresentation {
/** The image for this annotation. */
private Image fImage;
@ -101,6 +105,21 @@ class InstructionPointerManager {
return fFrame.hashCode();
}
/*
* @see org.eclipse.jface.text.source.IAnnotationPresentation#paint(org.eclipse.swt.graphics.GC, org.eclipse.swt.widgets.Canvas, org.eclipse.swt.graphics.Rectangle)
*/
public void paint(GC gc, Canvas canvas, Rectangle bounds) {
Rectangle imageBounds = fImage.getBounds();
gc.drawImage(fImage, bounds.x + (bounds.width - imageBounds.width) / 2 , bounds.y + (bounds.height - imageBounds.height) / 2);
}
/*
* @see org.eclipse.jface.text.source.IAnnotationPresentation#getLayer()
*/
public int getLayer() {
return 5;
}
}
/**