Record a stack trace at the point when an ROOT TObject is deleted
763496
def showdeletion(self, *objects):
        
        from ..memory import showdeletion as S
        for o in objects:
            S.monitor_object_cleanup(o)
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))
948320
private int getStackOffset(@NonNull StackTraceElement[] trace) {
    checkNotNull(trace);

    for (int i = MIN_STACK_OFFSET; i < trace.length; i++) {
      StackTraceElement e = trace[i];
      String name = e.getClassName();
      if (!name.equals(LoggerPrinter.class.getName()) && !name.equals(Logger.class.getName())) {
        return --i;
      }
    }
    return -1;
  }
287846
public void trace(Object message, Throwable t) {
        doLog(Level.TRACE, FQCN, message, null, t);
    }
168456
private static String __getStackTrace(Throwable throwable) {
        StringWriter stringWriter = new StringWriter();
        throwable.printStackTrace(new PrintWriter(stringWriter));

        return stringWriter.toString();
    }
1125094
static StackTraceElement[] getStackTrace(final Thread t)
   {
      if (System.getSecurityManager() == null)
         return t.getStackTrace();

      return AccessController.doPrivileged(new PrivilegedAction<StackTraceElement[]>() 
      {
         public StackTraceElement[] run()
         {
            return t.getStackTrace();
         }
      });
   }
263872
public static <T extends Throwable> T clearStackTrace(@NotNull T throwable) {
		Throwable cause = throwable;
		while (cause != null) {
			cause.setStackTrace(EMPTY_STACK_TRACE);
			cause = cause.getCause();
		}
		return throwable;
	}
985702
def tail(self, stack_name, cancel, log_func=_tail_print, sleep_time=5,
             include_initial=True):
        """"""
        # First dump the full list of events in chronological order and keep
        # track of the events we've seen already
        seen = set()
        initial_events = self.get_events(stack_name)
        for e in initial_events:
            if include_initial:
                log_func(e)
            seen.add(e['EventId'])

        # Now keep looping through and dump the new events
        while True:
            events = self.get_events(stack_name)
            for e in events:
                if e['EventId'] not in seen:
                    log_func(e)
                    seen.add(e['EventId'])
            if cancel.wait(sleep_time):
                return
743354
def trace_on (full=False):
    """"""
    if full:
        sys.settrace(_trace_full)
    else:
        sys.settrace(_trace)
794093
def _trace (frame, event, arg):
    """"""
    if event in ('call', 'c_call'):
        _trace_line(frame, event, arg)
    elif event in ('return', 'c_return'):
        _trace_line(frame, event, arg)
        print("  return:", arg)
    #elif event in ('exception', 'c_exception'):
    #    _trace_line(frame, event, arg)
    return _trace
630374
static String stackTraceToString(Throwable th) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        for (int depth = 0; depth < 10 && th != null; depth++) {
            th.printStackTrace(pw);
            Throwable cause = th.getCause();
            if (cause != th) {
                th = cause;
                pw.append("-------- chained exception -------").append(nl);
            }
        }
        return sw.toString();
    }
673613
static String stacktraceToString(Exception e) {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        String stackTrace = sw.toString();
        return stackTrace;
    }
116585
def trace_dispatch(self, frame, event, arg):
        """"""
        fun = getattr(self, 'handle_' + event, None)
        if not fun:
            return self.trace_dispatch
        below, continue_below = self.check_below(frame)
        if (self.state.stops(frame, event)
                or (event == 'line' and self.breaks(frame))
                or (event == 'exception' and (self.full or below))):
            fun(frame, arg)

        if event == 'return' and frame == self.state.frame:
            # Upping state
            if self.state.up():
                # No more frames
                self.stop_trace()
                return
            # Threading / Multiprocessing support
            co = self.state.frame.f_code
            if ((co.co_filename.endswith('threading.py')
                 and co.co_name.endswith('_bootstrap_inner'))
                    or (self.state.frame.f_code.co_filename.endswith(
                        os.path.join('multiprocessing', 'process.py'))
                        and self.state.frame.f_code.co_name == '_bootstrap')):
                # Thread / Process is dead
                self.stop_trace()
                self.die()
                return

        if (event == 'call' and not self.stepping and not self.full
                and not continue_below
                and not self.get_file_breaks(frame.f_code.co_filename)):
            # Don't trace anymore here
            return
        return self.trace_dispatch
1278071
function prepareStackTrace (_, stack){
    return $.map(stack.slice(2), function(frame) {
      var _f = {
        fileName: frame.getFileName(),
        linenumber: frame.getLineNumber(),
        columnNumber: frame.getColumnNumber()
      };

      if (frame.getFunctionName()) _f.functionName = frame.getFunctionName();
      if (frame.getMethodName()) _f.methodName = frame.getMethodName();
      if (frame.getThis()) _f.self = frame.getThis();

      return _f;
    });
  }
329374
def enable_tracing(self):
        
        hooktrace = self.hook._trace

        def before(hook_name, methods, kwargs):
            hooktrace.root.indent += 1
            hooktrace(hook_name, kwargs)

        def after(outcome, hook_name, methods, kwargs):
            if outcome.excinfo is None:
                hooktrace("finish", hook_name, "-->", outcome.get_result())
            hooktrace.root.indent -= 1

        return self.add_hookcall_monitoring(before, after)
978773
function prepareStackTrace(error, stack) {
  // Store source maps in a cache so we don't load them more than once when
  // formatting a single stack trace (don't cache them forever though in case
  // the files change on disk and the user wants to see the updated mapping)
  var cache = {};
  return error + stack.map(function(frame) {
    return '\n    at ' + wrapCallSite(cache, frame);
  }).join('');
}
1304859
function report (ex) {
            var args = _slice.call(arguments, 1);
            if (lastExceptionStack) {
                if (lastException === ex) {
                    return; // already caught by an inner catch block, ignore
                } else {
                    var s = lastExceptionStack;
                    lastExceptionStack = null;
                    lastException = null;
                    notifyHandlers.apply(null, [s, null].concat(args));
                }
            }

            var stack = TraceKit.computeStackTrace(ex);
            lastExceptionStack = stack;
            lastException = ex;

            // If the stack trace is incomplete, wait for 2 seconds for
            // slow slow IE to see if onerror occurs or not before reporting
            // this exception; otherwise, we will end up with an incomplete
            // stack trace
            window.setTimeout(function() {
                if (lastException === ex) {
                    lastExceptionStack = null;
                    lastException = null;
                    notifyHandlers.apply(null, [stack, null].concat(args));
                }
            }, (stack.incomplete ? 2000 : 0));

            throw ex; // re-throw to propagate to the top level (and cause window.onerror)
        }