mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-12-13 14:43:16 +00:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
389a0ae441
@ -35,6 +35,7 @@ import ghidra.util.Msg;
|
|||||||
import ghidra.util.database.UndoableTransaction;
|
import ghidra.util.database.UndoableTransaction;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitor;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
import utilities.util.IDHashed;
|
||||||
|
|
||||||
interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
||||||
public static class ProgramBreakpoint {
|
public static class ProgramBreakpoint {
|
||||||
@ -248,33 +249,6 @@ interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class TraceBreakpointSet {
|
static class TraceBreakpointSet {
|
||||||
private static class IDHashed<T> {
|
|
||||||
final T obj;
|
|
||||||
|
|
||||||
public IDHashed(T obj) {
|
|
||||||
this.obj = obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return obj.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return System.identityHashCode(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (!(o instanceof IDHashed<?>)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
IDHashed<?> that = (IDHashed<?>) o;
|
|
||||||
return this.obj.equals(that.obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final TraceRecorder recorder;
|
private final TraceRecorder recorder;
|
||||||
private final Trace trace;
|
private final Trace trace;
|
||||||
private final Address address;
|
private final Address address;
|
||||||
|
@ -22,9 +22,11 @@ import ghidra.program.model.address.Address;
|
|||||||
import ghidra.program.model.address.AddressSpace;
|
import ghidra.program.model.address.AddressSpace;
|
||||||
import ghidra.trace.model.map.UnsignedUtils;
|
import ghidra.trace.model.map.UnsignedUtils;
|
||||||
import ghidra.util.database.spatial.rect.EuclideanSpace2D;
|
import ghidra.util.database.spatial.rect.EuclideanSpace2D;
|
||||||
|
import utilities.util.IDHashed;
|
||||||
|
|
||||||
public class TraceAddressSnapSpace implements EuclideanSpace2D<Address, Long> {
|
public class TraceAddressSnapSpace implements EuclideanSpace2D<Address, Long> {
|
||||||
private static final Map<AddressSpace, TraceAddressSnapSpace> SPACES = new HashMap<>();
|
private static final Map<IDHashed<AddressSpace>, TraceAddressSnapSpace> SPACES =
|
||||||
|
new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the trace-address-snap space for a given address space
|
* Get the trace-address-snap space for a given address space
|
||||||
@ -38,7 +40,8 @@ public class TraceAddressSnapSpace implements EuclideanSpace2D<Address, Long> {
|
|||||||
*/
|
*/
|
||||||
public static TraceAddressSnapSpace forAddressSpace(AddressSpace space) {
|
public static TraceAddressSnapSpace forAddressSpace(AddressSpace space) {
|
||||||
synchronized (SPACES) {
|
synchronized (SPACES) {
|
||||||
return SPACES.computeIfAbsent(space, TraceAddressSnapSpace::new);
|
return SPACES.computeIfAbsent(new IDHashed<>(space),
|
||||||
|
s -> new TraceAddressSnapSpace(space));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
/* ###
|
||||||
|
* IP: GHIDRA
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package utilities.util;
|
||||||
|
|
||||||
|
public class IDHashed<T> {
|
||||||
|
public final T obj;
|
||||||
|
|
||||||
|
public IDHashed(T obj) {
|
||||||
|
this.obj = obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return obj.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return System.identityHashCode(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (!(o instanceof IDHashed<?>)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
IDHashed<?> that = (IDHashed<?>) o;
|
||||||
|
return this.obj.equals(that.obj);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user