mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 21:40:22 +08:00
Reduce nesting
This commit is contained in:
@ -147,13 +147,15 @@ func (dbp *DebuggedProcess) EvalSymbol(name string) (*Variable, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if entry.Tag == dwarf.TagVariable {
|
||||
n, ok := entry.Val(dwarf.AttrName).(string)
|
||||
if !ok {
|
||||
if entry.Tag != dwarf.TagVariable {
|
||||
continue
|
||||
}
|
||||
|
||||
n, ok := entry.Val(dwarf.AttrName).(string)
|
||||
if !ok || n != name {
|
||||
continue
|
||||
}
|
||||
|
||||
if n == name {
|
||||
offset, ok := entry.Val(dwarf.AttrType).(dwarf.Offset)
|
||||
if !ok {
|
||||
continue
|
||||
@ -176,8 +178,6 @@ func (dbp *DebuggedProcess) EvalSymbol(name string) (*Variable, error) {
|
||||
|
||||
return &Variable{Name: n, Type: t.String(), Value: val}, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("could not find symbol value for %s", name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user