 
   toggleSession: (port) ->
     if @bug?
-      return endSession()
+      return @endSession()
 
     atom.workspaceView.prependToBottom(this)
 

  # array of {breakpointId:id, locations:array of {scriptPath, lineNumber}}
  breakpoints: []
  setBreakpoints: (breakpoints, done) ->
    console.log 'set', breakpoints
    if not @bug?
      @breakpoints.push(bp)  for bp in breakpoints
      return done()
      
    setNext = (breakpoints, done) =>
      console.log 'setting', breakpoints
      return done?() if not breakpoints? or breakpoints.length is 0
      [{breakpointId,locations},tail...] = breakpoints
      [{lineNumber, scriptPath},blah...] = locations

    @updateMarkers()
    @childprocess?.kill()
    @bug?.close() # TODO: unregister handlers orelse memory leak!
    @bug = null
    @detach()
  
  serialize: ->
