mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 12:05:21 +08:00
service/dap: do not try to access value of unreadable string variables (#4055)
Fixes #4053
This commit is contained in:
committed by
GitHub
parent
4a2a6e1aeb
commit
8a7650b013
@ -2437,8 +2437,10 @@ func (s *Session) childrenToDAPVariables(v *fullyQualifiedVariable) []dap.Variab
|
||||
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
valexpr = fmt.Sprintf("%s[%s]", v.fullyQualifiedNameOrExpr, api.VariableValueAsString(keyv))
|
||||
case reflect.String:
|
||||
if key := constant.StringVal(keyv.Value); keyv.Len == int64(len(key)) { // fully loaded
|
||||
valexpr = fmt.Sprintf("%s[%q]", v.fullyQualifiedNameOrExpr, key)
|
||||
if keyv.Unreadable == nil {
|
||||
if key := constant.StringVal(keyv.Value); keyv.Len == int64(len(key)) { // fully loaded
|
||||
valexpr = fmt.Sprintf("%s[%q]", v.fullyQualifiedNameOrExpr, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
key, keyref := s.convertVariable(keyv, keyexpr)
|
||||
|
||||
Reference in New Issue
Block a user