protected void addBreakpoint ( final IDbgpSession session , IVdmBreakpoint breakpoint ) throws CoreException , DbgpException { final IDbgpCoreCommands commands = session . getCoreCommands ( ) ; DbgpBreakpointConfig config = createBreakpointConfig ( breakpoint ) ; String id = null ; URI bpUri = null ; // map the outgoing uri if we're a line breakpoint if ( breakpoint instanceof IVdmLineBreakpoint ) { IVdmLineBreakpoint bp = ( IVdmLineBreakpoint ) breakpoint ; bpUri = bpPathMapper . map ( bp . getResourceURI ( ) ) ; } // Type specific if ( breakpoint instanceof IVdmWatchpoint ) { IVdmWatchpoint watchpoint = ( IVdmWatchpoint ) breakpoint ; config . setExpression ( makeWatchpointExpression ( watchpoint ) ) ; id = commands . setWatchBreakpoint ( bpUri , watchpoint . getLineNumber ( ) , config ) ; } else if ( breakpoint instanceof IVdmMethodEntryBreakpoint ) { IVdmMethodEntryBreakpoint entryBreakpoint = ( IVdmMethodEntryBreakpoint ) breakpoint ; if ( entryBreakpoint . breakOnExit ( ) ) { final String exitId = commands . setReturnBreakpoint ( bpUri , entryBreakpoint . getMethodName ( ) , config ) ; entryBreakpoint . setExitBreakpointId ( exitId ) ; } if ( entryBreakpoint . breakOnEntry ( ) ) { final String entryId = commands . setCallBreakpoint ( bpUri , entryBreakpoint . getMethodName ( ) , config ) ; entryBreakpoint . setEntryBreakpointId ( entryId ) ; } } else if ( breakpoint instanceof IVdmLineBreakpoint ) { IVdmLineBreakpoint lineBreakpoint = ( IVdmLineBreakpoint ) breakpoint ; if ( VdmBreakpointUtils . isConditional ( lineBreakpoint ) ) { id = commands . setConditionalBreakpoint ( bpUri , lineBreakpoint . getLineNumber ( ) , config ) ; } else { id = commands . setLineBreakpoint ( bpUri , lineBreakpoint . getLineNumber ( ) , config ) ; } } // else if (breakpoint instanceof IVdmExceptionBreakpoint) { // IVdmExceptionBreakpoint lineBreakpoint = (IVdmExceptionBreakpoint) breakpoint; // id = commands.setExceptionBreakpoint(lineBreakpoint.getTypeName(), // config); // } // Identifier breakpoint . setId ( session , id ) ; }
Adding removing updating