mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 09:46:56 +08:00
service/dap: do not attempt further loading on unreadable string vars (#4016)
Do not attempt further loading of unreadable string vars because their Value field will be nil, causing a panic, and also it can't possibly work. Fixes #4010
This commit is contained in:
committed by
GitHub
parent
3a2409b13f
commit
7c9b7d8dca
@ -2899,7 +2899,7 @@ func (s *Session) onEvaluateRequest(request *dap.EvaluateRequest) {
|
||||
ctxt := request.Arguments.Context
|
||||
switch ctxt {
|
||||
case "repl", "variables", "hover", "clipboard":
|
||||
if exprVar.Kind == reflect.String {
|
||||
if exprVar.Kind == reflect.String && exprVar.Unreadable == nil {
|
||||
if strVal := constant.StringVal(exprVar.Value); exprVar.Len > int64(len(strVal)) {
|
||||
// Reload the string value with a bigger limit.
|
||||
loadCfg := DefaultLoadConfig
|
||||
|
||||
Reference in New Issue
Block a user