本文整理汇总了Golang中github.com/derekparker/delve/service/api.Stackframe类的典型用法代码示例。如果您正苦于以下问题:Golang Stackframe类的具体用法?Golang Stackframe怎么用?Golang Stackframe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Stackframe类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: convertStacktrace
func (d *Debugger) convertStacktrace(rawlocs []proc.Stackframe, full bool) ([]api.Stackframe, error) {
locations := make([]api.Stackframe, 0, len(rawlocs))
for i := range rawlocs {
frame := api.Stackframe{Location: api.ConvertLocation(rawlocs[i].Call)}
if full {
scope := rawlocs[i].Scope(d.process.CurrentThread)
lv, err := scope.LocalVariables()
if err != nil {
return nil, err
}
av, err := scope.FunctionArguments()
if err != nil {
return nil, err
}
frame.Locals = convertVars(lv)
frame.Arguments = convertVars(av)
}
locations = append(locations, frame)
}
return locations, nil
}
示例2: convertStacktrace
func (d *Debugger) convertStacktrace(rawlocs []proc.Stackframe, cfg *proc.LoadConfig) ([]api.Stackframe, error) {
locations := make([]api.Stackframe, 0, len(rawlocs))
for i := range rawlocs {
frame := api.Stackframe{Location: api.ConvertLocation(rawlocs[i].Call)}
if cfg != nil {
var err error
scope := rawlocs[i].Scope(d.process.CurrentThread)
locals, err := scope.LocalVariables(*cfg)
if err != nil {
return nil, err
}
arguments, err := scope.FunctionArguments(*cfg)
if err != nil {
return nil, err
}
frame.Locals = convertVars(locals)
frame.Arguments = convertVars(arguments)
}
locations = append(locations, frame)
}
return locations, nil
}