{"record":{"id":"06b0a5c36a5c4c6a","repo":"NationalSecurityAgency/ghidra","slug":"mapped-blocks-are-not-supported-in-traces","errorCode":null,"errorMessage":"Mapped blocks are not supported in traces","messagePattern":"Mapped blocks are not supported in traces","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewMemory.java","lineNumber":172,"sourceCode":"\t\t\tbyte initialValue, TaskMonitor monitor, boolean overlay)\n\t\t\tthrows LockException, MemoryConflictException, AddressOverflowException,\n\t\t\tCancelledException {\n\t\t// TODO: Create a region?\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic MemoryBlock createUninitializedBlock(String name, Address start, long size,\n\t\t\tboolean overlay)\n\t\t\tthrows LockException, MemoryConflictException, AddressOverflowException {\n\t\tthrow new UnsupportedOperationException(\"All trace memory is initialized\");\n\t}\n\n\t@Override\n\tpublic MemoryBlock createBitMappedBlock(String name, Address start, Address mappedAddress,\n\t\t\tlong length, boolean overlay) throws LockException, MemoryConflictException,\n\t\t\tAddressOverflowException, IllegalArgumentException {\n\t\tthrow new UnsupportedOperationException(\"Mapped blocks are not supported in traces\");\n\t}\n\n\t@Override\n\tpublic MemoryBlock createByteMappedBlock(String name, Address start, Address mappedAddress,\n\t\t\tlong length, ByteMappingScheme byteMappingScheme, boolean overlay)\n\t\t\tthrows LockException, MemoryConflictException, AddressOverflowException,\n\t\t\tIllegalArgumentException {\n\t\tthrow new UnsupportedOperationException(\"Mapped blocks are not supported in traces\");\n\t}\n\n\t@Override\n\tpublic MemoryBlock createBlock(MemoryBlock block, String name, Address start, long length)\n\t\t\tthrows LockException, MemoryConflictException, AddressOverflowException {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic void removeBlock(MemoryBlock block, TaskMonitor monitor) throws LockException {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewMemory.java#L154-L190","documentation":"Thrown as UnsupportedOperationException by createBitMappedBlock because trace program views do not support bit-mapped overlay blocks. Mapped blocks (where one block mirrors another address range at the bit level) are a regular-Program feature that has no equivalent in the trace memory model, where memory is laid out per address space and snap.","triggerScenarios":"Calling createBitMappedBlock(name, start, mappedAddress, length, overlay) on a DBTraceProgramViewMemory instance.","commonSituations":"Reusing generic Program memory-layout code that creates bit-mapped blocks on a trace view. Attempting to set up register-bank mirrors or address aliasing via bit mapping on a trace.","solutions":["Avoid createBitMappedBlock on traces; it is unsupported by design.","Model the mirrored data explicitly by writing the same bytes to both locations in the trace, if needed.","Use a real Program rather than a trace view if bit-mapped blocks are essential to your workflow."],"exampleFix":"// before\nmem.createBitMappedBlock(\"mirror\", start, mappedAddr, len, false);\n\n// after\n// not supported on traces; write data to both ranges explicitly\nspace.putBytes(snap, start, buf);\nspace.putBytes(snap, mappedAddr, buf);","handlingStrategy":"validation","validationCode":"// Skip bit-mapped block creation on trace views\nif (!(program.getMemory() instanceof DBTraceProgramViewMemory)) {\n    mem.createBitMappedBlock(name, start, mappedAddr, length, overlay);\n}","typeGuard":"static boolean supportsMappedBlocks(Memory m) {\n    return !(m instanceof DBTraceProgramViewMemory);\n}","tryCatchPattern":null,"preventionTips":["Never call createBitMappedBlock on a trace view.","Mirror data by writing bytes explicitly if needed.","Use a real Program when bit-mapped blocks are required."],"tags":["trace-modeling","memory","unsupported-operation","block","mapped","ghidra"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}