{"record":{"id":"5412f631e65e186c","repo":"NationalSecurityAgency/ghidra","slug":"traces-do-not-support-externals","errorCode":null,"errorMessage":"Traces do not support externals","messagePattern":"Traces do not support externals","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramView.java","lineNumber":786,"sourceCode":"\t@Override\n\tpublic FunctionManager getFunctionManager() {\n\t\treturn functionManager;\n\t}\n\n\t@Override\n\tpublic ProgramUserData getProgramUserData() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic SymbolTable getSymbolTable() {\n\t\treturn symbolTable;\n\t}\n\n\t@Override\n\tpublic ExternalManager getExternalManager() {\n\t\tthrow new UnsupportedOperationException(\"Traces do not support externals\");\n\t}\n\n\t@Override\n\tpublic EquateTable getEquateTable() {\n\t\treturn equateTable;\n\t}\n\n\t@Override\n\tpublic DBTraceProgramViewMemory getMemory() {\n\t\treturn memory;\n\t}\n\n\t@Override\n\tpublic ReferenceManager getReferenceManager() {\n\t\treturn referenceManager;\n\t}\n\n\t@Override","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramView.java#L768-L804","documentation":"Thrown as UnsupportedOperationException by getExternalManager because trace program views do not model external locations. Externals (library functions referenced but not defined in the program) are a regular-Program concept that traces intentionally do not support, since traces capture dynamic recorded state rather than static external-linkage metadata.","triggerScenarios":"Calling getExternalManager() on a DBTraceProgramView (the trace-backed Program implementation).","commonSituations":"Running generic Program-analysis tooling that unconditionally calls getExternalManager() on any Program, including trace views. Scripting that iterates external symbols/functions without checking the program type.","solutions":["Guard the call: check whether the program is a trace view (instanceof DBTraceProgramView) before calling getExternalManager().","Branch your analysis to skip external handling entirely for trace program views.","If you need externals, operate on the original static Program that the trace maps to, not the trace view itself."],"exampleFix":"// before\nExternalManager ext = program.getExternalManager();\n\n// after\nif (!(program instanceof DBTraceProgramView)) {\n    ExternalManager ext = program.getExternalManager();\n    // ... use externals\n}","handlingStrategy":"validation","validationCode":"// Avoid calling getExternalManager on trace program views\nif (!(program instanceof DBTraceProgramView)) {\n    ExternalManager ext = program.getExternalManager();\n}","typeGuard":"static boolean isTraceProgramView(Program p) {\n    return p instanceof DBTraceProgramView;\n}","tryCatchPattern":null,"preventionTips":["Type-check the Program before calling getExternalManager.","Skip external-handling code for trace views.","Access externals on the original static Program when needed."],"tags":["trace-modeling","external","unsupported-operation","ghidra"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}