fix: unreliable variable inspector on windows

This commit is contained in:
FalsePattern 2024-05-12 23:54:49 +02:00
parent 6514f65980
commit 5b8613fcd0
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
2 changed files with 27 additions and 8 deletions

View file

@ -22,6 +22,11 @@ Changelog structure reference:
- Zig - Zig
- External Libraries support for zig stdlib - External Libraries support for zig stdlib
### Fixed
- Debugging (Windows)
- Variables sometimes don't show up in the variable inspector when in breakpoint state
## [14.1.0] ## [14.1.0]
### Fixed ### Fixed

View file

@ -863,16 +863,11 @@ public abstract class DAPDriver<
*/ */
@Override @Override
public @NotNull LLValueData getData(@NotNull LLValue value) throws ExecutionException, DebuggerCommandException { public @NotNull LLValueData getData(@NotNull LLValue value) throws ExecutionException, DebuggerCommandException {
String result; String result = "";
int childrenRef = 0; int childrenRef = 0;
boolean failed = false;
if (value.getReferenceExpression().isBlank()) { if (value.getReferenceExpression().isBlank()) {
val known = value.getUserData(LLVALUE_DATA); failed = true;
if (known != null)
return known;
val cRef = value.getUserData(LLVALUE_CHILDREN_REF);
if (cRef != null)
childrenRef = cRef;
result = "";
} else { } else {
val args = new EvaluateArguments(); val args = new EvaluateArguments();
args.setContext(EvaluateArgumentsContext.VARIABLES); args.setContext(EvaluateArgumentsContext.VARIABLES);
@ -882,8 +877,27 @@ public abstract class DAPDriver<
childrenRef = res.getVariablesReference(); childrenRef = res.getVariablesReference();
if (childrenRef > 0) if (childrenRef > 0)
value.putUserData(LLVALUE_CHILDREN_REF, childrenRef); value.putUserData(LLVALUE_CHILDREN_REF, childrenRef);
val hint = res.getPresentationHint();
if (hint != null) {
val attribs = hint.getAttributes();
if (attribs != null) {
for (val attrib: attribs) {
if ("failedEvaluation".equals(attrib)) {
failed = true;
}
}
}
}
result = res.getResult(); result = res.getResult();
} }
if (failed) {
val known = value.getUserData(LLVALUE_DATA);
if (known != null)
return known;
val cRef = value.getUserData(LLVALUE_CHILDREN_REF);
if (cRef != null)
childrenRef = cRef;
}
return new LLValueData(result, null, false, childrenRef > 0, false); return new LLValueData(result, null, false, childrenRef > 0, false);
} }