Files
lix/doc/manual/rl-next/repl-st-errors.md
T
blokykandeldritch horrors 6e1e76f10f libcmd/repl: print error for invalid :st argument
currently, the `:st <n>` command in the debugger will simply silently
fail if the argument cannot be converted to an integer, or if it falls
outside the range of valid stack indices. this isn't too big of problem,
but it can be nicer to tell the user something went wrong, rather than
not give them any output and having them guess (esp. in the second case).

this commit adds two errors, one for each case:

  1. the argument is not actually an integer, or is outside INT_MIN/MAX
     -> "argument '%arg' is not a valid integer"

  2. the argument is an integer outside the range of stack traces
     -> "stack index must be between 0 and %max_frame, but was %arg"

Change-Id: I8109feeede79a9ad3db9ee7dc95d37e7dd19741a
2026-03-18 13:15:13 +00:00

513 B

synopsis, cls, category, credits
synopsis cls category credits
invalid arguments to :st now print an error
5386
Improvements
blokyk

When using the debugger, the :st command used to traverse the call stack would silently fail and put the debugger in an invalid state if the argument given to it wasn't a valid stack frame index.

This change adds an error message warning the user if the given index wasn't a valid frame (telling them the range of valid indices), as well as if it wasn't even a valid integer to begin with.