mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 21:45:55 +08:00
Merge remote-tracking branch 'origin/GP-2760_Dan_fixPlatformMapping'
This commit is contained in:
+2
-3
@@ -22,8 +22,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import agent.gdb.manager.GdbStackFrame;
|
||||
import agent.gdb.manager.impl.cmd.GdbStateChangeRecord;
|
||||
import ghidra.dbg.agent.DefaultTargetObject;
|
||||
import ghidra.dbg.target.TargetObject;
|
||||
import ghidra.dbg.target.TargetStackFrame;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.dbg.target.schema.*;
|
||||
import ghidra.dbg.util.PathUtils;
|
||||
import ghidra.lifecycle.Internal;
|
||||
@@ -37,7 +36,7 @@ import ghidra.program.model.address.Address;
|
||||
@TargetAttributeType(type = Void.class) })
|
||||
public class GdbModelTargetStackFrame
|
||||
extends DefaultTargetObject<TargetObject, GdbModelTargetStack>
|
||||
implements TargetStackFrame, GdbModelSelectableObject {
|
||||
implements TargetStackFrame, TargetAggregate, GdbModelSelectableObject {
|
||||
public static final String FUNC_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "function";
|
||||
public static final String FROM_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "from"; // TODO
|
||||
|
||||
|
||||
+25
-2
@@ -233,6 +233,8 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
private DebuggerModelService modelService;
|
||||
@AutoServiceConsumed
|
||||
private DebuggerEmulationService emulationService;
|
||||
@AutoServiceConsumed
|
||||
private DebuggerPlatformService platformService;
|
||||
@SuppressWarnings("unused")
|
||||
private final AutoService.Wiring autoServiceWiring;
|
||||
|
||||
@@ -473,6 +475,21 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
return coordinates.recorder(recorder);
|
||||
}
|
||||
|
||||
protected DebuggerCoordinates fillInPlatform(DebuggerCoordinates coordinates) {
|
||||
if (platformService == null || coordinates.getTrace() == null) {
|
||||
return coordinates;
|
||||
}
|
||||
// This will emit an event, but it should have no effect
|
||||
DebuggerPlatformMapper mapper = platformService.getMapper(coordinates.getTrace(),
|
||||
coordinates.getObject(), coordinates.getSnap());
|
||||
if (mapper == null) {
|
||||
return coordinates;
|
||||
}
|
||||
TracePlatform platform =
|
||||
getPlatformForMapper(current.getTrace(), current.getObject(), mapper);
|
||||
return coordinates.platform(platform);
|
||||
}
|
||||
|
||||
protected DebuggerCoordinates doSetCurrent(DebuggerCoordinates newCurrent) {
|
||||
newCurrent = newCurrent == null ? DebuggerCoordinates.NOWHERE : newCurrent;
|
||||
synchronized (listenersByTrace) {
|
||||
@@ -480,6 +497,7 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
if (current.equals(resolved)) {
|
||||
return null;
|
||||
}
|
||||
resolved = fillInPlatform(resolved);
|
||||
current = resolved;
|
||||
contextChanged();
|
||||
if (resolved.getTrace() != null) {
|
||||
@@ -542,6 +560,11 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
activateSnap(snap);
|
||||
}
|
||||
|
||||
protected TracePlatform getPlatformForMapper(Trace trace, TraceObject object,
|
||||
DebuggerPlatformMapper mapper) {
|
||||
return trace.getPlatformManager().getPlatform(mapper.getCompilerSpec(object));
|
||||
}
|
||||
|
||||
protected void doPlatformMapperSelected(Trace trace, DebuggerPlatformMapper mapper) {
|
||||
synchronized (listenersByTrace) {
|
||||
if (!listenersByTrace.containsKey(trace)) {
|
||||
@@ -549,8 +572,8 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
}
|
||||
DebuggerCoordinates cur =
|
||||
lastCoordsByTrace.getOrDefault(trace, DebuggerCoordinates.NOWHERE);
|
||||
DebuggerCoordinates adj = cur.platform(
|
||||
trace.getPlatformManager().getPlatform(mapper.getCompilerSpec(cur.getObject())));
|
||||
DebuggerCoordinates adj =
|
||||
cur.platform(getPlatformForMapper(trace, cur.getObject(), mapper));
|
||||
lastCoordsByTrace.put(trace, adj);
|
||||
if (trace == current.getTrace()) {
|
||||
current = adj;
|
||||
|
||||
Reference in New Issue
Block a user