// BuildStackWithCallers builds a full stackstrace from the given list of callees.
762657
func BuildStackWithCallers(callers []uintptr) Stack {
	stack := make(Stack, 0, len(callers))

	for _, caller := range callers {
		if fn := runtime.FuncForPC(caller); fn != nil {
			file, line := fn.FileLine(caller)
			stack = append(stack, Frame{shortenFilePath(file), functionNameFromFunc(fn), line})
		}
	}

	return stack
}
935239
func (s *Service) StackList(ctx context.Context, lr *ListRange) (StackListResult, error) {
	var stack StackListResult
	return stack, s.Get(ctx, &stack, fmt.Sprintf("/stacks"), nil, lr)
}
808370
func (m *Map) DumpWithCallbackIfExists(cb DumpCallback) error {
	found, err := m.exist()
	if err != nil {
		return err
	}

	if found {
		return m.DumpWithCallback(cb)
	}

	return nil
}
1286797
func (s *Factory) Stacks(allNamespaces bool) (StackClient, error) {
	version, err := kubernetes.GetStackAPIVersion(s.clientSet.Discovery(), s.experimental)
	if err != nil {
		return nil, err
	}
	namespace := s.namespace
	if allNamespaces {
		namespace = metav1.NamespaceAll
	}

	switch version {
	case kubernetes.StackAPIV1Beta1:
		return newStackV1Beta1(s.config, namespace)
	case kubernetes.StackAPIV1Beta2:
		return newStackV1Beta2(s.config, namespace)
	case kubernetes.StackAPIV1Alpha3:
		return newStackV1Alpha3(s.config, namespace)
	default:
		return nil, errors.Errorf("unsupported stack API version: %q", version)
	}
}
1320592
func (c *Debugger) SetAsyncCallStackDepthWithParams(v *DebuggerSetAsyncCallStackDepthParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Debugger.setAsyncCallStackDepth", Params: v})
}
525943
func (mr *MockBuilderMockRecorder) Build(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Build", reflect.TypeOf((*MockBuilder)(nil).Build), arg0, arg1, arg2, arg3, arg4)
}
562895
func (mock *MyInterfaceMock) ThreeCalls() []struct {
} {
	var calls []struct {
	}
	lockMyInterfaceMockThree.RLock()
	calls = mock.calls.Three
	lockMyInterfaceMockThree.RUnlock()
	return calls
}
651559
func stacktrace() []string {
	ret := make([]string, 0, 2)

	for skip := 2; skip < maxStackFrames; skip++ {
		_, file, line, ok := runtime.Caller(skip)
		if !ok {
			break
		}

		ret = append(ret, fmt.Sprintf("at %s:%d", stripDirectories(file, 1), line))
	}

	return ret
}
759409
func (builder *ListBucketsCommandBuilder) WithCallback(callback func([]string) error) *ListBucketsCommandBuilder {
	builder.callback = callback
	return builder
}
813478
func gatherStack() string {
	root := runtime.GOROOT()
	stack := make([]string, 0, 10)
	pc := make([]uintptr, 10)
	depth := runtime.Callers(4, pc)
	for i := 0; i < depth; i++ {
		f := runtime.FuncForPC(pc[i])
		file, line := f.FileLine(pc[i])
		if strings.HasPrefix(file, root) {
			continue
		}

		path := strings.Split(f.Name(), "/")
		pl := len(path)
		fun := path[pl-1]
		fa := strings.Split(fun, ".")
		if fa[0] == "server" && pl >= 2 {
			fa[0] = path[pl-2]
		}
		w := strings.Join(fa, ".")
		stack = append(stack, fmt.Sprintf("\t%s:%d %s", file, line, w))
	}
	return "\n" + strings.Join(stack, "\n")
}
398840
func (s *Toolchain) SetStackParameters(v map[string]*string) *Toolchain {
	s.StackParameters = v
	return s
}
1033554
func StackList() (stacks []*model.Stack, err error) {
	err = mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		var services []swarm.Service
		opts := types.ServiceListOptions{
			Filters: filters.NewArgs(),
		}
		opts.Filters.Add("label", stackLabel)
		services, err = cli.ServiceList(ctx, opts)
		if err != nil {
			return
		}

		m := make(map[string]*model.Stack)
		for _, service := range services {
			labels := service.Spec.Labels
			name, ok := labels[stackLabel]
			if !ok {
				err = fmt.Errorf("cannot get label %s for service %s(%s)", stackLabel, service.Spec.Name, service.ID)
				return
			}

			if stack, ok := m[name]; ok {
				stack.Services = append(stack.Services, service.Spec.Name)
			} else {
				m[name] = &model.Stack{
					Name:     name,
					Services: []string{service.Spec.Name},
				}
			}
		}

		for _, stack := range m {
			stacks = append(stacks, stack)
		}
		sort.Slice(stacks, func(i, j int) bool {
			return stacks[i].Name < stacks[j].Name
		})
		return
	})
	return
}
227092
func (s *RPCServer) Stacktrace(arg StacktraceIn, out *StacktraceOut) error {
	cfg := arg.Cfg
	if cfg == nil && arg.Full {
		cfg = &api.LoadConfig{true, 1, 64, 64, -1}
	}
	var err error
	out.Locations, err = s.debugger.Stacktrace(arg.Id, arg.Depth, arg.Defers, api.LoadConfigToProc(cfg))
	return err
}
732194
func getStackTracer(err error) (stackTracer, bool) {
	var st stackTracer

	ForEachCause(err, func(err error) bool {
		if s, ok := err.(stackTracer); ok {
			st = s

			return false
		}

		return true
	})

	return st, st != nil
}
69781
func (c *Runtime) SetAsyncCallStackDepthWithParams(v *RuntimeSetAsyncCallStackDepthParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.setAsyncCallStackDepth", Params: v})
}
539302
func ErrorWithStackSkip(level string, err error, skip int, fields ...*Field) {
	stack := BuildStack(2 + skip)
	ErrorWithStack(level, err, stack, fields...)
}
459521
func (err *cmnError) Stacktrace() Error {
	if err.stacktrace == nil {
		var offset = 3
		var depth = 32
		err.stacktrace = captureStacktrace(offset, depth)
	}
	return err
}