mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 315443 - [disassembly] Not possible to remove breakpoint in disassembly view with double clicks
This commit is contained in:
parent
f357f9741f
commit
03871352b5
3 changed files with 32 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
* Patrick Chuong (Texas Instruments) - Bug 315443
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.model;
|
||||
|
||||
|
@ -1169,7 +1170,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
return pos;
|
||||
}
|
||||
labelPos = new LabelPosition(0, labelLine.length(), address, null);
|
||||
labelPos = new LabelPosition(0, labelLine.length(), address, label);
|
||||
pos = insertAddressRange(pos, labelPos, labelLine, true);
|
||||
addLabelPosition(labelPos);
|
||||
return pos;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
* Patrick Chuong (Texas Instruments) - Bug 315443
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
||||
|
||||
|
@ -16,6 +17,7 @@ import java.net.URI;
|
|||
import org.eclipse.cdt.core.IAddress;
|
||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
|
||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
|
||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.LabelPosition;
|
||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.SourcePosition;
|
||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.model.DisassemblyDocument;
|
||||
import org.eclipse.cdt.utils.Addr64;
|
||||
|
@ -26,6 +28,7 @@ import org.eclipse.core.resources.IStorage;
|
|||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.text.Position;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link IDisassemblySelection}.
|
||||
|
@ -39,6 +42,7 @@ public class DisassemblySelection implements IDisassemblySelection {
|
|||
private IStorage fSourceFile;
|
||||
private int fSourceLine;
|
||||
private IAddress fStartAddress;
|
||||
private String fLabel;
|
||||
|
||||
/**
|
||||
* Create a disassembly selection from a normal text selection and a disassembly part.
|
||||
|
@ -80,6 +84,17 @@ public class DisassemblySelection implements IDisassemblySelection {
|
|||
fStartAddress = null;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Position labelPosition = document.getPosition(DisassemblyDocument.CATEGORY_LABELS, offset, true);
|
||||
if (labelPosition != null) {
|
||||
if (labelPosition instanceof LabelPosition) {
|
||||
fLabel = ((LabelPosition) labelPosition).fLabel;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
fLabel = null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -172,4 +187,10 @@ public class DisassemblySelection implements IDisassemblySelection {
|
|||
return fStartAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.2
|
||||
*/
|
||||
public String getLabel() {
|
||||
return fLabel;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
* Patrick Chuong (Texas Instruments) - Bug 315443
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
||||
|
||||
|
@ -46,4 +47,11 @@ public interface IDisassemblySelection extends ITextSelection {
|
|||
* @return the 0-based line number of the source file associated with the selection, -1 if not available
|
||||
*/
|
||||
int getSourceLine();
|
||||
|
||||
/**
|
||||
* @return the label, may be <code>null</code>
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
String getLabel();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue