From 814868d0c1dce170d076371773749b8400f1e99d Mon Sep 17 00:00:00 2001 From: Scott Tepavich Date: Mon, 4 Jun 2012 11:05:14 -0700 Subject: [PATCH] Bug [381607] Relocated marker message too generalized. Change-Id: I4bb77344a2dd41deee8bbe59d5b0c30ae2946184 --- .../core/breakpoints/BreakpointMessages.properties | 2 +- .../internal/core/breakpoints/CLineBreakpoint.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties index e4dacfa..6ef0a7c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties @@ -26,7 +26,7 @@ CFunctionTracepoint.0=Function tracepoint: {0} # The marker message of a line breakpoint. CLineBreakpoint.0=Line breakpoint: {0} # The marker message of a relocated line breakpoint. -CLineBreakpoint.1=Line breakpoint (relocated): {0} +CLineBreakpoint.1=Line breakpoint (relocated from: {0}): {1} # The marker message of a line tracepoint. CLineTracepoint.0=Line tracepoint: {0} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java index 05a4b01..b57b016 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java @@ -13,11 +13,14 @@ package org.eclipse.cdt.debug.internal.core.breakpoints; import java.util.Map; import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.core.DebugCoreMessages; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import com.ibm.icu.text.MessageFormat; @@ -67,7 +70,16 @@ public class CLineBreakpoint extends AbstractLineBreakpoint { (bp_file == null && bp_reqest_file != null) || (bp_file != null && !bp_file.equals(bp_reqest_file)) ) { - return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.1" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + StringBuffer label = new StringBuffer(); + if (bp_file != null && !bp_file.equals(bp_reqest_file)) { + IPath path = new Path(bp_reqest_file); + if (path.isValidPath(bp_reqest_file)) { + label.append(path.lastSegment()); + } + label.append(' '); + } + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.0"), (Object[])new String[]{ Integer.toString(bp_request_line) })); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.1" ), (Object[])new String[] { label.toString(), CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } else { return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ -- 1.7.5.4