Merge remote-tracking branch 'origin/GP-6340_Dan_fixReadTargetLoopInEmu' into patch

This commit is contained in:
Ryan Kurtz
2026-01-16 13:16:03 -05:00
4 changed files with 8 additions and 36 deletions
@@ -132,7 +132,7 @@ public enum DebuggerEmulationIntegration {
@Override @Override
public AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread, public AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread,
PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView set) { PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView set) {
AddressSetView unknown = acc.intersectUnknown(set); AddressSetView unknown = set.subtract(acc.intersectViewKnown(set, false));
if (unknown.isEmpty()) { if (unknown.isEmpty()) {
return super.readUninitialized(acc, thread, piece, set); return super.readUninitialized(acc, thread, piece, set);
} }
@@ -148,7 +148,7 @@ public enum DebuggerEmulationIntegration {
} }
if (acc instanceof PcodeDebuggerMemoryAccess memAcc) { if (acc instanceof PcodeDebuggerMemoryAccess memAcc) {
if (memAcc.isLive() && waitTimeout(memAcc.readFromTargetMemory(unknown))) { if (memAcc.isLive() && waitTimeout(memAcc.readFromTargetMemory(unknown))) {
unknown = memAcc.intersectUnknown(set); unknown = set.subtract(memAcc.intersectViewKnown(set, false));
if (unknown.isEmpty()) { if (unknown.isEmpty()) {
return super.readUninitialized(acc, thread, piece, set); return super.readUninitialized(acc, thread, piece, set);
} }
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -162,20 +162,6 @@ public abstract class AbstractPcodeTraceDataAccess implements InternalPcodeTrace
return platform.mapHostToGuest(hostResult); return platform.mapHostToGuest(hostResult);
} }
@Override
public AddressSetView intersectUnknown(AddressSetView guestView) {
TraceMemoryOperations ops = getMemoryOps(false);
if (ops == null) {
return guestView;
}
AddressSetView hostView = toOverlay(platform.mapGuestToHost(guestView));
AddressSetView hostKnown = ops.getAddressesWithState(snap, hostView,
s -> s != null && s != TraceMemoryState.UNKNOWN);
AddressSetView hostResult = TraceRegisterUtils.getPhysicalSet(hostView.subtract(hostKnown));
return platform.mapHostToGuest(hostResult);
}
@Override @Override
public int putBytes(Address start, ByteBuffer buf) { public int putBytes(Address start, ByteBuffer buf) {
// TODO: Truncate or verify range? // TODO: Truncate or verify range?
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -76,11 +76,6 @@ public class DefaultPcodeTraceThreadAccess
.union(registers.intersectViewKnown(view, useFullSpans)); .union(registers.intersectViewKnown(view, useFullSpans));
} }
@Override
public AddressSetView intersectUnknown(AddressSetView view) {
return memory.intersectUnknown(view).union(registers.intersectUnknown(view));
}
@Override @Override
public int putBytes(Address start, ByteBuffer buf) { public int putBytes(Address start, ByteBuffer buf) {
if (start.isRegisterAddress()) { if (start.isRegisterAddress()) {
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -73,15 +73,6 @@ public interface PcodeTraceDataAccess {
*/ */
AddressSetView intersectViewKnown(AddressSetView view, boolean useFullSpans); AddressSetView intersectViewKnown(AddressSetView view, boolean useFullSpans);
/**
* Compute the intersection of the given address set and the set of
* {@link TraceMemoryState#UNKNOWN} memory
*
* @param view the address set
* @return the intersection
*/
AddressSetView intersectUnknown(AddressSetView view);
/** /**
* Write bytes into the trace * Write bytes into the trace
* *