mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Fix for bug 73920: Stopping CDT debug at a break point and using a non-text editor throws an error.
This commit is contained in:
parent
c9db949d2b
commit
f172ffa642
4 changed files with 18 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-09-20 Mikhail Khodjaiants
|
||||
Fix for bug 73920: Stopping CDT debug at a break point and using a non-text editor throws an error.
|
||||
* ResumeAtLineActionDelegate.java
|
||||
* RunToLineAdapter.java
|
||||
* ToggleBreakpointAdapter.java
|
||||
|
||||
2004-09-20 Mikhail Khodjaiants
|
||||
Evaluate expressions on stack frame instead of target to provide evaluation context.
|
||||
Evaluate the hovering expression for the selected context only.
|
||||
|
|
|
@ -222,6 +222,9 @@ public class ResumeAtLineActionDelegate implements IWorkbenchWindowActionDelegat
|
|||
if ( input == null ) {
|
||||
return false;
|
||||
}
|
||||
if ( !(editorPart instanceof ITextEditor) ) {
|
||||
return false;
|
||||
}
|
||||
ITextEditor textEditor = (ITextEditor)editorPart;
|
||||
IDocument document = textEditor.getDocumentProvider().getDocument( input );
|
||||
if ( document == null ) {
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.eclipse.jface.text.IDocument;
|
|||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IFileEditorInput;
|
||||
import org.eclipse.ui.IStorageEditorInput;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
|
@ -50,14 +49,13 @@ public class RunToLineAdapter implements IRunToLineTarget {
|
|||
*/
|
||||
public void runToLine( IWorkbenchPart part, ISelection selection, ISuspendResume target ) throws CoreException {
|
||||
String errorMessage = null;
|
||||
if ( part instanceof IEditorPart ) {
|
||||
IEditorPart editorPart = (IEditorPart)part;
|
||||
IEditorInput input = editorPart.getEditorInput();
|
||||
if ( part instanceof ITextEditor ) {
|
||||
ITextEditor textEditor = (ITextEditor)part;
|
||||
IEditorInput input = textEditor.getEditorInput();
|
||||
if ( input == null ) {
|
||||
errorMessage = ActionMessages.getString( "RunToLineAdapter.Empty_editor_1" ); //$NON-NLS-1$
|
||||
}
|
||||
else {
|
||||
ITextEditor textEditor = (ITextEditor)editorPart;
|
||||
IDocument document = textEditor.getDocumentProvider().getDocument( input );
|
||||
if ( document == null ) {
|
||||
errorMessage = ActionMessages.getString( "RunToLineAdapter.Missing_document_1" ); //$NON-NLS-1$
|
||||
|
@ -107,7 +105,9 @@ public class RunToLineAdapter implements IRunToLineTarget {
|
|||
* org.eclipse.debug.core.model.ISuspendResume)
|
||||
*/
|
||||
public boolean canRunToLine( IWorkbenchPart part, ISelection selection, ISuspendResume target ) {
|
||||
return target instanceof IDebugElement && ((IDebugElement)target).getModelIdentifier().equals( CDIDebugModel.getPluginIdentifier() );
|
||||
if ( part instanceof DisassemblyView || part instanceof ITextEditor )
|
||||
return target instanceof IDebugElement && ((IDebugElement)target).getModelIdentifier().equals( CDIDebugModel.getPluginIdentifier() );
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getFileName( IEditorInput input ) throws CoreException {
|
||||
|
|
|
@ -55,14 +55,13 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
|
|||
*/
|
||||
public void toggleLineBreakpoints( IWorkbenchPart part, ISelection selection ) throws CoreException {
|
||||
String errorMessage = null;
|
||||
if ( part instanceof IEditorPart ) {
|
||||
IEditorPart editorPart = (IEditorPart)part;
|
||||
IEditorInput input = editorPart.getEditorInput();
|
||||
if ( part instanceof ITextEditor ) {
|
||||
ITextEditor textEditor = (ITextEditor)part;
|
||||
IEditorInput input = textEditor.getEditorInput();
|
||||
if ( input == null ) {
|
||||
errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Empty_editor_1" ); //$NON-NLS-1$
|
||||
}
|
||||
else {
|
||||
ITextEditor textEditor = (ITextEditor)editorPart;
|
||||
IDocument document = textEditor.getDocumentProvider().getDocument( input );
|
||||
if ( document == null ) {
|
||||
errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Missing_document_1" ); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue