mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-4125 Added memory block artificial attribute flag
This commit is contained in:
@@ -104,7 +104,7 @@ public class ProgramEmulationUtils {
|
||||
*/
|
||||
public static Set<TraceMemoryFlag> getRegionFlags(MemoryBlock block) {
|
||||
Set<TraceMemoryFlag> result = EnumSet.noneOf(TraceMemoryFlag.class);
|
||||
int mask = block.getPermissions();
|
||||
int mask = block.getFlags();
|
||||
if ((mask & MemoryBlock.READ) != 0) {
|
||||
result.add(TraceMemoryFlag.READ);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ package ghidra.trace.database.program;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import javax.help.UnsupportedOperationException;
|
||||
|
||||
import ghidra.framework.store.LockException;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.trace.database.memory.DBTraceMemorySpace;
|
||||
@@ -57,7 +59,7 @@ public class DBTraceProgramViewMemoryRegionBlock extends AbstractDBTraceProgramV
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPermissions() {
|
||||
public int getFlags() {
|
||||
int bits = 0;
|
||||
for (TraceMemoryFlag flag : region.getFlags()) {
|
||||
bits |= flag.getBits();
|
||||
@@ -145,4 +147,15 @@ public class DBTraceProgramViewMemoryRegionBlock extends AbstractDBTraceProgramV
|
||||
public void setVolatile(boolean v) {
|
||||
region.setVolatile(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArtificial() {
|
||||
// By definition, any region present on target is non-artificial
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArtificial(boolean a) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DBTraceProgramViewMemorySpaceBlock extends AbstractDBTraceProgramVi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPermissions() {
|
||||
public int getFlags() {
|
||||
return MemoryBlock.READ | MemoryBlock.WRITE | MemoryBlock.EXECUTE;
|
||||
}
|
||||
|
||||
@@ -119,6 +119,16 @@ public class DBTraceProgramViewMemorySpaceBlock extends AbstractDBTraceProgramVi
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArtificial() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArtificial(boolean a) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSourceName() {
|
||||
return "Trace"; // TODO: What does this method actually do?
|
||||
|
||||
@@ -116,7 +116,7 @@ public class DBTraceProgramViewRegisterMemoryBlock implements MemoryBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPermissions() {
|
||||
public int getFlags() {
|
||||
return MemoryBlock.READ | MemoryBlock.WRITE;
|
||||
}
|
||||
|
||||
@@ -220,6 +220,16 @@ public class DBTraceProgramViewRegisterMemoryBlock implements MemoryBlock {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArtificial() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArtificial(boolean a) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSourceName() {
|
||||
return "Trace"; // TODO: What does this method actually do?
|
||||
|
||||
Reference in New Issue
Block a user