NationalSecurityAgency/ghidra · error · UnsupportedOperationException
This is meant for p-code executor use
Error message
This is meant for p-code executor use
What it means
DefaultPcodeTraceThreadAccess is a combined memory+register data-access shim intended only for stand-alone p-code executor use (e.g. Sleigh expression evaluation). It does not expose trace properties; getPropertyAccess always throws UnsupportedOperationException because property-based state pieces require the memory/register-level AbstractPcodeTraceDataAccess shim, not this thread-level wrapper.
Source
Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/DefaultPcodeTraceThreadAccess.java:105
@Override
public int getBytes(Address start, ByteBuffer buf) {
if (start.isRegisterAddress()) {
return registers.getBytes(start, buf);
}
return memory.getBytes(start, buf);
}
@Override
public Address translate(Address address) {
if (address.isRegisterAddress()) {
return registers.translate(address);
}
return memory.translate(address);
}
@Override
public <T> PcodeTracePropertyAccess<T> getPropertyAccess(String name, Class<T> type) {
throw new UnsupportedOperationException("This is meant for p-code executor use");
}
@Override
public void initializeThreadContext(PcodeThread<?> thread) {
registers.initializeThreadContext(thread);
}
}
View on GitHub (pinned to d5f144c24d)
Solutions
- Obtain property access from the memory/register-level PcodeTraceDataAccess (AbstractPcodeTraceDataAccess), not the DefaultPcodeTraceThreadAccess wrapper.
- Do not attach property-based state pieces to this thread access shim; it is read-only-ish memory/register multiplexing for expression evaluation.
- If you need properties during emulation, use the full TraceEmulationIntegration data-access path that supports getPropertyAccess.
Example fix
// before: property access requested from the thread shim
PcodeTracePropertyAccess<Long> pa = threadAccess.getPropertyAccess("myProp", Long.class);
// after: get it from the underlying memory/register data access
PcodeTracePropertyAccess<Long> pa = memoryAccess.getPropertyAccess("myProp", Long.class); Defensive patterns
Strategy: validation
Validate before calling
// Only request property access from the memory/register-level data access, not the thread shim.
if (access instanceof DefaultPcodeTraceThreadAccess) {
throw new IllegalStateException(
"Property access unavailable on thread-level shim; use the memory/register data access.");
} Type guard
static boolean supportsPropertyAccess(PcodeTraceDataAccess access) {
return !(access instanceof DefaultPcodeTraceThreadAccess);
} Try / catch
try {
return access.getPropertyAccess(name, type);
} catch (UnsupportedOperationException e) {
if (e.getMessage().contains("p-code executor use")) {
// re-resolve access to the memory/register-level AbstractPcodeTraceDataAccess and retry
} else throw e;
} Prevention
- Never wire property-based state pieces against DefaultPcodeTraceThreadAccess.
- Use the full TraceEmulationIntegration data path when properties are required during emulation.
- Treat the thread shim as memory/register-only for expression evaluation.
When it happens
Trigger: Calling getPropertyAccess(name, type) on a DefaultPcodeTraceThreadAccess instance — e.g. wiring a property p-code state piece (TraceEmulationIntegration property callbacks) against the thread access shim instead of the underlying memory/register data access.
Common situations: Building an emulator state that needs trace properties (e.g. to read/write a custom property during emulation) but using the thread-level data access shim. Mis-wiring property callbacks to the wrong access layer.
Related errors
- Cannot add GZT to program
- Cannot make 'addresses read' concrete buffers
- TracePlatform must use a Sleigh language
- Cannot delete an undefined code unit
- Cannot modify lifespan of default data unit
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/31bcf9f2578b649c.
Report an issue: GitHub.