{"record":{"id":"e26092b35e55d236","repo":"NationalSecurityAgency/ghidra","slug":"time-specification-must-have-form-snap-steps-ps","errorCode":null,"errorMessage":"Time specification must have form 'snap[:steps[.pSteps]]'","messagePattern":"Time specification must have form 'snap\\[:steps\\[\\.pSteps\\]\\]'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/time/schedule/TraceSchedule.java","lineNumber":275,"sourceCode":"\t * \n\t * @param spec the string specification\n\t * @param source the presumed source of the schedule\n\t * @param radix the radix\n\t * @return the parsed schedule\n\t */\n\tpublic static TraceSchedule parse(String spec, Source source, TimeRadix radix) {\n\t\tString[] parts = spec.split(\":\", 2);\n\t\tif (parts.length > 2) {\n\t\t\tthrow new AssertionError();\n\t\t}\n\t\tfinal long snap;\n\t\tfinal Sequence ticks;\n\t\tfinal Sequence pTicks;\n\t\ttry {\n\t\t\tsnap = radix.decode(parts[0]);\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(PARSE_ERR_MSG, e);\n\t\t}\n\t\tif (parts.length > 1) {\n\t\t\tString[] subs = parts[1].split(\"\\\\.\");\n\t\t\ttry {\n\t\t\t\tticks = Sequence.parse(subs[0], radix);\n\t\t\t}\n\t\t\tcatch (IllegalArgumentException e) {\n\t\t\t\tthrow new IllegalArgumentException(PARSE_ERR_MSG, e);\n\t\t\t}\n\t\t\tif (subs.length == 1) {\n\t\t\t\tpTicks = new Sequence();\n\t\t\t}\n\t\t\telse if (subs.length == 2) {\n\t\t\t\ttry {\n\t\t\t\t\tpTicks = Sequence.parse(subs[1], radix);\n\t\t\t\t}\n\t\t\t\tcatch (IllegalArgumentException e) {\n\t\t\t\t\tthrow new IllegalArgumentException(PARSE_ERR_MSG, e);","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/time/schedule/TraceSchedule.java#L257-L293","documentation":"TraceSchedule.parse splits the spec on ':' and tries to decode the first part (the snapshot index) as a number. If that fails with NumberFormatException, the generic parse error message is thrown, wrapping the cause. The snapshot must be a valid integer in the given radix.","triggerScenarios":"Calling TraceSchedule.parse with a spec like 'abc:t1-5' or '0x5:t1-5' (with decimal radix), or 'snap:t1-5'. The ':' split produces parts[0]='abc' which cannot be decoded.","commonSituations":"Using hex-formatted snapshot numbers without switching the radix to HEX. Mistyping the schedule string. Passing an unparsable variable or file content as the schedule. Confusing snapshot names (strings) with snapshot indices (numbers).","solutions":["Ensure the snapshot portion (before ':') is a valid integer in the given radix","If using hex, pass TimeRadix.HEX_LOWER or HEX_UPPER: TraceSchedule.parse(spec, source, TimeRadix.HEX_LOWER)","Validate the full spec format with a regex before parsing","Use TraceSchedule.snap(snapIndex) for snapshot-only schedules to avoid string parsing"],"exampleFix":"// before\nTraceSchedule.parse(\"ff:t1-5\", Source.ABNORMAL, TimeRadix.DEC);\n// after\nTraceSchedule.parse(\"ff:t1-5\", Source.ABNORMAL, TimeRadix.HEX_LOWER);","handlingStrategy":"validation","validationCode":"boolean isValidScheduleSpec(String spec, TimeRadix radix) {\n    if (spec == null) return false;\n    String[] parts = spec.split(\":\", 2);\n    try {\n        radix.decode(parts[0]);\n        return true;\n    } catch (NumberFormatException e) {\n        return false;\n    }\n}","typeGuard":"// N/A","tryCatchPattern":"try {\n    TraceSchedule schedule = TraceSchedule.parse(spec, source, radix);\n} catch (IllegalArgumentException e) {\n    // show user the expected format and re-prompt\n}","preventionTips":["Use the correct TimeRadix for the number format in the schedule","Validate the snap portion is numeric before parsing the full schedule","For snapshot-only schedules, use TraceSchedule.snap(index)"],"tags":["ghidra","trace-schedule","parse","number-format"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}