mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-02-06 05:41:48 +08:00
Merge remote-tracking branch 'origin/GP-6340_Dan_fixReadTargetLoopInEmu' into patch
This commit is contained in:
@@ -132,7 +132,7 @@ public enum DebuggerEmulationIntegration {
|
||||
@Override
|
||||
public AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread,
|
||||
PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView set) {
|
||||
AddressSetView unknown = acc.intersectUnknown(set);
|
||||
AddressSetView unknown = set.subtract(acc.intersectViewKnown(set, false));
|
||||
if (unknown.isEmpty()) {
|
||||
return super.readUninitialized(acc, thread, piece, set);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public enum DebuggerEmulationIntegration {
|
||||
}
|
||||
if (acc instanceof PcodeDebuggerMemoryAccess memAcc) {
|
||||
if (memAcc.isLive() && waitTimeout(memAcc.readFromTargetMemory(unknown))) {
|
||||
unknown = memAcc.intersectUnknown(set);
|
||||
unknown = set.subtract(memAcc.intersectViewKnown(set, false));
|
||||
if (unknown.isEmpty()) {
|
||||
return super.readUninitialized(acc, thread, piece, set);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* 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);
|
||||
}
|
||||
|
||||
@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
|
||||
public int putBytes(Address start, ByteBuffer buf) {
|
||||
// TODO: Truncate or verify range?
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -76,11 +76,6 @@ public class DefaultPcodeTraceThreadAccess
|
||||
.union(registers.intersectViewKnown(view, useFullSpans));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSetView intersectUnknown(AddressSetView view) {
|
||||
return memory.intersectUnknown(view).union(registers.intersectUnknown(view));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int putBytes(Address start, ByteBuffer buf) {
|
||||
if (start.isRegisterAddress()) {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -73,15 +73,6 @@ public interface PcodeTraceDataAccess {
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user