Disable tracing if it is disabled and debugged program is running, 
        else do nothing.

        :return: False if tracing has been disabled, True else.
431520
def disable_tracing(self):
        
        _logger.x_debug("disable_tracing()")
        #self.dump_tracing_state("before disable_tracing()")
        if self.tracing_enabled and self.execution_started:
            threading.settrace(None)  # don't trace threads to come
            iksettrace3._set_trace_off()
            self.tracing_enabled = False
        #self.dump_tracing_state("after disable_tracing()")
        return self.tracing_enabled
909008
def turn_off(self) -> "Signal":
        
        if _logger is not None:
            self._log(INFO, "turn-off")
        self._is_on = False
        return self
782049
def enable(self):
        
        if self.enabled_start:
            warn('Duplicate "enable" call')
        else:
            self._enable()
            sys.settrace(self._global_trace)
1357411
def enable_call_trace():
    
    def tracer(frame, event, arg):
        if event == 'call':
            co = frame.f_code
            func_name = co.co_name
            if func_name == 'write' or func_name == 'print':
                # ignore write() calls from print statements
                return
            func_line_no = frame.f_lineno
            func_filename = co.co_filename
            caller = frame.f_back
            if caller:
                caller_line_no = caller.f_lineno
                caller_filename = caller.f_code.co_filename
                print('Call to `%s` on line %s:%s from %s:%s' %
                      (func_name, func_filename, func_line_no,
                       caller_filename, caller_line_no))
            return
    sys.settrace(tracer)
291237
def do_quit(self, arg):
        
        if self.cmdprefix:
            raise CmdError("prefix not allowed")
        if arg:
            raise CmdError("too many arguments")
        if self.confirm_quit:
            count = self.debug.get_debugee_count()
            if count > 0:
                if count == 1:
                    msg = "There's a program still running."
                else:
                    msg = "There are %s programs still running." % count
                if not self.ask_user(msg):
                    return False
        self.debuggerExit = True
        return True
1326954
def settrace_forked():
    '''
    
    '''
    from _pydevd_bundle.pydevd_constants import GlobalDebuggerHolder
    GlobalDebuggerHolder.global_dbg = None
    threading.current_thread().additional_info = None

    from _pydevd_frame_eval.pydevd_frame_eval_main import clear_thread_local_info
    host, port = dispatch()

    import pydevd_tracing
    pydevd_tracing.restore_sys_set_trace_func()

    if port is not None:
        global connected
        connected = False
        global forked
        forked = True

        custom_frames_container_init()

        if clear_thread_local_info is not None:
            clear_thread_local_info()

        settrace(
                host,
                port=port,
                suspend=False,
                trace_only_current_thread=False,
                overwrite_prev_trace=True,
                patch_multiprocessing=True,
        )
400014
def start_tracing(self, tid):
        
        if not self.is_tracing(tid):
            thread = self.system.get_thread(tid)
            self.__start_tracing(thread)
633945
def _on_run(self):
        '''  '''

        try:
            while True:
                try:
                    try:
                        cmd = self.cmdQueue.get(1, 0.1)
                    except _queue.Empty:
                        if self.killReceived:
                            try:
                                self.sock.shutdown(SHUT_WR)
                                self.sock.close()
                            except:
                                pass

                            return  # break if queue is empty and killReceived
                        else:
                            continue
                except:
                    # pydev_log.info('Finishing debug communication...(1)')
                    # when liberating the thread here, we could have errors because we were shutting down
                    # but the thread was still not liberated
                    return
                cmd.send(self.sock)

                if cmd.id == CMD_EXIT:
                    break
                if time is None:
                    break  # interpreter shutdown
                time.sleep(self.timeout)
        except Exception:
            GlobalDebuggerHolder.global_dbg.finish_debugging_session()
            if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 0:
                pydev_log_exception()
731095
def checkdebug(self):
        
        # Global debugging
        opt = self.file_grep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)",
                             *self.files)
        for opt1 in opt:
            for opt2 in opt1.split(" "):
                if opt2 in ("--debug", "debug"):
                    return True
        return False
999800
def disable(self):
        
        if CrashReporter.active:
            CrashReporter.active = False
            # Restore the original excepthook
            sys.excepthook = self._excepthook
            self.stop_watcher()
            self.logger.info('CrashReporter: Disabled')
643600
def trace_debug_dispatch(self, frame, event, arg):
        """"""
        trace_log.info(
            'Frame:%s. Event: %s. Arg: %r' % (pretty_frame(frame), event, arg)
        )
        trace_log.debug(
            'state %r breaks ? %s stops ? %s' % (
                self.state, self.breaks(frame, no_remove=True),
                self.state.stops(frame, event)
            )
        )
        if event == 'return':
            trace_log.debug(
                'Return: frame: %s, state: %s, state.f_back: %s' % (
                    pretty_frame(frame), pretty_frame(self.state.frame),
                    pretty_frame(self.state.frame.f_back)
                )
            )
        if self.trace_dispatch(frame, event, arg):
            return self.trace_debug_dispatch
        trace_log.debug("No trace %s" % pretty_frame(frame))
1263748
def validate_tracer(*args):
    

    object, wrapped = args
    if is_traced(object) or is_untracable(object) or get_object_name(object) in UNTRACABLE_NAMES:
        return object

    set_tracer_hook(wrapped, object)
    set_traced(wrapped)

    return wrapped
251157
def deactivate_program(self, program):
        
        self.logger.debug("deactivate_program %s", program)

        with self._program_lock:
            self.logger.debug("deactivate_program got through %s", program)
            if program not in self.program_stack:
                import ipdb
                ipdb.set_trace()
            self.program_stack.remove(program)
            if program in self.program_status:
                del self.program_status[program]
            self._update_program_stack()
1183239
public static boolean isDebuggerAttached()
    {
        final RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();

        for (final String arg : runtimeMXBean.getInputArguments())
        {
            if (arg.contains("-agentlib:jdwp"))
            {
                return true;
            }
        }

        return false;
    }
108965
def set_debugged_thread(self, target_thread_ident=None):
        
        if target_thread_ident is None:
            self.debugged_thread_ident = None
            self.debugged_thread_name = ''
            return {
                "result": self.get_threads(),
                "error": ""
            }
            
        thread_list = self.get_threads()
        if target_thread_ident not in thread_list:
            return {
                "result": None,
                "error": "No thread with ident:%s." % target_thread_ident
            }
        
        if thread_list[target_thread_ident]['is_debugger']:
            return {
                "result": None,
                "error": "Cannot debug IKPdb tracer (sadly...)."
            }
        
        self.debugged_thread_ident = target_thread_ident
        self.debugged_thread_name = thread_list[target_thread_ident]['name']
        return {
            "result": self.get_threads(),
            "error": ""
        }
1187509
def clear
      Debugger.breakpoints.clear if Debugger.started?
      Pry.processor.debugging = false
    end
19423
def debug(self, on: bool = True) -> None:
        
        if on:
            self.send_line("debug on")
        else:
            self.send_line("debug off")