Skip to content

Commit 518c795

Browse files
committed
DRAFT
1 parent d085341 commit 518c795

32 files changed

Lines changed: 3505 additions & 212 deletions

dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/CapturedContext.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import java.util.List;
1818
import java.util.Map;
1919
import java.util.Objects;
20-
import java.util.function.Function;
2120

2221
/** Stores different kind of data (arguments, locals, fields, exception) for a specific location */
2322
public class CapturedContext implements ValueReferenceResolver {
@@ -134,12 +133,12 @@ public CapturedValue getMember(Object target, String memberName) {
134133
}
135134
}
136135
} else {
137-
Map<String, Function<Object, CapturedValue>> specialTypeAccess =
136+
Map<String, WellKnownClasses.SpecialFieldInfo> specialTypeAccess =
138137
WellKnownClasses.getSpecialTypeAccess(target);
139138
if (specialTypeAccess != null) {
140-
Function<Object, CapturedValue> specialFieldAccess = specialTypeAccess.get(memberName);
141-
if (specialFieldAccess != null) {
142-
CapturedValue specialField = specialFieldAccess.apply(target);
139+
WellKnownClasses.SpecialFieldInfo specialFieldInfo = specialTypeAccess.get(memberName);
140+
if (specialFieldInfo != null) {
141+
CapturedValue specialField = specialFieldInfo.accessor.apply(target);
143142
if (specialField != null && specialField.getName().equals(memberName)) {
144143
return specialField;
145144
}
@@ -360,6 +359,14 @@ public Status getStatus(int probeIndex) {
360359
return result;
361360
}
362361

362+
public void addError(ProbeImplementation probeImplementation, EvaluationError evaluationError) {
363+
Status status =
364+
statusByProbeId.computeIfAbsent(
365+
probeImplementation.getProbeId().getEncodedId(),
366+
key -> probeImplementation.createStatus());
367+
status.addError(evaluationError);
368+
}
369+
363370
@Override
364371
public boolean equals(Object o) {
365372
if (this == o) return true;

0 commit comments

Comments
 (0)