{"record":{"id":"22e68ac37ed92edd","repo":"NationalSecurityAgency/ghidra","slug":"too-many-wildcards-to-breakpoint-specification","errorCode":null,"errorMessage":"Too many wildcards to breakpoint specification","messagePattern":"Too many wildcards to breakpoint specification","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/PlaceEmuBreakpointActionItem.java","lineNumber":87,"sourceCode":"\t\t\tthrow new IllegalArgumentException(\"Address does not belong to a memory in the trace\");\n\t\t}\n\t\treturn region.getObject().findSuitableContainerInterface(TraceBreakpointSpec.class);\n\t}\n\n\tprivate String computePath() {\n\t\tString name = createName(address);\n\t\tTraceObject container = findBreakpointContainer();\n\t\tif (container == null) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Address is not associated with a breakpoint container\");\n\t\t}\n\t\tPathFilter specFilter = container.getSchema().searchFor(TraceBreakpointSpec.class, true);\n\t\tif (specFilter == null) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot find path to breakpoint specifications\");\n\t\t}\n\t\tKeyPath specRelPath = specFilter.applyKeys(name).getSingletonPath();\n\t\tif (specRelPath == null) {\n\t\t\tthrow new IllegalArgumentException(\"Too many wildcards to breakpoint specification\");\n\t\t}\n\t\tPathFilter locFilter = container.getSchema()\n\t\t\t\t.getSuccessorSchema(specRelPath)\n\t\t\t\t.searchFor(TraceBreakpointLocation.class, true);\n\t\tif (locFilter == null) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot find path to breakpoint locations\");\n\t\t}\n\t\tKeyPath locRelPath = locFilter.applyIntKeys(0).getSingletonPath();\n\t\tif (locRelPath == null) {\n\t\t\tthrow new IllegalArgumentException(\"Too many wildcards to breakpoint location\");\n\t\t}\n\t\treturn container.getCanonicalPath().extend(specRelPath).extend(locRelPath).toString();\n\t}\n\n\t@Override\n\tpublic CompletableFuture<Void> execute() {\n\t\ttry (Transaction tx = trace.openTransaction(\"Place Emulated Breakpoint\")) {\n\t\t\t// Defaults with emuEnable=true","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/PlaceEmuBreakpointActionItem.java#L69-L105","documentation":"Thrown by computePath when applying the breakpoint name as a key to the spec PathFilter yields a non-singleton (null) KeyPath, i.e., the filter contains more than one wildcard so a unique path cannot be resolved. Exactly one spec path must result from key substitution.","triggerScenarios":"specFilter.applyKeys(name).getSingletonPath() returns null because the PathFilter pattern has multiple wildcard elements, preventing resolution to a single concrete path.","commonSituations":"A custom schema where the breakpoint spec path has more than one variable/wildcard key; misconfigured schema templates; key collisions producing ambiguous paths.","solutions":["Use a schema whose breakpoint specification path contains at most one wildcard (the breakpoint name key).","Reduce the number of wildcarded path segments in the spec container schema.","If you control the schema, pin extra key segments to constants so only the name remains variable.","Report the schema configuration; the standard schema guarantees a single-wildcard spec path."],"exampleFix":"// before\nKeyPath specRelPath = specFilter.applyKeys(name).getSingletonPath();\nif (specRelPath == null) throw ...; // 'Too many wildcards'\n\n// after - diagnose the filter shape\nList<KeyPath> paths = specFilter.applyKeys(name).getPaths();\nif (paths.size() != 1) {\n    throw new IllegalStateException(\n        \"Expected single spec path, got \" + paths.size() + \": \" + specFilter);\n}","handlingStrategy":"validation","validationCode":"PathFilter f = container.getSchema().searchFor(TraceBreakpointSpec.class, true);\nboolean single = f != null && f.applyKeys(name).getSingletonPath() != null;","typeGuard":"static boolean specPathResolves(PathFilter f, String name) {\n    return f != null && f.applyKeys(name).getSingletonPath() != null;\n}","tryCatchPattern":"try {\n    item.execute();\n} catch (IllegalArgumentException e) {\n    Msg.showError(this, null, \"Ambiguous spec path\", e.getMessage());\n}","preventionTips":["Use schemas with at most one wildcard in the spec path.","Pin extra key segments to constants."],"tags":["breakpoint","emu","wildcard","path","schema"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}