1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 03:53:21 +02:00

Partial fix for bug 41725: I can't set a breakpoint in a function where I used attach source.

This commit is contained in:
Mikhail Khodjaiants 2004-11-09 22:28:09 +00:00
parent d14425742c
commit 216cc40051
6 changed files with 51 additions and 20 deletions

View file

@ -1,3 +1,7 @@
2004-11-09 Mikhail Khodjaiants
Partial fix for bug 41725: I can't set a breakpoint in a function where I used attach source.
* CBreakpointManager.java
2004-11-09 Alain Magloire 2004-11-09 Alain Magloire
Put possiblity to set Exception breakpoint Put possiblity to set Exception breakpoint
* cdi/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManagement.java * cdi/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManagement.java

View file

@ -53,6 +53,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
@ -217,9 +218,15 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
if ( breakpoint instanceof ICAddressBreakpoint ) if ( breakpoint instanceof ICAddressBreakpoint )
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
if ( breakpoint instanceof ICLineBreakpoint ) { if ( breakpoint instanceof ICLineBreakpoint ) {
ICSourceLocator sl = getSourceLocator(); try {
if ( sl != null ) String handle = breakpoint.getSourceHandle();
return sl.contains( resource ); ICSourceLocator sl = getSourceLocator();
if ( sl != null )
return ( sl.findSourceElement( handle ) != null );
}
catch( CoreException e ) {
return false;
}
} }
else { else {
IProject project = resource.getProject(); IProject project = resource.getProject();
@ -522,14 +529,19 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException { private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
ICDITarget cdiTarget = getCDITarget(); ICDITarget cdiTarget = getCDITarget();
ICDILocation location = cdiTarget.createLocation( breakpoint.getMarker().getResource().getLocation().lastSegment(), null, breakpoint.getLineNumber() ); String handle = breakpoint.getSourceHandle();
ICDICondition condition = createCondition( breakpoint ); IPath path = new Path( handle );
ICDIBreakpoint cdiBreakpoint = null; if ( path.isValidPath( handle ) ) {
synchronized ( getBreakpointMap() ) { ICDILocation location = cdiTarget.createLocation( path.lastSegment(), null, breakpoint.getLineNumber() );
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); ICDICondition condition = createCondition( breakpoint );
getBreakpointMap().put( breakpoint, cdiBreakpoint ); ICDIBreakpoint cdiBreakpoint = null;
synchronized ( getBreakpointMap() ) {
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
getBreakpointMap().put( breakpoint, cdiBreakpoint );
}
return cdiBreakpoint;
} }
return cdiBreakpoint; return null;
} }
private ICDIBreakpoint setWatchpoint( ICWatchpoint watchpoint ) throws CDIException, CoreException { private ICDIBreakpoint setWatchpoint( ICWatchpoint watchpoint ) throws CDIException, CoreException {

View file

@ -1,3 +1,9 @@
2004-11-09 Mikhail Khodjaiants
Partial fix for bug 41725: I can't set a breakpoint in a function where I used attach source.
* CDTDebugModelPresentation.java
* ToggleBreakpointAdapter.java
* CBreakpointPropertyPage.java
2004-11-09 Mikhail Khodjaiants 2004-11-09 Mikhail Khodjaiants
Fix for bug 77251: Need protected access to DisassemblyView's createVerticalRuler() method. Fix for bug 77251: Need protected access to DisassemblyView's createVerticalRuler() method.
* DisassemblyView.java * DisassemblyView.java

View file

@ -695,7 +695,7 @@ public class CDTDebugModelPresentation extends LabelProvider implements IDebugMo
protected String getLineBreakpointText( ICLineBreakpoint breakpoint, boolean qualified ) throws CoreException { protected String getLineBreakpointText( ICLineBreakpoint breakpoint, boolean qualified ) throws CoreException {
StringBuffer label = new StringBuffer(); StringBuffer label = new StringBuffer();
appendResourceName( breakpoint, label, qualified ); appendSourceName( breakpoint, label, qualified );
appendLineNumber( breakpoint, label ); appendLineNumber( breakpoint, label );
appendIgnoreCount( breakpoint, label ); appendIgnoreCount( breakpoint, label );
appendCondition( breakpoint, label ); appendCondition( breakpoint, label );
@ -704,7 +704,7 @@ public class CDTDebugModelPresentation extends LabelProvider implements IDebugMo
protected String getWatchpointText( ICWatchpoint watchpoint, boolean qualified ) throws CoreException { protected String getWatchpointText( ICWatchpoint watchpoint, boolean qualified ) throws CoreException {
StringBuffer label = new StringBuffer(); StringBuffer label = new StringBuffer();
appendResourceName( watchpoint, label, qualified ); appendSourceName( watchpoint, label, qualified );
appendWatchExpression( watchpoint, label ); appendWatchExpression( watchpoint, label );
appendIgnoreCount( watchpoint, label ); appendIgnoreCount( watchpoint, label );
appendCondition( watchpoint, label ); appendCondition( watchpoint, label );
@ -713,7 +713,7 @@ public class CDTDebugModelPresentation extends LabelProvider implements IDebugMo
protected String getAddressBreakpointText( ICAddressBreakpoint breakpoint, boolean qualified ) throws CoreException { protected String getAddressBreakpointText( ICAddressBreakpoint breakpoint, boolean qualified ) throws CoreException {
StringBuffer label = new StringBuffer(); StringBuffer label = new StringBuffer();
appendResourceName( breakpoint, label, qualified ); appendSourceName( breakpoint, label, qualified );
appendAddress( breakpoint, label ); appendAddress( breakpoint, label );
appendIgnoreCount( breakpoint, label ); appendIgnoreCount( breakpoint, label );
appendCondition( breakpoint, label ); appendCondition( breakpoint, label );
@ -722,17 +722,21 @@ public class CDTDebugModelPresentation extends LabelProvider implements IDebugMo
protected String getFunctionBreakpointText( ICFunctionBreakpoint breakpoint, boolean qualified ) throws CoreException { protected String getFunctionBreakpointText( ICFunctionBreakpoint breakpoint, boolean qualified ) throws CoreException {
StringBuffer label = new StringBuffer(); StringBuffer label = new StringBuffer();
appendResourceName( breakpoint, label, qualified ); appendSourceName( breakpoint, label, qualified );
appendFunction( breakpoint, label ); appendFunction( breakpoint, label );
appendIgnoreCount( breakpoint, label ); appendIgnoreCount( breakpoint, label );
appendCondition( breakpoint, label ); appendCondition( breakpoint, label );
return label.toString(); return label.toString();
} }
protected StringBuffer appendResourceName( ICBreakpoint breakpoint, StringBuffer label, boolean qualified ) { protected StringBuffer appendSourceName( ICBreakpoint breakpoint, StringBuffer label, boolean qualified ) throws CoreException {
IPath path = breakpoint.getMarker().getResource().getLocation(); String handle = breakpoint.getSourceHandle();
if ( !path.isEmpty() ) if ( !isEmpty( handle ) ) {
label.append( qualified ? path.toOSString() : path.lastSegment() ); IPath path = new Path( handle );
if ( path.isValidPath( handle ) ) {
label.append( qualified ? path.toOSString() : path.lastSegment() );
}
}
return label; return label;
} }

View file

@ -326,7 +326,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
return ((IFileEditorInput)input).getFile().getLocation().toOSString(); return ((IFileEditorInput)input).getFile().getLocation().toOSString();
} }
if ( input instanceof IStorageEditorInput ) { if ( input instanceof IStorageEditorInput ) {
return ((IStorageEditorInput)input).getStorage().getName(); return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();
} }
if ( input instanceof DisassemblyEditorInput ) { if ( input instanceof DisassemblyEditorInput ) {
return ((DisassemblyEditorInput)input).getModuleFile(); return ((DisassemblyEditorInput)input).getModuleFile();

View file

@ -303,7 +303,12 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
} }
else if ( breakpoint instanceof ILineBreakpoint ) { else if ( breakpoint instanceof ILineBreakpoint ) {
addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.8" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.8" ) ) ); //$NON-NLS-1$//$NON-NLS-2$
String fileName = breakpoint.getMarker().getResource().getLocation().toOSString(); String fileName = null;
try {
fileName = breakpoint.getSourceHandle();
}
catch( CoreException e ) {
}
if ( fileName != null ) { if ( fileName != null ) {
addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.7" ), fileName ) ); //$NON-NLS-1$ addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.7" ), fileName ) ); //$NON-NLS-1$
} }