Start debugging from `frame`.

        If frame is not specified, debugging starts from caller's frame.
15913
def set_trace(self, frame=None):
        
        # First disable tracing temporarily as set_trace() may be called while
        # tracing is in use. For example when called from a signal handler and
        # within a debugging session started with runcall().
        self.settrace(False)

        if not frame:
            frame = sys._getframe().f_back
        frame.f_trace = self.trace_dispatch

        # Do not change botframe when the debuggee has been started from an
        # instance of Pdb with one of the family of run methods.
        self.reset(ignore_first_call_event=False, botframe=self.botframe)
        self.topframe = frame
        while frame:
            if frame is self.botframe:
                break
            botframe = frame
            frame = frame.f_back
        else:
            self.botframe = botframe

        # Must trace the bottom frame to disable tracing on termination,
        # see issue 13044.
        if not self.botframe.f_trace:
            self.botframe.f_trace = self.trace_dispatch

        self.settrace(True)
471884
def debug_break(sig, frame):
    """"""
    d = {'_frame': frame}         # Allow access to frame object.
    d.update(frame.f_globals)  # Unless shadowed by global
    d.update(frame.f_locals)

    i = code.InteractiveConsole(d)
    message = "Signal recieved : entering python shell.\nTraceback:\n"
    message += ''.join(traceback.format_stack(frame))
    i.interact(message)
486101
def debug(trace=True, backtrace=1, other=None, output=sys.stderr):
    """"""
    from pprint import pprint
    import traceback
    def debugdeco(func):
        def tracer(frame, event, arg):
            print>>output, '--- Tracer: %s, %r' % (event, arg)
            traceback.print_stack(frame, 1, output)
            return tracer
        def wrapped(*a, **k):
            print>>output
            print>>output, '--- Calling %s.%s with:' % (
                getattr(func, '__module__', ''),
                func.__name__
            )
            for i in enumerate(a):
                print>>output, '    | %s: %s' % i
            print>>output, '    | ',
            pprint(k, output)
            print>>output, '    From:'
            for i in traceback.format_stack(sys._getframe(1), backtrace):
                print>>output, i,
            if other:
                print>>output, '---      [ %r ]' % (other(func,a,k))
            if trace: sys.settrace(tracer)
            ret = func(*a, **k)
            if trace: sys.settrace(None)
            #~ a = list(a)
            print>>output, '--- %s.%s returned: %r' % (
                getattr(func, '__module__', ''),
                func.__name__,
                #~ ret not in a and ret or "ARG%s"%a.index(ret)
                ret
            )
            return ret
        return wrapped
    return debugdeco
68500
def debug(self, *debugReqs):
        """"""
        return self._client.send(debug=sc2api_pb2.RequestDebug(debug=debugReqs))
335178
def stop_trace(self, frame=None):
        """"""
        self.tracing = False
        self.full = False
        frame = frame or sys._getframe().f_back
        while frame:
            del frame.f_trace
            frame = frame.f_back
        sys.settrace(None)
        log.info('Stopping trace')
1108763
def set_trace(addr=DEFAULT_ADDR, port=DEFAULT_PORT):
    
    atexit.register(close_port, port)
    try:
        log("Starting a remote python debugger session on %s:%s" % (addr,
                                                                    port))
        open_port(port)
        debugger = Rpdb(addr=addr, port=port)
        debugger.set_trace(sys._getframe().f_back)
    except Exception:
        _error("Cannot start a remote debug session on %s:%s" % (addr,
                                                                 port))
975390
def debug(self, message, *args, **kwargs):
        
        self._log(logging.DEBUG, message, *args, **kwargs)
463688
def trace_dispatch(self, frame, event, arg):
    """"""
    if hasattr(self, 'vimpdb'):
        return self.vimpdb.trace_dispatch(frame, event, arg)
    else:
        return self._orig_trace_dispatch(frame, event, arg)
1201030
public void startTracking() {
        if (isTracking) {
            return;
        }
        if (this.session == null) {
            addBroadcastReceiver();
        }        
        // if the session is not null, then add the callback to it right away
        if (getSession() != null) {
            getSession().addCallback(callback);
        }
        isTracking = true;
    }
892051
def set_trace(frame=None, skip=0, server=None, port=None):
    """"""
    frame = frame or sys._getframe().f_back
    for i in range(skip):
        if not frame.f_back:
            break
        frame = frame.f_back
    wdb = Wdb.get(server=server, port=port)
    wdb.set_trace(frame)
    return wdb
1317655
def _set_trace(self, skip=0):
        """"""
        frame = sys._getframe().f_back
        # go up the specified number of frames
        for i in range(skip):
            frame = frame.f_back
        self.reset()
        while frame:
            frame.f_trace = self.trace_dispatch
            self.botframe = frame
            frame = frame.f_back
        self.set_step()
        sys.settrace(self.trace_dispatch)
1318848
private final static int onBreak(Frame frame) {
        // We always fall back to Debugger.CONTINUE after each onBreak to avoid eternal step-over flag
        //int oldReturn = onBreakReturn;
        //onBreakReturn = Debugger.CONTINUE;
        //return oldReturn;
        if (verbose) {
            logger.info("Continuing with "+(onBreakReturn==Debugger.CONTINUE?"continue":"step-over"));
        }
        return onBreakReturn;
    }
1174395
def start_trace(self, full=False, frame=None, below=0, under=None):
        """"""
        if self.tracing:
            return
        self.reset()
        log.info('Starting trace')
        frame = frame or sys._getframe().f_back
        # Setting trace without pausing
        self.set_trace(frame, break_=False)
        self.tracing = True
        self.below = below
        self.under = under
        self.full = full
1364193
def _StartDebugger():
  """"""
  global _hub_client
  global _breakpoints_manager

  cdbg_native.InitializeModule(_flags)

  _hub_client = gcp_hub_client.GcpHubClient()
  visibility_policy = _GetVisibilityPolicy()

  _breakpoints_manager = breakpoints_manager.BreakpointsManager(
      _hub_client,
      visibility_policy)

  # Set up loggers for logpoints.
  capture_collector.SetLogger(logging.getLogger())

  capture_collector.CaptureCollector.pretty_printers.append(
      appengine_pretty_printers.PrettyPrinter)

  _hub_client.on_active_breakpoints_changed = (
      _breakpoints_manager.SetActiveBreakpoints)
  _hub_client.on_idle = _breakpoints_manager.CheckBreakpointsExpiration
  _hub_client.SetupAuth(
      _flags.get('project_id'),
      _flags.get('project_number'),
      _flags.get('service_account_json_file'))
  _hub_client.InitializeDebuggeeLabels(_flags)
  _hub_client.Start()
456161
def _debug(self, msg, *args, **kwargs):
        """"""

        # Do nothing if debugging is disabled
        if self._debug_stream is None or self._debug_stream is False:
            return

        # What are we passing to the format?
        if kwargs:
            fmtargs = kwargs
        else:
            fmtargs = args

        # Emit the message
        print >>self._debug_stream, msg % fmtargs
861842
def _debug(self, out, print_prefix=True):
        
        if self.debug:
            if print_prefix:
                pre = self.__class__.__name__
                if hasattr(self, 'debug_prefix'):
                    pre = getattr(self, 'debug_prefix')
                sys.stderr.write("%s: " % pre)
            sys.stderr.write(out)
469291
def debug(text):
    
    frame = inspect.currentframe().f_back
    module = frame.f_globals['__name__']
    func = frame.f_code.co_name
    msg = "%s.%s: %s" % (module, func, text)
    _LOGGER.debug(msg)