{"record":{"id":"491a8a15f6382214","repo":"NationalSecurityAgency/ghidra","slug":"cannot-parse-skip-step","errorCode":null,"errorMessage":"Cannot parse skip step: '","messagePattern":"Cannot parse skip step: '","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/time/schedule/SkipStep.java","lineNumber":27,"sourceCode":" *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage ghidra.trace.model.time.schedule;\n\nimport ghidra.pcode.emu.PcodeThread;\nimport ghidra.trace.model.time.schedule.TraceSchedule.TimeRadix;\nimport ghidra.util.exception.CancelledException;\nimport ghidra.util.task.TaskMonitor;\n\npublic class SkipStep extends AbstractStep {\n\n\tpublic static SkipStep parse(long threadKey, String stepSpec, TimeRadix radix) {\n\t\tif (!stepSpec.startsWith(\"s\")) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot parse skip step: '\" + stepSpec + \"'\");\n\t\t}\n\t\ttry {\n\t\t\treturn new SkipStep(threadKey, radix.decode(stepSpec.substring(1)));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(\"Cannot parse skip step: '\" + stepSpec + \"'\");\n\t\t}\n\t}\n\n\t/**\n\t * Construct a skip step for the given thread with the given tick count\n\t * \n\t * @param threadKey the key of the thread in the trace, -1 for the \"last thread\"\n\t * @param tickCount the number of ticks to skip on the thread\n\t */\n\tpublic SkipStep(long threadKey, long tickCount) {\n\t\tsuper(threadKey, tickCount);\n\t}","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/time/schedule/SkipStep.java#L9-L45","documentation":"SkipStep.parse expects a step specification beginning with 's' (for 'skip'). This is the structural check — if the spec does not start with 's', it cannot be a skip step. The skip step skips a number of p-code/instruction ticks without emulation on a thread. This is the first guard in the parser before attempting to decode the numeric portion.","triggerScenarios":"Step.parse routes to SkipStep.parse when stepSpec.startsWith(\"s\") is true, so this specific branch (line 27) is only hit when called directly or when routing logic changes. The more common path is that Step.parse dispatches correctly. A direct call with a spec like '5' or '{r0=1}' triggers this.","commonSituations":"Calling SkipStep.parse directly instead of through Step.parse. Passing a raw numeric spec that was expected to be a skip but lacks the 's' prefix. Misunderstanding the DSL syntax where 's5' means skip 5 ticks but '5' means tick step.","solutions":["Prefix the count with 's', e.g. 's5' instead of '5'","Use Step.parse as the entry point instead of SkipStep.parse directly — it dispatches based on the prefix","If you have a numeric count, construct the step directly: new SkipStep(threadKey, tickCount)"],"exampleFix":"// before\nSkipStep.parse(1, \"5\", radix);\n// after\nSkipStep.parse(1, \"s5\", radix);\n// or construct directly\nnew SkipStep(1, 5);","handlingStrategy":"validation","validationCode":"boolean isSkipStepSpec(String stepSpec) {\n    return stepSpec != null && stepSpec.startsWith(\"s\");\n}","typeGuard":"// N/A","tryCatchPattern":"try {\n    SkipStep step = SkipStep.parse(threadKey, stepSpec, radix);\n} catch (IllegalArgumentException e) {\n    // not a skip step; try tick or patch parsing\n}","preventionTips":["Use Step.parse as the dispatcher — it checks prefixes and routes correctly","Prefix skip counts with 's' when building schedule strings","When constructing programmatically, prefer new SkipStep(threadKey, count)"],"tags":["ghidra","trace-schedule","skip-step","input-validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}