Skip to content

[Debug] Add support for custom labels on breakpoints #1803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2016 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -45,7 +45,6 @@

public abstract class Breakpoint extends PlatformObject implements IBreakpoint, ITriggerPoint {


/**
* Creates a breakpoint.
*
Expand All @@ -61,6 +60,13 @@ public Breakpoint() {
*/
private volatile IMarker fMarker;

/**
* Attribute for custom labeling in breakpoints
*
* @since 3.23
*/
private final String LABEL = "breakpointLabel"; //$NON-NLS-1$

/**
* @see IBreakpoint#setMarker(IMarker)
*/
Expand Down Expand Up @@ -384,4 +390,24 @@ public String toString() {
return builder.toString();
}

/**
* Returns the label associated with this breakpoint, or <code>null</code>
* if no specific label was defined.
*
* @since 3.23
*/
public String getBreakpointLabel() {
return getMarker().getAttribute(LABEL, null);
}

/**
* Sets a new label for the breakpoint.
*
* @param labelValue provide by the user
* @since 3.23
*/
public void setBreakpointLabel(String labelValue) throws CoreException {
setAttribute(LABEL, labelValue);
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
219 changes: 219 additions & 0 deletions debug/org.eclipse.debug.ui/icons/full/elcl16/bp_label.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions debug/org.eclipse.debug.ui/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,5 @@ debug.core.component.label = Platform Debug Core
GroupLaunch.description=Launch several other configurations sequentially

prototype.decorator.label = Prototype Decorator
breakpointLabel.label=Label
breakpointLabel.tooltip=Provide a custom label to quickly identify breakpoint
9 changes: 9 additions & 0 deletions debug/org.eclipse.debug.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,15 @@
enablesFor="+"
id="org.eclipse.debug.ui.breakpointsView.toolbar.remove">
</action>
<action
label="%breakpointLabel.label"
icon="$nl$/icons/full/elcl16/bp_label.svg"
tooltip="%breakpointLabel.tooltip"
class="org.eclipse.debug.internal.ui.actions.breakpoints.BreakpointLabelAction"
menubarPath="breakpointGroup"
enablesFor="1"
id="org.eclipse.debug.ui.breakpointsView.breakpointLabel">
</action>
<action
label="%DisableAllBreakpointsAction.label"
icon="$nl$/icons/full/elcl16/disabled_co.svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -252,4 +252,6 @@ public class ActionMessages extends NLS {
public static String EnableAllBreakpointsAction_0;
public static String EnableAllBreakpointsAction_1;
public static String EnableAllBreakpointsAction_3;
public static String BreakpointLabelDialog;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2020 IBM Corporation and others.
# Copyright (c) 2000, 2025 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -235,4 +235,5 @@ VirtualFindAction_0=Error
VirtualFindAction_1=Unable to locate {0} in viewer

ToggleBreakpointsTargetManager_defaultToggleTarget_name = Default
ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
BreakpointLabelDialog=Provide a custom label, or blank for the default label
Loading
Loading